SHOGUN  6.0.0
Classes | Macros
LinalgBackendEigen.h File Reference

Go to the source code of this file.

Classes

class  LinalgBackendEigen
 Linalg methods with Eigen3 backend. More...
 

Macros

#define DEFINE_FOR_ALL_PTYPE(METHODNAME, Container)
 
#define DEFINE_FOR_REAL_PTYPE(METHODNAME, Container)
 
#define DEFINE_FOR_NON_INTEGER_PTYPE(METHODNAME, Container)
 
#define DEFINE_FOR_NUMERIC_PTYPE(METHODNAME, Container)
 
#define BACKEND_GENERIC_IN_PLACE_ADD(Type, Container)
 
#define BACKEND_GENERIC_CHOLESKY_FACTOR(Type, Container)
 
#define BACKEND_GENERIC_CHOLESKY_SOLVER(Type, Container)
 
#define BACKEND_GENERIC_DOT(Type, Container)
 
#define BACKEND_GENERIC_IN_PLACE_ELEMENT_PROD(Type, Container)
 
#define BACKEND_GENERIC_IN_PLACE_BLOCK_ELEMENT_PROD(Type, Container)
 
#define BACKEND_GENERIC_LOGISTIC(Type, Container)
 
#define BACKEND_GENERIC_IN_PLACE_MATRIX_PROD(Type, Container)
 
#define BACKEND_GENERIC_MAX(Type, Container)
 
#define BACKEND_GENERIC_REAL_MEAN(Type, Container)
 
#define BACKEND_GENERIC_COMPLEX_MEAN(Container)
 
#define BACKEND_GENERIC_RANGE_FILL(Type, Container)
 
#define BACKEND_GENERIC_IN_PLACE_SCALE(Type, Container)
 
#define BACKEND_GENERIC_SET_CONST(Type, Container)
 
#define BACKEND_GENERIC_SUM(Type, Container)
 
#define BACKEND_GENERIC_BLOCK_SUM(Type, Container)
 
#define BACKEND_GENERIC_SYMMETRIC_SUM(Type, Container)
 
#define BACKEND_GENERIC_SYMMETRIC_BLOCK_SUM(Type, Container)
 
#define BACKEND_GENERIC_COLWISE_SUM(Type, Container)
 
#define BACKEND_GENERIC_BLOCK_COLWISE_SUM(Type, Container)
 
#define BACKEND_GENERIC_ROWWISE_SUM(Type, Container)
 
#define BACKEND_GENERIC_BLOCK_ROWWISE_SUM(Type, Container)
 

Macro Definition Documentation

◆ BACKEND_GENERIC_BLOCK_COLWISE_SUM

#define BACKEND_GENERIC_BLOCK_COLWISE_SUM (   Type,
  Container 
)
Value:
virtual SGVector<Type> colwise_sum(const linalg::Block<Container<Type>>& a, bool no_diag) const \
{ \
return colwise_sum_impl(a, no_diag); \
}
SGVector< T > colwise_sum(const SGMatrix< T > &mat, bool no_diag=false)

Implementation of

See also
LinalgBackendBase::colwise_sum

Definition at line 286 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_BLOCK_ROWWISE_SUM

#define BACKEND_GENERIC_BLOCK_ROWWISE_SUM (   Type,
  Container 
)
Value:
virtual SGVector<Type> rowwise_sum(const linalg::Block<Container<Type>>& a, bool no_diag) const \
{ \
return rowwise_sum_impl(a, no_diag); \
}
SGVector< T > rowwise_sum(const SGMatrix< T > &mat, bool no_diag=false)

Implementation of

See also
LinalgBackendBase::rowwise_sum

Definition at line 304 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_BLOCK_SUM

#define BACKEND_GENERIC_BLOCK_SUM (   Type,
  Container 
)
Value:
virtual Type sum(const linalg::Block<Container<Type>>& a, bool no_diag) const \
{ \
return sum_impl(a, no_diag); \
}
T sum(const Container< T > &a, bool no_diag=false)

Implementation of

See also
LinalgBackendBase::sum

Definition at line 250 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_CHOLESKY_FACTOR

