1 #ifndef __EXPRESSION_H__ 2 #define __EXPRESSION_H__ 23 CTF_int::Term *
clone(std::map< CTF_int::tensor*, CTF_int::tensor* >* remap = NULL)
const;
32 const char * idx_map_,
43 std::map<CTF_int::tensor*, CTF_int::tensor*>* remap=NULL);
92 void get_inputs(std::set<Idx_Tensor*, CTF_int::tensor_name_less >* inputs_set)
const;
163 template<
typename dtype>
167 template<
typename dtype_A,
typename dtype_B>
170 template<
typename dtype_A,
typename dtype_B,
typename dtype_C>
173 template<
typename dtype_A,
typename dtype_B>
183 void operator,(std::function<
void(dtype_A, dtype_B&)> f){
196 template<
typename dtype_C>
202 template<
typename dtype_A,
typename dtype_B,
typename dtype_C>
208 : Contract_Term(S.operands[0]->
clone(),
209 S.operands[1]->
clone()) {
213 void operator,(std::function<dtype_C(dtype_A, dtype_B)> f){
217 void operator,(std::function<
void(dtype_A, dtype_B, dtype_C&)> f){
223 template<
typename dtype>
226 template<
typename dtype>
238 const char * idx_map_,
249 std::map<CTF_int::tensor*, CTF_int::tensor*>* remap=NULL) :
Idx_Tensor(B,
copy, remap) {}
264 template <
typename dtype_B>
269 template <
typename dtype_A,
typename dtype_B>
280 template <
typename dtype_A,
typename dtype_B>
291 template <
typename dtype_A>
297 template <
typename dtype_A>
319 template<
typename dtype>
331 #include "../tensor/untyped_tensor_tmpl.h" void operator+=(CTF_int::Term const &B)
a term is an abstract object representing some expression of tensors
Typ_Contract_Term< dtype_A, dtype_B, dtype > operator=(Typ_Sum_Term< dtype_A, dtype_B > t)
void operator,(std::function< void(dtype_A, dtype_B &)> f)
void operator+=(double scl)
void safecopy(char *&a, char const *b) const
copies element b to element a, , with checks for NULL and alloc as necessary
Typ_Contract_Term< dtype_A, dtype_B, dtype_C > operator&(Typ_Idx_Tensor< dtype_C > C)
void operator=(Idx_Tensor const &B)
void operator,(std::function< void(dtype_A, dtype_B, dtype_C &)> f)
Typ_Sum_Term< dtype_A, dtype > operator=(Typ_AIdx_Tensor< dtype_A > t)
virtual char const * addid() const
MPI datatype for pairs.
void get_inputs(std::set< Idx_Tensor *, CTF_int::tensor_name_less > *inputs_set) const
appends the tensors this depends on to the input set
an instance of the CTF library (world) on a MPI communicator
void operator=(double scl)
void operator=(CTF_int::Term const &B)
Typ_Contract_Term< dtype_A, dtype_B, dtype > operator+=(Typ_Sum_Term< dtype_A, dtype_B > t)
Typ_AIdx_Tensor(Typ_Idx_Tensor< dtype > const &A)
void operator()(std::function< dtype_B(dtype_A)> f)
Typ_Idx_Tensor< dtype > * tclone() const
Typ_Sum_Term< dtype, dtype_B > operator&(Typ_Idx_Tensor< dtype_B > B)
void operator,(std::function< dtype_B(dtype_A)> f)
Typ_Contract_Term(Typ_Idx_Tensor< dtype_C > *C_, Typ_Sum_Term< dtype_A, dtype_B > S)
CTF_int::Term * clone(std::map< CTF_int::tensor *, CTF_int::tensor * > *remap=NULL) const
base classes must implement this copy function to retrieve pointer
Typ_AIdx_Tensor< dtype > operator~()
Idx_Tensor(CTF_int::tensor *parent_, const char *idx_map_, int copy=0)
constructor takes in a parent tensor and its indices
void operator+=(Idx_Tensor const &B)
double estimate_time(Idx_Tensor output) const
estimates the cost of a contraction
std::vector< char > get_uniq_inds() const
find list of unique indices that are involved in this term
void operator()(std::function< void(dtype_A, dtype_B &)> f)
Typ_Sum_Term(Typ_Idx_Tensor< dtype_A > *A, Typ_Idx_Tensor< dtype_B > *B)
void operator=(int64_t scl)
Idx_Tensor execute(std::vector< char > out_inds) const
evalues the expression to produce an intermediate with all expression indices remaining ...
algstrct (algebraic structure) defines the elementwise operations computed in each tensor contraction...
internal distributed tensor class
void operator+=(int64_t scl)
CTF_int::Term * clone(std::map< CTF_int::tensor *, CTF_int::tensor * > *remap=NULL) const
base classes must implement this copy function to retrieve pointer
Typ_Idx_Tensor< dtype_C > * C
void operator=(CTF_int::Term const &B)
A = B, compute any operations on operand B and set.
Typ_Sum_Term< dtype_A, dtype > operator+=(Typ_AIdx_Tensor< dtype_A > t)
void operator-=(double scl)
void operator()(std::function< void(dtype &)> f)
An experession representing a contraction of a set of tensors contained in operands.
Typ_Idx_Tensor(Typ_Idx_Tensor const &B, int copy=0, std::map< CTF_int::tensor *, CTF_int::tensor * > *remap=NULL)
copy constructor
a tensor with an index map associated with it (necessary for overloaded operators) ...
World * where_am_i() const
figures out what world this term lives on
void operator,(std::function< dtype_C(dtype_A, dtype_B)> f)
void operator*=(double scl)
void operator,(std::function< void(dtype &)> f)
void operator+=(double scl)
Typ_Idx_Tensor(CTF_int::tensor *parent_, const char *idx_map_, int copy=0)
constructor takes in a parent tensor and its indices