Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
|
custom function f : X -> Y to be applied to tensor elemetns: e.g. B["ij"] = f(A["ij"]) More...
#include <functions.h>
Public Member Functions | |
Univar_Function (std::function< dtype_B(dtype_A)> 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 More... | |
void | acc_f (char const *a, char *b, CTF_int::algstrct const *sr_B) const |
compute b = b+f(a) More... | |
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 () |
virtual bool | is_accumulator () const |
Data Fields | |
std::function< dtype_B(dtype_A)> | 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 |
custom function f : X -> Y to be applied to tensor elemetns: e.g. B["ij"] = f(A["ij"])
Definition at line 55 of file functions.h.
|
inline |
constructor takes function pointers to compute B=f(A));
[in] | f_ | linear function (type_A)->(type_B) |
Definition at line 67 of file functions.h.
|
inlinevirtual |
compute b = b+f(a)
[in] | a | pointer to operand that will be cast to dtype |
[in,out] | b | result &f(*a) of applying f on value of (different type) on a |
[in] | sr_B | algebraic structure for b, needed to do add |
Reimplemented from CTF_int::univar_function.
Definition at line 83 of file functions.h.
References CTF_int::algstrct::add(), and CTF::Endomorphism< dtype >::f.
|
inlinevirtual |
apply function f to value stored at a
[in] | a | pointer to operand that will be cast to dtype |
[in,out] | b | result &f(*a) of applying f on value of (different type) on a |
Reimplemented from CTF_int::univar_function.
Definition at line 75 of file functions.h.
References CTF::Endomorphism< dtype >::f.
std::function<dtype_B(dtype_A)> CTF::Univar_Function< dtype_A, dtype_B >::f |
function signature for element-wise multiplication, compute b=f(a)
Definition at line 61 of file functions.h.