#define BACKEND_GENERIC_CHOLESKY_FACTOR (   Type,
  Container 
)
Value:
virtual Container<Type> cholesky_factor(const Container<Type>& A, \
const bool lower) const \
{ \
return cholesky_factor_impl(A, lower); \
}
SGMatrix< T > cholesky_factor(const SGMatrix< T > &A, const bool lower=true)

Implementation of

See also
LinalgBackendBase::cholesky_factor

Definition at line 111 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_CHOLESKY_SOLVER

#define BACKEND_GENERIC_CHOLESKY_SOLVER (   Type,
  Container 
)
Value:
virtual SGVector<Type> cholesky_solver(const Container<Type>& L, \
const SGVector<Type>& b, const bool lower) const \
{ \
return cholesky_solver_impl(L, b, lower); \
}
SGVector< T > cholesky_solver(const SGMatrix< T > &L, const SGVector< T > &b, const bool lower=true)

Implementation of

See also
LinalgBackendBase::cholesky_solver

Definition at line 121 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_COLWISE_SUM

#define BACKEND_GENERIC_COLWISE_SUM (   Type,
  Container 
)
Value:
virtual SGVector<Type> colwise_sum(const Container<Type>& a, bool no_diag) const \
{ \
return colwise_sum_impl(a, no_diag); \
}
SGVector< T > colwise_sum(const SGMatrix< T > &mat, bool no_diag=false)

Implementation of

See also
LinalgBackendBase::colwise_sum

Definition at line 277 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_COMPLEX_MEAN

#define BACKEND_GENERIC_COMPLEX_MEAN (   Container)
Value:
virtual complex128_t mean(const Container<complex128_t>& a) const \
{ \
return mean_impl(a); \
}
std::complex< float64_t > complex128_t
Definition: common.h:77
std::enable_if<!std::is_same< T, complex128_t >::value, float64_t >::type mean(const Container< T > &a)

Implementation of

See also
LinalgBackendBase::mean

Definition at line 200 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_DOT

#define BACKEND_GENERIC_DOT (   Type,
  Container 
)
Value:
virtual Type dot(const Container<Type>& a, const Container<Type>& b) const \
{ \
return dot_impl(a, b); \
}
T dot(const SGVector< T > &a, const SGVector< T > &b)

Implementation of

See also
LinalgBackendBase::dot

Definition at line 131 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_IN_PLACE_ADD

#define BACKEND_GENERIC_IN_PLACE_ADD (   Type,
  Container 
)
Value:
virtual void add(Container<Type>& a, Container<Type>& b, Type alpha, \
Type beta, Container<Type>& result) const \
{ \
add_impl(a, b, alpha, beta, result); \
}
void add(SGVector< T > &a, SGVector< T > &b, SGVector< T > &result, T alpha=1, T beta=1)

Implementation of

See also
LinalgBackendBase::add

Definition at line 100 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_IN_PLACE_BLOCK_ELEMENT_PROD

#define BACKEND_GENERIC_IN_PLACE_BLOCK_ELEMENT_PROD (   Type,
  Container 
)
Value:
virtual void element_prod(linalg::Block<Container<Type>>& a, \
linalg::Block<Container<Type>>& b, Container<Type>& result) const \
{ \
element_prod_impl(a, b, result); \
}
void element_prod(Block< SGMatrix< T >> &a, Block< SGMatrix< T >> &b, SGMatrix< T > &result)

Implementation of

See also
LinalgBackendBase::element_prod

Definition at line 150 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_IN_PLACE_ELEMENT_PROD

#define BACKEND_GENERIC_IN_PLACE_ELEMENT_PROD (   Type,
  Container 
)
Value:
virtual void element_prod(Container<Type>& a, Container<Type>& b,\
Container<Type>& result) const \
{ \
element_prod_impl(a, b, result); \
}
void element_prod(Block< SGMatrix< T >> &a, Block< SGMatrix< T >> &b, SGMatrix< T > &result)

Implementation of

See also
LinalgBackendBase::element_prod

Definition at line 140 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_IN_PLACE_MATRIX_PROD

