SHOGUN  6.1.3
Classes | Macros
LinalgBackendBase.h File Reference

Go to the source code of this file.

Classes

class  LinalgBackendBase
 Base interface of generic linalg methods and generic memory transfer methods. 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 BACKEND_GENERIC_IN_PLACE_ADD(Type, Container)
 
#define BACKEND_GENERIC_ADD_COL_VEC(Type, Container)
 
#define BACKEND_GENERIC_ADD_VECTOR(Type, Container)
 
#define BACKEND_GENERIC_ADD_SCALAR(Type, Container)
 
#define BACKEND_GENERIC_CENTER_MATRIX(Type, Container)
 
#define BACKEND_GENERIC_CHOLESKY_FACTOR(Type, Container)
 
#define BACKEND_GENERIC_CHOLESKY_SOLVER(Type, Container)
 
#define BACKEND_GENERIC_CROSS_ENTROPY(Type, Container)
 
#define BACKEND_GENERIC_DOT(Type, Container)
 
#define BACKEND_GENERIC_EIGEN_SOLVER(Type, Container)
 
#define BACKEND_GENERIC_EIGEN_SOLVER_SYMMETRIC(Type, Container)
 
#define BACKEND_GENERIC_IN_PLACE_ELEMENT_PROD(Type, Container)
 
#define BACKEND_GENERIC_IN_PLACE_BLOCK_ELEMENT_PROD(Type, Container)
 
#define BACKEND_GENERIC_EXPONENT(Type, Container)
 
#define BACKEND_GENERIC_IDENTITY(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_MULTIPLY_BY_LOGISTIC_DERIV(Type, Container)
 
#define BACKEND_GENERIC_MULTIPLY_BY_RECTIFIED_LINEAR_DERIV(Type, Container)
 
#define BACKEND_GENERIC_RANGE_FILL(Type, Container)
 
#define BACKEND_GENERIC_RECTIFIED_LINEAR(Type, Container)
 
#define BACKEND_GENERIC_QR_SOLVER(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_SOFTMAX(Type, Container)
 
#define BACKEND_GENERIC_SQUARED_ERROR(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)
 
#define BACKEND_GENERIC_SVD(Type, Container)
 
#define BACKEND_GENERIC_TRACE(Type, Container)
 
#define BACKEND_GENERIC_TRANSPOSE_MATRIX(Type, Container)
 
#define BACKEND_GENERIC_TRIANGULAR_SOLVER(Type, Container)
 
#define BACKEND_GENERIC_ZERO(Type, Container)
 
#define BACKEND_GENERIC_TO_GPU(Type, Container)
 
#define BACKEND_GENERIC_FROM_GPU(Type, Container)
 

Macro Definition Documentation

#define BACKEND_GENERIC_ADD_COL_VEC (   Type,
  Container 
)
Value:
virtual void add_col_vec( \
const SGMatrix<Type>& A, index_t i, const SGVector<Type>& b, \
Container<Type>& result, Type alpha, Type beta) const \
{ \
return; \
}
int32_t index_t
Definition: common.h:72
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void add_col_vec(const SGMatrix< T > &A, index_t i, const SGVector< T > &b, SGMatrix< T > &result, T alpha=1, T beta=1)

Wrapper method of add column vector result = alpha*A.col(i) + beta*b.

See also
linalg::add_col_vec

Definition at line 114 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_ADD_SCALAR (   Type,
  Container 
)
Value:
virtual void add_scalar(Container<Type>& a, Type b) const \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void add_scalar(Container< T > &a, T b)

Wrapper method of add scalar operation.

See also
linalg::add_scalar

Definition at line 147 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_ADD_VECTOR (   Type,
  Container 
)
Value:
virtual void add_vector( \
const SGMatrix<Type>& A, const SGVector<Type>& b, \
SGMatrix<Type>& result, Type alpha, Type beta) const \
{ \
return; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void add_vector(const SGMatrix< T > &A, const SGVector< T > &b, SGMatrix< T > &result, T alpha=1, T beta=1)

Wrapper method of add vector to each column of matrix.

See also
linalg::add_vector

Definition at line 131 of file LinalgBackendBase.h.

#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 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
SGVector< T > colwise_sum(const SGMatrix< T > &mat, bool no_diag=false)

Wrapper method of matrix colwise sum that works with dense matrices.

See also
linalg::colwise_sum

Definition at line 609 of file LinalgBackendBase.h.

#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 0; \
}
SGVector< T > rowwise_sum(const SGMatrix< T > &mat, bool no_diag=false)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of matrix rowwise sum that works with dense matrices.

