Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
|
#include <term.h>
Public Member Functions | |
Sum_Term (Term *B, Term *A) | |
creates sum term for B+A More... | |
~Sum_Term () | |
Sum_Term (Sum_Term const &other, std::map< tensor *, tensor * > *remap=NULL) | |
Term * | clone (std::map< tensor *, tensor * > *remap=NULL) const |
base classes must implement this copy function to retrieve pointer More... | |
void | execute (CTF::Idx_Tensor output) const |
evalues the expression by summing operands into output More... | |
CTF::Idx_Tensor | execute (std::vector< char > out_inds) const |
evalues the expression to produce an intermediate with all expression indices remaining More... | |
double | estimate_time (CTF::Idx_Tensor output) const |
estimates the cost of a sum term More... | |
CTF::Idx_Tensor | estimate_time (double &cost, std::vector< char > out_inds) const |
estimates the cost the expression to produce an intermediate with all expression indices remaining More... | |
std::vector< char > | get_uniq_inds () const |
find list of unique indices that are involved in this term More... | |
void | get_inputs (std::set< CTF::Idx_Tensor *, tensor_name_less > *inputs_set) const |
appends the tensors this depends on to the input set More... | |
Sum_Term | operator+ (Term const &A) const |
constructs a new term by addition of two terms More... | |
Sum_Term | operator- (Term const &A) const |
constructs a new term by subtracting term A More... | |
CTF::World * | where_am_i () const |
negates term More... | |
Public Member Functions inherited from CTF_int::Term | |
Term (algstrct const *sr) | |
virtual | ~Term () |
void | mult_scl (char const *mulscl) |
multiply scaling factor by mulscl More... | |
Contract_Term | operator* (Term const &A) const |
constructs a new term which multiplies by tensor A More... | |
Contract_Term | operator* (int64_t scl) const |
multiples by a constant More... | |
Contract_Term | operator* (double scl) const |
Sum_Term | operator+ (Term const &A) const |
constructs a new term by addition of two terms More... | |
Sum_Term | operator+ (double scl) const |
Sum_Term | operator+ (int64_t scl) const |
Sum_Term | operator- (Term const &A) const |
constructs a new term by subtracting term A More... | |
Sum_Term | operator- (double scl) const |
Sum_Term | operator- (int64_t scl) const |
Term & | operator- () |
void | operator= (CTF::Idx_Tensor const &B) |
A = B, compute any operations on operand B and set. More... | |
void | operator= (Term const &B) |
void | operator+= (Term const &B) |
void | operator-= (Term const &B) |
void | operator*= (Term const &B) |
void | operator= (double scl) |
void | operator+= (double scl) |
void | operator<< (CTF_int::Term const &B) |
void | operator<< (double scl) |
void | operator-= (double scl) |
void | operator*= (double scl) |
void | operator= (int64_t scl) |
void | operator+= (int64_t scl) |
void | operator-= (int64_t scl) |
void | operator*= (int64_t scl) |
void | operator= (int scl) |
void | operator+= (int scl) |
void | operator-= (int scl) |
void | operator*= (int scl) |
operator float () const | |
cast to float (works only if tensor type is castable to float) allows a scalar output More... | |
operator double () const | |
cast to double (works only if tensor type is castable to double) allows a scalar output More... | |
operator int64_t () const | |
cast to int64_t (works only if tensor type is castable to int64_t) allows a scalar output More... | |
operator int () const | |
cast to int64_t (works only if tensor type is castable to int64_t) allows a scalar output More... | |
Data Fields | |
std::vector< Term * > | operands |
Data Fields inherited from CTF_int::Term | |
char * | scale |
algstrct * | sr |
CTF_int::Sum_Term::Sum_Term | ( | Sum_Term const & | other, |
std::map< tensor *, tensor * > * | remap = NULL |
||
) |
Definition at line 359 of file term.cxx.
References operands, CTF_int::algstrct::safecopy(), CTF_int::Term::scale, and CTF_int::Term::sr.
base classes must implement this copy function to retrieve pointer
Implements CTF_int::Term.
Definition at line 369 of file term.cxx.
References Sum_Term().
Referenced by estimate_time(), and execute().
|
virtual |
estimates the cost of a sum term
[in] | output | tensor to write results into and its indices |
Implements CTF_int::Term.
Definition at line 442 of file term.cxx.
References CTF::Idx_Tensor::get_uniq_inds().
|
virtual |
estimates the cost the expression to produce an intermediate with all expression indices remaining
[in,out] | cost | the cost of the operation |
[in] | out_inds | unique indices to not contract/sum away |
Implements CTF_int::Term.
Definition at line 393 of file term.cxx.
References clone(), CTF_int::Term::estimate_time(), CTF::Idx_Tensor::estimate_time(), CTF_int::summation::estimate_time(), CTF_int::get_full_intm(), CTF::Idx_Tensor::idx_map, operands, CTF::Idx_Tensor::parent, and CTF_int::Term::scale.
|
virtual |
evalues the expression by summing operands into output
construct sum term corresponding to a single tensor
[in] | output | tensor to write results into and its indices |
[in,out] | output | tensor to write results into and its indices |
Implements CTF_int::Term.
Definition at line 480 of file term.cxx.
References CTF::Idx_Tensor::get_uniq_inds(), CTF::Idx_Tensor::idx_map, CTF::Idx_Tensor::parent, and CTF_int::Term::scale.
|
virtual |
evalues the expression to produce an intermediate with all expression indices remaining
[in] | out_inds | unique indices to not contract/sum away |
Implements CTF_int::Term.
Definition at line 448 of file term.cxx.
References clone(), CTF_int::Term::execute(), CTF::Idx_Tensor::execute(), CTF_int::summation::execute(), CTF_int::get_full_intm(), CTF::Idx_Tensor::idx_map, operands, CTF::Idx_Tensor::parent, CTF_int::algstrct::safemul(), CTF_int::Term::scale, and CTF_int::Term::sr.
|
virtual |
appends the tensors this depends on to the input set
Implements CTF_int::Term.
Definition at line 496 of file term.cxx.
References operands.
|
virtual |
find list of unique indices that are involved in this term
Implements CTF_int::Term.
Definition at line 492 of file term.cxx.
References CTF_int::det_uniq_inds(), and operands.
constructs a new term by addition of two terms
[in] | A | term to add to output |
Definition at line 374 of file term.cxx.
References CTF_int::Term::clone(), and operands.
constructs a new term by subtracting term A
[in] | A | subtracted term |
Definition at line 386 of file term.cxx.
References CTF_int::Term::clone(), operands, CTF_int::algstrct::safeaddinv(), CTF_int::Term::scale, and CTF_int::Term::sr.
|
virtual |
negates term
figures out what world this term lives on
Implements CTF_int::Term.
Definition at line 503 of file term.cxx.
References operands, and ctf.core::w.
Referenced by CTF_int::Contract_Term::where_am_i().
std::vector< Term* > CTF_int::Sum_Term::operands |
Definition at line 183 of file term.h.
Referenced by estimate_time(), execute(), get_inputs(), get_uniq_inds(), operator+(), CTF_int::Term::operator-(), operator-(), Sum_Term(), where_am_i(), CTF_int::Contract_Term::where_am_i(), CTF_int::Contract_Term::~Contract_Term(), and ~Sum_Term().