#define BACKEND_GENERIC_IN_PLACE_MATRIX_PROD (   Type,
  Container 
)
Value:
virtual void matrix_prod(SGMatrix<Type>& a, Container<Type>& b,\
Container<Type>& result, bool transpose_A, bool transpose_B) const \
{ \
matrix_prod_impl(a, b, result, transpose_A, transpose_B); \
}
void matrix_prod(SGMatrix< T > &A, SGVector< T > &b, SGVector< T > &result, bool transpose=false)

Implementation of

See also
LinalgBackendBase::matrix_prod

Definition at line 169 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_IN_PLACE_SCALE

#define BACKEND_GENERIC_IN_PLACE_SCALE (   Type,
  Container 
)
Value:
virtual void scale(Container<Type>& a, Type alpha, Container<Type>& result) const \
{ \
scale_impl(a, alpha, result); \
}
void scale(SGVector< T > &a, SGVector< T > &result, T alpha=1)

Implementation of

See also
linalg::scale

Definition at line 220 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_LOGISTIC

#define BACKEND_GENERIC_LOGISTIC (   Type,
  Container 
)
Value:
virtual void logistic(Container<Type>& a, Container<Type>& result) const \
{ \
logistic_impl(a, result); \
}
void logistic(Matrix A, Matrix result)

Implementation of

See also
LinalgBackendBase::logistic

Definition at line 160 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_MAX

#define BACKEND_GENERIC_MAX (   Type,
  Container 
)
Value:
virtual Type max(const Container<Type>& a) const \
{ \
return max_impl(a); \
}
T max(const Container< T > &a)

Implementation of

See also
LinalgBackendBase::max

Definition at line 180 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_RANGE_FILL

#define BACKEND_GENERIC_RANGE_FILL (   Type,
  Container 
)
Value:
virtual void range_fill(Container<Type>& a, const Type start) const \
{ \
range_fill_impl(a, start); \
}
void range_fill(Container< T > &a, const T start=0)

Implementation of

See also
LinalgBackendBase::range_fill

Definition at line 210 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_REAL_MEAN

#define BACKEND_GENERIC_REAL_MEAN (   Type,
  Container 
)
Value:
virtual float64_t mean(const Container<Type>& a) const \
{ \
return mean_impl(a); \
}
std::enable_if<!std::is_same< T, complex128_t >::value, float64_t >::type mean(const Container< T > &a)
double float64_t
Definition: common.h:60

Implementation of

See also
LinalgBackendBase::mean

Definition at line 190 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_ROWWISE_SUM

#define BACKEND_GENERIC_ROWWISE_SUM (   Type,
  Container 
)
Value:
virtual SGVector<Type> rowwise_sum(const Container<Type>& a, bool no_diag) const \
{ \
return rowwise_sum_impl(a, no_diag); \
}
SGVector< T > rowwise_sum(const SGMatrix< T > &mat, bool no_diag=false)

Implementation of

See also
LinalgBackendBase::rowwise_sum

Definition at line 295 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_SET_CONST

#define BACKEND_GENERIC_SET_CONST (   Type,
  Container 
)
Value:
virtual void set_const(Container<Type>& a, const Type value) const \
{ \
set_const_impl(a, value); \
}
void set_const(Container< T > &a, T value)

Implementation of

See also
LinalgBackendBase::set_const

Definition at line 230 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_SUM

#define BACKEND_GENERIC_SUM (   Type,
  Container 
)
Value:
virtual Type sum(const Container<Type>& a, bool no_diag) const \
{ \
return sum_impl(a, no_diag); \
}
T sum(const Container< T > &a, bool no_diag=false)

Implementation of

See also
LinalgBackendBase::sum

Definition at line 240 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_SYMMETRIC_BLOCK_SUM

#define BACKEND_GENERIC_SYMMETRIC_BLOCK_SUM (   Type,
  Container 
)
Value:
virtual Type sum_symmetric(const linalg::Block<Container<Type>>& a, bool no_diag) const \
{ \
return sum_symmetric_impl(a, no_diag); \
}
T sum_symmetric(const SGMatrix< T > &a, bool no_diag=false)

Implementation of