See also
linalg::rowwise_sum

Definition at line 639 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_BLOCK_SUM (   Type,
  Container 
)
Value:
virtual Type sum(const linalg::Block<Container<Type>>& a, bool no_diag) \
const \
{ \
return 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
T sum(const Container< T > &a, bool no_diag=false)

Wrapper method of sum that works with matrix blocks.

See also
linalg::sum

Definition at line 550 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_CENTER_MATRIX (   Type,
  Container 
)
Value:
virtual void center_matrix(Container<Type>& A) const \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void center_matrix(SGMatrix< T > &A)

Wrapper method of center matrix operation.

See also
linalg::center_matrix

Definition at line 161 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_CHOLESKY_FACTOR (   Type,
  Container 
)
Value:
virtual Container<Type> cholesky_factor( \
const Container<Type>& A, const bool lower) const \
{ \
return 0; \
}
SGMatrix< T > cholesky_factor(const SGMatrix< T > &A, const bool lower=true)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of Cholesky decomposition.

See also
linalg::cholesky_factor

Definition at line 174 of file LinalgBackendBase.h.

#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 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
SGVector< T > cholesky_solver(const SGMatrix< T > &L, const SGVector< T > &b, const bool lower=true)

Wrapper triangular solver with Choleksy decomposition.

See also
linalg::cholesky_solver

Definition at line 189 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_COLWISE_SUM (   Type,
  Container 
)
Value:
virtual SGVector<Type> colwise_sum(const Container<Type>& a, bool no_diag) \
const \
{ \
return 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
SGVector< T > colwise_sum(const SGMatrix< T > &mat, bool no_diag=false)

Wrapper method of matrix rowwise sum that works with dense matrices.

See also
linalg::colwise_sum

Definition at line 594 of file LinalgBackendBase.h.

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

Wrapper method that computes mean of SGVectors and SGMatrices that are composed of complex numbers.

See also
linalg::mean

Definition at line 387 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_CROSS_ENTROPY (   Type,
  Container 
)
Value:
virtual Type cross_entropy( \
const Container<Type>& P, const Container<Type>& Q) const \
{ \
return 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
T cross_entropy(const SGMatrix< T > p, const SGMatrix< T > q)

Wrapper method of cross entropy.

See also
linalg::cross_entropy

Definition at line 205 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_DOT (   Type,
  Container 
)
Value:
virtual Type dot(const Container<Type>& a, const Container<Type>& b) const \
{ \
return 0; \
}
T dot(const SGVector< T > &a, const SGVector< T > &b)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of vector dot-product that works with generic vectors.

See also
linalg::dot

Definition at line 220 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_EIGEN_SOLVER (   Type,
  Container 
)
Value:
virtual void eigen_solver( \
const Container<Type>& A, SGVector<Type>& eigenvalues, \
SGMatrix<Type>& eigenvectors) const \
{ \
}
void eigen_solver(const SGMatrix< T > &A, SGVector< T > &eigenvalues, SGMatrix< T > &eigenvectors)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of eigenvalues and eigenvectors computation.

See also
linalg::eigen_solver

Definition at line 234 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_EIGEN_SOLVER_SYMMETRIC (   Type,
  Container 
)
Value:
virtual void eigen_solver_symmetric( \
const Container<Type>& A, SGVector<Type>& eigenvalues, \
SGMatrix<Type>& eigenvectors, index_t k) const \
{ \
}
int32_t index_t
Definition: common.h:72
void eigen_solver_symmetric(const SGMatrix< T > &A, SGVector< T > &eigenvalues, SGMatrix< T > &eigenvectors, index_t k=0)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of eigenvalues and eigenvectors computation for symmetric matrices.

See also
linalg::eigen_solver_symmetric

Definition at line 250 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_EXPONENT (   Type,
  Container 
)
Value:
virtual void exponent(const Container<Type>& a, Container<Type>& result) \
const \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
Container< T > exponent(const Container< T > &a)

Wrapper method of in-place exponent method.

See also
linalg::exponent

Definition at line 296 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_FROM_GPU (   Type,
  Container 
)
Value:
virtual void from_gpu(const Container<Type>&, Type* data) const \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void from_gpu(SGVector< T > &a, SGVector< T > &b)

Wrapper method of fetching data from GPU memory.

See also
linalg::from_gpu

Definition at line 747 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_IDENTITY (   Type,
  Container 
)
Value:
virtual void identity(Container<Type>& identity_matrix) const \
{ \
return; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void identity(SGMatrix< T > &identity_matrix)

Wrapper method of set matrix to identity.

See also
linalg::identity

Definition at line 311 of file LinalgBackendBase.h.

#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 \
{ \
}
void add(SGVector< T > &a, SGVector< T > &b, SGVector< T > &result, T alpha=1, T beta=1)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of add operation the operation result = alpha*a + beta*b.

See also
linalg::add

Definition at line 98 of file LinalgBackendBase.h.

#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 \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void element_prod(Block< SGMatrix< T >> &a, Block< SGMatrix< T >> &b, SGMatrix< T > &result)
#define BACKEND_GENERIC_IN_PLACE_ELEMENT_PROD (   Type,
  Container 
)
Value:
virtual void element_prod( \
Container<Type>& a, Container<Type>& b, Container<Type>& result) const \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void element_prod(Block< SGMatrix< T >> &a, Block< SGMatrix< T >> &b, SGMatrix< T > &result)
#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 \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void matrix_prod(SGMatrix< T > &A, SGVector< T > &b, SGVector< T > &result, bool transpose=false)

Wrapper method of matrix product method.

See also
linalg::matrix_prod

Definition at line 338 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_IN_PLACE_SCALE (   Type,
  Container 
)
Value:
virtual void scale( \
Container<Type>& a, Type alpha, Container<Type>& result) const \
{ \
}
void scale(SGVector< T > &a, SGVector< T > &result, T alpha=1)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of scale operation the operation result = alpha*A.

See also
linalg::scale

Definition at line 478 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_LOGISTIC (   Type,
  Container 
)
Value:
virtual void logistic(Container<Type>& a, Container<Type>& result) const \
{ \
}
void logistic(SGMatrix< T > &a, SGMatrix< T > &result)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of logistic function f(x) = 1/(1+exp(-x))

See also
linalg::logistic

Definition at line 325 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_MAX (   Type,
  Container 
)
Value:
virtual Type max(const Container<Type>& a) const \
{ \
return 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
T max(const Container< T > &a)

Wrapper method of max method. Return the largest element in a vector or matrix.

See also
linalg::max

Definition at line 355 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_MULTIPLY_BY_LOGISTIC_DERIV (   Type,
  Container 
)
Value:
Container<Type>& a, Container<Type>& result) const \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void multiply_by_logistic_derivative(SGMatrix< T > &a, SGMatrix< T > &result)

Wrapper method of multiply_by_logistic_derivative function f(x) = 1/(1+exp(-x))

See also
linalg::multiply_by_logistic_derivative

Definition at line 403 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_MULTIPLY_BY_RECTIFIED_LINEAR_DERIV (   Type,
  Container 
)
Value:
Container<Type>& a, Container<Type>& result) const \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void multiply_by_rectified_linear_derivative(SGMatrix< T > &a, SGMatrix< T > &result)
#define BACKEND_GENERIC_QR_SOLVER (   Type,
  Container 
)
Value:
virtual Container<Type> qr_solver( \
const SGMatrix<Type>& A, const Container<Type>& b) const \
{ \
return 0; \
}
Container< T > qr_solver(const SGMatrix< T > &A, const Container< T > &b)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method that solves a system of linear equations using QR decomposition.

See also
linalg::qr_solver

Definition at line 462 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_RANGE_FILL (   Type,
  Container 
)
Value:
virtual void range_fill(Container<Type>& a, const Type start) const \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void range_fill(Container< T > &a, const T start=0)

Wrapper method that range fills a vector of matrix.

See also
linalg::range_fill

Definition at line 433 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_REAL_MEAN (   Type,
  Container 
)
Value:
virtual float64_t mean(const Container<Type>& a) const \
{ \
return 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
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

Wrapper method that computes mean of SGVectors and SGMatrices that are composed of real numbers.

See also
linalg::mean

Definition at line 371 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_RECTIFIED_LINEAR (   Type,
  Container 
)
Value:
virtual void rectified_linear(Container<Type>& a, Container<Type>& result) \
const \
{ \
}
void rectified_linear(SGMatrix< T > &a, SGMatrix< T > &result)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of rectified_linear method f(x) = max(0, x)

See also
linalg::rectified_linear

Definition at line 447 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_ROWWISE_SUM (   Type,
  Container 
)
Value:
virtual SGVector<Type> rowwise_sum(const Container<Type>& a, bool no_diag) \
const \
{ \
return 0; \
}
SGVector< T > rowwise_sum(const SGMatrix< T > &mat, bool no_diag=false)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of matrix rowwise sum that works with dense matrices.

See also
linalg::rowwise_sum

Definition at line 624 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_SET_CONST (   Type,
  Container 
)
Value:
virtual void set_const(Container<Type>& a, const Type value) const \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void set_const(Container< T > &a, T value)

Wrapper method that sets const values to vectors or matrices.

See also
linalg::set_const

Definition at line 493 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_SOFTMAX (   Type,
  Container 
)
Value:
virtual void softmax(Container<Type>& a) const \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void softmax(SGMatrix< T > &a)

Wrapper method of softmax method.

See also
linalg::softmax

Definition at line 522 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_SQUARED_ERROR (   Type,
  Container 
)
Value:
virtual Type squared_error( \
const Container<Type>& P, const Container<Type>& Q) const \
{ \
return 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
T squared_error(const SGMatrix< T > p, const SGMatrix< T > q)

Wrapper method of squared error method.

See also
linalg::squared_error

Definition at line 535 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_SUM (   Type,
  Container 
)
Value:
virtual Type sum(const Container<Type>& a, bool no_diag) const \
{ \
return 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
T sum(const Container< T > &a, bool no_diag=false)

Wrapper method of sum that works with generic vectors or matrices.

See also
linalg::sum

Definition at line 507 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_SVD (   Type,
  Container 
)
Value:
virtual void svd( \
const Container<Type>& A, SGVector<Type> s, SGMatrix<Type> U, \
bool thin_U, linalg::SVDAlgorithm alg) const \
{ \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void svd(const SGMatrix< T > &A, SGVector< T > &s, SGMatrix< T > &U, bool thin_U=true, SVDAlgorithm alg=SVDAlgorithm::BidiagonalDivideConquer)

Wrapper method of svd computation.

See also
linalg::svd

Definition at line 654 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_SYMMETRIC_BLOCK_SUM (   Type,
  Container 
)
Value:
virtual Type sum_symmetric( \
const linalg::Block<Container<Type>>& a, bool no_diag) const \
{ \
return 0; \
}
T sum_symmetric(const SGMatrix< T > &a, bool no_diag=false)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of sum that works with symmetric matrix blocks.

See also
linalg::sum

Definition at line 579 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_SYMMETRIC_SUM (   Type,
  Container 
)
Value:
virtual Type sum_symmetric(const Container<Type>& a, bool no_diag) const \
{ \
return 0; \
}
T sum_symmetric(const SGMatrix< T > &a, bool no_diag=false)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of sum that works with symmetric matrices.

See also
linalg::sum_symmetric

Definition at line 565 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_TO_GPU (   Type,
  Container 
)
Value:
virtual GPUMemoryBase<Type>* to_gpu(const Container<Type>&) const \
{ \
return 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void to_gpu(SGVector< T > &a, SGVector< T > &b)

Wrapper method of Transferring data to GPU memory. Does nothing if no GPU backend registered.

See also
linalg::to_gpu

Definition at line 732 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_TRACE (   Type,
  Container 
)
Value:
virtual Type trace(const Container<Type>& A) const \
{ \
return 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
T trace(const SGMatrix< T > &A)

Wrapper method of trace computation.

See also
linalg::trace

Definition at line 669 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_TRANSPOSE_MATRIX (   Type,
  Container 
)
Value:
virtual Container<Type> transpose_matrix(const Container<Type>& A) const \
{ \
return 0; \
}
SGMatrix< T > transpose_matrix(const SGMatrix< T > &A)
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172

Wrapper method of trace computation.

See also
linalg::transpose_matrix

Definition at line 683 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_TRIANGULAR_SOLVER (   Type,
  Container 
)
Value:
virtual Container<Type> triangular_solver( \
const SGMatrix<Type>& L, const Container<Type>& b, \
const bool lower = true) const \
{ \
return 0; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
Container< T > triangular_solver(const SGMatrix< T > &L, const Container< T > &b, const bool lower=true)

Wrapper method of triangular solver.

See also
linalg::triangular_solver

Definition at line 697 of file LinalgBackendBase.h.

#define BACKEND_GENERIC_ZERO (   Type,
  Container 
)
Value:
virtual void zero(Container<Type>& a) const \
{ \
return; \
}
#define SG_SNOTIMPLEMENTED
Definition: SGIO.h:172
void zero(Container< T > &a)

Wrapper method of set vector or matrix to zero.

See also
linalg::zero

Definition at line 716 of file LinalgBackendBase.h.

#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 56 of file LinalgBackendBase.h.

#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 87 of file LinalgBackendBase.h.

#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 72 of file LinalgBackendBase.h.


SHOGUN Machine Learning Toolbox - Documentation