SHOGUN
4.2.0
|
Namespaces | |
implementation | |
ocl | |
operations | |
util | |
Classes | |
struct | Block |
Generic class Block which wraps a matrix class and contains block specific information, providing a uniform way to deal with matrix blocks for all supported backend matrices. More... | |
Functions | |
template<class Matrix > | |
Block< Matrix > | block (Matrix matrix, index_t row_begin, index_t col_begin, index_t row_size, index_t col_size) |
template<Backend backend = linalg_traits<Core>::backend, class Matrix > | |
void | add (Matrix A, Matrix B, Matrix C, typename Matrix::Scalar alpha=1.0, typename Matrix::Scalar beta=1.0) |
template<Backend backend = linalg_traits<Core>::backend, class Matrix > | |
Matrix | add (Matrix A, Matrix B, typename Matrix::Scalar alpha=1.0, typename Matrix::Scalar beta=1.0) |
template<Backend backend = linalg_traits<Core>::backend, class Matrix > | |
void | scale (Matrix A, Matrix B, typename Matrix::Scalar alpha) |
template<Backend backend = linalg_traits<Core>::backend, class Matrix > | |
void | scale (Matrix A, typename Matrix::Scalar alpha) |
template<Backend backend = linalg_traits<Core>::backend, class Matrix > | |
void | range_fill (Matrix A, typename Matrix::Scalar start=0.0) |
template<Backend backend = linalg_traits<Core>::backend, class Matrix > | |
void | range_fill (Matrix A, index_t len, typename Matrix::Scalar start=0.0) |
template<class Operand , class UnaryOp > | |
auto | elementwise_compute (Operand operand, UnaryOp unary_op) -> typename Operand::template container_type< decltype(unary_op(operand.data()[0]))> |
template<class Operand , class UnaryOp > | |
void | elementwise_compute_inplace (Operand operand, UnaryOp unary_op) |
template<Backend backend, class Operand > | |
Operand::template container_type< typename operations::sin< typename Operand::Scalar >::return_type > | elementwise_sin (Operand operand) |
template<Backend backend, class Operand > | |
void | elementwise_sin_inplace (Operand operand) |
template<Backend backend = linalg_traits<Redux>::backend, class Vector > | |
Vector::Scalar | dot (Vector a, Vector b) |
template<Backend backend = linalg_traits<Redux>::backend, class Matrix > | |
Matrix::Scalar | max (Matrix m) |
template<Backend backend = linalg_traits<Redux>::backend, class Vector > | |
Vector::Scalar | vector_sum (Vector a) |
void shogun::linalg::add | ( | Matrix | A, |
Matrix | B, | ||
Matrix | C, | ||
typename Matrix::Scalar | alpha = 1.0 , |
||
typename Matrix::Scalar | beta = 1.0 |
||
) |
Performs the operation \(C = \alpha A + \beta B\). Works for both matrices and vectors.
This version should be used for backend specific code requirements. For example, use this with CGPUMatrix and explicitly set ViennaCL backend, or SGMatrix and explicitly set Eigen3 backend. If matrix-type/backend-type independent code is desired, use the version that does not support preallocated result matrix but returns the result in a newly created matrix instead.
A | First matrix/vector |
B | Second matrix/vector |
C | Result of the operation |
alpha | scaling parameter for first matrix/vector |
beta | scaling parameter for second matrix/vector |
Matrix shogun::linalg::add | ( | Matrix | A, |
Matrix | B, | ||
typename Matrix::Scalar | alpha = 1.0 , |
||
typename Matrix::Scalar | beta = 1.0 |
||
) |
Performs the operation \(C = \alpha A + \beta B\). Works for both matrices and vectors.
This version returns the result in a newly created matrix/vector. If add is desired that will work irrespective of the backend and the matrix/vector type used, then this method should be used.
A | First matrix/vector |
B | Second matrix/vector |
alpha | scaling parameter for first matrix/vector |
beta | scaling parameter for second matrix/vector |
Block<Matrix> shogun::linalg::block | ( | Matrix | matrix, |
index_t | row_begin, | ||
index_t | col_begin, | ||
index_t | row_size, | ||
index_t | col_size | ||
) |
Method that returns a block object. Suited for Eigen3/SGMatrix
matrix | the matrix on which the block is defined |
row_begin | the row index at which the block starts |
col_begin | the col index at which the block starts |
row_size | the number of rows in the block |
col_size | the number of cols in the block |
Vector::Scalar shogun::linalg::dot | ( | Vector | a, |
Vector | b | ||
) |
auto shogun::linalg::elementwise_compute | ( | Operand | operand, |
UnaryOp | unary_op | ||
) | -> typename Operand::template container_type<decltype(unary_op(operand.data()[0]))> |
Template method for computing custom unary operations element-wise for matrices and vectors using NATIVE backend. Works for SGMatrix/SGVector.
This method returns the result in a newly allocated matrix/vector.
operand | The operand on which the element-wise operation has to be performed |
unary_op | The custom unary operator |
Definition at line 56 of file ElementwiseOperations.h.
void shogun::linalg::elementwise_compute_inplace | ( | Operand | operand, |
UnaryOp | unary_op | ||
) |
Template method for computing custom unary operations element-wise for matrices and vectors using NATIVE backend. Works for SGMatrix/SGVector.
This method computes the result in-place.
operand | The operand on which the element-wise operation has to be performed |
unary_op | The custom unary operator |
Definition at line 80 of file ElementwiseOperations.h.
Operand::template container_type<typename operations::sin<typename Operand::Scalar>::return_type> shogun::linalg::elementwise_sin | ( | Operand | operand | ) |
Template method for computing element-wise sin for matrices and vectors.
This method returns the result in a newly allocated matrix/vector.
operand | The operand on which the element-wise operation has to be performed |
Definition at line 141 of file ElementwiseOperations.h.
void shogun::linalg::elementwise_sin_inplace | ( | Operand | operand | ) |
Template method for computing element-wise sin for matrices and vectors.
This method computes the result in-place.
operand | The operand on which the element-wise operation has to be performed |
Definition at line 165 of file ElementwiseOperations.h.
Matrix::Scalar shogun::linalg::max | ( | Matrix | m | ) |
void shogun::linalg::range_fill | ( | Matrix | A, |
typename Matrix::Scalar | start = 0.0 |
||
) |
void shogun::linalg::range_fill | ( | Matrix | A, |
index_t | len, | ||
typename Matrix::Scalar | start = 0.0 |
||
) |
void shogun::linalg::scale | ( | Matrix | A, |
Matrix | B, | ||
typename Matrix::Scalar | alpha | ||
) |
void shogun::linalg::scale | ( | Matrix | A, |
typename Matrix::Scalar | alpha | ||
) |