CUV  0.9.201304091348
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Enumerations | Functions
Functors without parameters
Pointwise functors on vectors
Collaboration diagram for Functors without parameters:

Enumerations

enum  cuv::NullaryFunctor { NF_FILL, NF_SEQ }
 Nullary functors for vectors and matrices. More...

Functions

template<class __value_type , class __memory_space_type >
void cuv::apply_0ary_functor (tensor< __value_type, __memory_space_type > &v, const NullaryFunctor &sf)
 Apply a pointwise nullary functor to a vector.
template<class __value_type , class __memory_space_type >
void cuv::apply_0ary_functor (tensor< __value_type, __memory_space_type, column_major > &v, const NullaryFunctor &sf)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class V1 , class M >
void cuv::apply_0ary_functor (tensor< V1, M > &v, const NullaryFunctor &sf, const V1 &param)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class V1 , class M >
void cuv::apply_0ary_functor (tensor< V1, M, column_major > &v, const NullaryFunctor &sf, const V1 &param)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<class __value_type , class __memory_space_type , class __memory_layout_type >
void cuv::sequence (tensor< __value_type, __memory_space_type, __memory_layout_type > &v)
 Fill a vector with a sequence of numbers.
template<class __value_type , class __memory_space_type , class __memory_layout_type , class S >
void cuv::fill (tensor< __value_type, __memory_space_type, __memory_layout_type > &v, const S &p)
 Fill a vector with a value.

Detailed Description

Enumeration Type Documentation

Nullary functors for vectors and matrices.

  • NF_FILL fills vector/matrix with parameter a
  • NF_SEQ fills vector/matrix with sequence of numbers starting from 1

Definition at line 56 of file tensor_ops.hpp.

Function Documentation

template<class __value_type , class __memory_space_type >
void cuv::apply_0ary_functor ( tensor< __value_type, __memory_space_type > &  v,
const NullaryFunctor &  sf 
)

Apply a pointwise nullary functor to a vector.

Parameters
vTarget vector
sfNullaryFunctor to apply
template<class V1 , class M >
void cuv::apply_0ary_functor ( tensor< V1, M > &  v,
const NullaryFunctor &  sf,
const V1 &  param 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Apply a pointwise nullary functor with a scalar parameter to a vector.

Parameters
vTarget vector
sfNullaryFunctor to apply
paramscalar parameter
template<class __value_type , class __memory_space_type , class __memory_layout_type , class S >
void cuv::fill ( tensor< __value_type, __memory_space_type, __memory_layout_type > &  v,
const S &  p 
)

Fill a vector with a value.

Parameters
vDestination vector
pValue to fill vector with

This is a convenience wrapper that applies the nullary functor NF_FILL to v.

Definition at line 120 of file tensor_ops.hpp.

template<class __value_type , class __memory_space_type , class __memory_layout_type >
void cuv::sequence ( tensor< __value_type, __memory_space_type, __memory_layout_type > &  v)

Fill a vector with a sequence of numbers.

Parameters
vDestination vector

This is a convenience wrapper that applies the nullary functor NF_SEQ to v.

Definition at line 109 of file tensor_ops.hpp.