See also
LinalgBackendBase::sum_symmetric

Definition at line 268 of file LinalgBackendEigen.h.

◆ BACKEND_GENERIC_SYMMETRIC_SUM

#define BACKEND_GENERIC_SYMMETRIC_SUM (   Type,
  Container 
)
Value:
virtual Type sum_symmetric(const Container<Type>& a, bool no_diag) const \
{ \
return sum_symmetric_impl(a, no_diag); \
}
T sum_symmetric(const SGMatrix< T > &a, bool no_diag=false)

Implementation of

See also
LinalgBackendBase::sum_symmetric

Definition at line 259 of file LinalgBackendEigen.h.

◆ DEFINE_FOR_ALL_PTYPE

#define DEFINE_FOR_ALL_PTYPE (   METHODNAME,
  Container 
)
Value:
METHODNAME(bool, Container); \
METHODNAME(char, Container); \
METHODNAME(int8_t, Container); \
METHODNAME(uint8_t, Container); \
METHODNAME(int16_t, Container); \
METHODNAME(uint16_t, Container); \
METHODNAME(int32_t, Container); \
METHODNAME(uint32_t, Container); \
METHODNAME(int64_t, Container); \
METHODNAME(uint64_t, Container); \
METHODNAME(float32_t, Container); \
METHODNAME(float64_t, Container); \
METHODNAME(floatmax_t, Container); \
METHODNAME(complex128_t, Container); \
std::complex< float64_t > complex128_t
Definition: common.h:77
double float64_t
Definition: common.h:60
long double floatmax_t
Definition: common.h:61
float float32_t
Definition: common.h:59

Definition at line 48 of file LinalgBackendEigen.h.

◆ DEFINE_FOR_NON_INTEGER_PTYPE

#define DEFINE_FOR_NON_INTEGER_PTYPE (   METHODNAME,
  Container 
)
Value:
METHODNAME(float32_t, Container); \
METHODNAME(float64_t, Container); \
METHODNAME(floatmax_t, Container); \
METHODNAME(complex128_t, Container);
std::complex< float64_t > complex128_t
Definition: common.h:77
double float64_t
Definition: common.h:60
long double floatmax_t
Definition: common.h:61
float float32_t
Definition: common.h:59

Definition at line 79 of file LinalgBackendEigen.h.

◆ DEFINE_FOR_NUMERIC_PTYPE

#define DEFINE_FOR_NUMERIC_PTYPE (   METHODNAME,
  Container 
)
Value:
METHODNAME(char, Container); \
METHODNAME(int8_t, Container); \
METHODNAME(uint8_t, Container); \
METHODNAME(int16_t, Container); \
METHODNAME(uint16_t, Container); \
METHODNAME(int32_t, Container); \
METHODNAME(uint32_t, Container); \
METHODNAME(int64_t, Container); \
METHODNAME(uint64_t, Container); \
METHODNAME(float32_t, Container); \
METHODNAME(float64_t, Container); \
METHODNAME(floatmax_t, Container);
double float64_t
Definition: common.h:60
long double floatmax_t
Definition: common.h:61
float float32_t
Definition: common.h:59

Definition at line 85 of file LinalgBackendEigen.h.

◆ DEFINE_FOR_REAL_PTYPE

#define DEFINE_FOR_REAL_PTYPE (   METHODNAME,
  Container 
)
Value:
METHODNAME(bool, Container); \
METHODNAME(char, Container); \
METHODNAME(int8_t, Container); \
METHODNAME(uint8_t, Container); \
METHODNAME(int16_t, Container); \
METHODNAME(uint16_t, Container); \
METHODNAME(int32_t, Container); \
METHODNAME(uint32_t, Container); \
METHODNAME(int64_t, Container); \
METHODNAME(uint64_t, Container); \
METHODNAME(float32_t, Container); \
METHODNAME(float64_t, Container); \
METHODNAME(floatmax_t, Container);
double float64_t
Definition: common.h:60
long double floatmax_t
Definition: common.h:61
float float32_t
Definition: common.h:59

Definition at line 64 of file LinalgBackendEigen.h.


SHOGUN Machine Learning Toolbox - Documentation