4 #include "../tensor/algstrct.h" 5 #include "../scaling/scaling.h" 6 #include "../shared/util.h" 27 std::map<tensor*, tensor*>* remap) :
Term(other.
sr) {
40 printf(
"Univar Unifunction applications cannot currently be a part of a longer algebraic expression\n");
46 printf(
"Univar Unifunction applications cannot currently be a part of a longer algebraic expression\n");
89 std::map<tensor*, tensor*>* remap) :
Term(other.
sr) {
107 printf(
"CTF ERROR: cannot scale tensors when using bilinear function or transform, aborting.\n");
118 printf(
"Bivar Bifunction applications cannot currently be a part of a longer algebraic expression\n");
124 printf(
"Bivar Bifunction applications cannot currently be a part of a longer algebraic expression\n");
141 std::set<char> uniq_inds;
142 for (
int i=0; i<(int)iA.size(); i++){
143 uniq_inds.insert(iA[i]);
145 for (
int i=0; i<(int)iB.size(); i++){
146 uniq_inds.insert(iB[i]);
148 return std::vector<char>(uniq_inds.begin(), uniq_inds.end());
a term is an abstract object representing some expression of tensors
CTF::World * where_am_i() const
figures out what world this term lives on
void execute(CTF::Idx_Tensor output) const
evalues the expression, which just scales by default
virtual void execute(CTF::Idx_Tensor output) const =0
evalues the expression, which just scales by default
void execute()
run contraction
bivar_function const * func
std::vector< char > get_uniq_inds() const
find list of unique indices that are involved in this term
void safecopy(char *&a, char const *b) const
copies element b to element a, , with checks for NULL and alloc as necessary
void execute(bool run_diag=false)
run summation
virtual bool isequal(char const *a, char const *b) const
returns true if algstrct elements a and b are equal
CTF::World * where_am_i() const
figures out what world this term lives on
untyped internal class for doubly-typed univariate function
an instance of the CTF library (world) on a MPI communicator
untyped internal class for triply-typed bivariate function
double estimate_time()
predicts execution time in seconds using performance models
CTF::World * wrld
distributed processor context on which tensor is defined
int rank
rank of local processor
class for execution distributed contraction of tensors
virtual Term * clone(std::map< tensor *, tensor * > *remap=NULL) const =0
base classes must implement this copy function to retrieve pointer
univar_function const * func
Term * clone(std::map< tensor *, tensor * > *remap=NULL) const
base classes must implement this copy function to retrieve pointer
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 ...
void get_inputs(std::set< CTF::Idx_Tensor *, tensor_name_less > *inputs_set) const
appends the tensors this depends on to the input set
double estimate_time()
predicts execution time in seconds using performance models
void execute(CTF::Idx_Tensor output) const
evalues the expression, which just scales by default
virtual double estimate_time(CTF::Idx_Tensor output) const =0
estimates the cost of a contraction/sum/.. term
virtual std::vector< char > get_uniq_inds() const =0
find list of unique indices that are involved in this term
void get_inputs(std::set< CTF::Idx_Tensor *, tensor_name_less > *inputs_set) const
appends the tensors this depends on to the input set
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 ...
Term * clone(std::map< tensor *, tensor * > *remap=NULL) const
base classes must implement this copy function to retrieve pointer
Bifun_Term(Term *A, Term *B, bivar_function const *func)
virtual CTF::World * where_am_i() const =0
figures out what world this term lives on
Unifun_Term(Term *A, univar_function const *func)
class for execution distributed summation of tensors
std::vector< char > get_uniq_inds() const
find list of unique indices that are involved in this term
virtual void get_inputs(std::set< CTF::Idx_Tensor *, tensor_name_less > *inputs_set) const =0
appends the tensors this depends on to the input set
virtual char const * mulid() const
identity element for multiplication i.e. 1
a tensor with an index map associated with it (necessary for overloaded operators) ...