4 #include "../tensor/algstrct.h" 17 template <
typename dtype=
double,
bool is_ord=CTF_
int::get_default_is_ord<dtype>()>
21 this->
abs = &CTF_int::char_abs< dtype, CTF_int::default_abs<dtype, is_ord> >;
29 this->
abs = &CTF_int::char_abs< dtype, CTF_int::default_abs<dtype, is_ord> >;
52 void (*gemm_)(
char,
char,
int,
int,
int,
dtype,
dtype const*,
dtype const*,
dtype,
dtype*)=NULL,
55 :
Semiring<
dtype,is_ord>(addid_, fadd_, mulid_, addmop_, fmul_, gemm_, axpy_, scal_) {
56 this->
abs = &CTF_int::char_abs< dtype, CTF_int::default_abs<dtype, is_ord> >;
61 if (b==NULL) b = (
char*)malloc(this->
el_size);
70 void addinv(
char const * a,
char * b)
const {
Ring()
default constructor valid for only certain types: bool, int, unsigned int, int64_t, uint64_t, float, double, std::complex<float>, std::complex<double>
void safeaddinv(char const *a, char *&b) const
b = -a, with checks for NULL and alloc as necessary
Ring class defined by a datatype and addition and multiplicaton functions addition must have an ident...
Ring(dtype addid_, dtype(*fadd_)(dtype a, dtype b), MPI_Op addmop_, dtype mulid_, dtype(*fmul_)(dtype a, dtype b), void(*gemm_)(char, char, int, int, int, dtype, dtype const *, dtype const *, dtype, dtype *)=NULL, void(*axpy_)(int, dtype, dtype const *, int, dtype *, int)=NULL, void(*scal_)(int, dtype, dtype *, int)=NULL)
constructor for algstrct equipped with * and +
Semiring is a Monoid with an addition multiplicaton function addition must have an identity and be as...
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...
virtual CTF_int::algstrct * clone() const
''copy constructor''
void addinv(char const *a, char *b) const
b = -a