4 #include "../tensor/algstrct.h" 15 template <
typename dtype=
double,
bool is_ord=CTF_
int::get_default_is_ord<dtype>()>
25 this->
abs = &CTF_int::char_abs< dtype, CTF_int::default_abs<dtype, is_ord> >;
32 this->
abs = &CTF_int::char_abs< dtype, CTF_int::default_abs<dtype, is_ord> >;
38 printf(
"CTF ERROR: unfortunately additive inverse functionality for groups is currently limited, as it is done for rings via scaling by the inverse of the multiplicative identity, which groups don't have. Use the tensor addinv function rather than an indexed expression.\n");
43 if (b==NULL) b = (
char*)malloc(this->
el_size);
Group(dtype taddid_, dtype(*fadd_)(dtype a, dtype b), MPI_Op addmop_)
virtual CTF_int::algstrct * clone() const
''copy constructor''
void addinv(char const *a, char *b) const
b = -a
Group is a Monoid with operator '-' defined special case (parent) of a ring.
void(* abs)(char const *a, char *b)
b = max(a,addinv(a))
int el_size
size of each element of algstrct in bytes
algstrct (algebraic structure) defines the elementwise operations computed in each tensor contraction...
A Monoid is a Set equipped with a binary addition operator '+' or a custom function addition must hav...
void safeaddinv(char const *a, char *&b) const
b = -a, with checks for NULL and alloc as necessary
Group(Group const &other)