Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
CTF::Univar_Transform< dtype_A, dtype_B > Class Template Reference

custom function f : (X * Y) -> X applied on two tensors as summation: e.g. B["ij"] = f(A["ij"],B["ij"]) More...

#include <functions.h>

Inheritance diagram for CTF::Univar_Transform< dtype_A, dtype_B >:
Collaboration diagram for CTF::Univar_Transform< dtype_A, dtype_B >:

Public Member Functions

 Univar_Transform (std::function< void(dtype_A, dtype_B &)> f_)
 constructor takes function pointers to compute B=f(A)); More...
 
void apply_f (char const *a, char *b) const
 apply function f to value stored at a, for an accumulator, this is the same as acc_f below More...
 
void acc_f (char const *a, char *b, CTF_int::algstrct const *sr_B) const
 compute f(a,b) More...
 
bool is_accumulator () const
 
- Public Member Functions inherited from CTF_int::univar_function
virtual bool is_transform () const
 
 univar_function (void(*f_)(char const *, char *))
 
 univar_function (void(*f_)(char const *, char *), bool is_dist)
 
 univar_function ()
 
 univar_function (univar_function const &other)
 
Unifun_Term operator() (Term const &A) const
 evaluate B=f(A) More...
 
void operator() (Term const &A, Term const &B) const
 evaluate B+=f(A) or f(A,B) if transform More...
 
virtual ~univar_function ()
 

Data Fields

std::function< void(dtype_A, dtype_B &)> f
 function signature for element-wise multiplication, compute b=f(a) More...
 
- Data Fields inherited from CTF_int::univar_function
void(* f )(char const *, char *)
 
bool is_distributive = false
 

Detailed Description

template<typename dtype_A = double, typename dtype_B = dtype_A>
class CTF::Univar_Transform< dtype_A, dtype_B >

custom function f : (X * Y) -> X applied on two tensors as summation: e.g. B["ij"] = f(A["ij"],B["ij"])

Definition at line 96 of file functions.h.

Constructor & Destructor Documentation

template<typename dtype_A = double, typename dtype_B = dtype_A>
CTF::Univar_Transform< dtype_A, dtype_B >::Univar_Transform ( std::function< void(dtype_A, dtype_B &)>  f_)
inline

constructor takes function pointers to compute B=f(A));

Parameters
[in]f_linear function (type_A)->(type_B)

Definition at line 108 of file functions.h.

Member Function Documentation

template<typename dtype_A = double, typename dtype_B = dtype_A>
void CTF::Univar_Transform< dtype_A, dtype_B >::acc_f ( char const *  a,
char *  b,
CTF_int::algstrct const *  sr_B 
) const
inlinevirtual

compute f(a,b)

Parameters
[in]apointer to the accumulated operand
[in,out]bvalue that is accumulated to
[in]sr_Balgebraic structure for b, here is ignored

Reimplemented from CTF_int::univar_function.

Definition at line 124 of file functions.h.

References CTF::Endomorphism< dtype >::f.

template<typename dtype_A = double, typename dtype_B = dtype_A>
void CTF::Univar_Transform< dtype_A, dtype_B >::apply_f ( char const *  a,
char *  b 
) const
inlinevirtual

apply function f to value stored at a, for an accumulator, this is the same as acc_f below

Parameters
[in]apointer to operand that will be cast to dtype
[in,out]bresult &f(*a) of applying f on value of (different type) on a

Reimplemented from CTF_int::univar_function.

Definition at line 116 of file functions.h.

template<typename dtype_A = double, typename dtype_B = dtype_A>
bool CTF::Univar_Transform< dtype_A, dtype_B >::is_accumulator ( ) const
inlinevirtual

Reimplemented from CTF_int::univar_function.

Definition at line 128 of file functions.h.

Field Documentation

template<typename dtype_A = double, typename dtype_B = dtype_A>
std::function<void(dtype_A, dtype_B &)> CTF::Univar_Transform< dtype_A, dtype_B >::f

function signature for element-wise multiplication, compute b=f(a)

Definition at line 102 of file functions.h.


The documentation for this class was generated from the following file: