SHOGUN  4.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Functions
shogun::linalg Namespace Reference


namespace  implementation


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...


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<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)

Function Documentation

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.

AFirst matrix
BSecond matrix
CResult of the operation
alphascaling parameter for first matrix
betascaling parameter for second matrix

Definition at line 58 of file Core.h.

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

matrixthe matrix on which the block is defined
row_beginthe row index at which the block starts
col_beginthe col index at which the block starts
row_sizethe number of rows in the block
col_sizethe number of cols in the block
a block object on this matrix

Definition at line 102 of file Block.h.

Vector::Scalar shogun::linalg::dot ( Vector  a,
Vector  b 

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

afirst vector
bsecond vector
the dot product of \(\mathbf{a}\) and \(\mathbf{b}\), represented as \(\sum_i a_i b_i\)

Definition at line 56 of file Redux.h.

Matrix::Scalar shogun::linalg::max ( Matrix  m)

Returns the largest element in a matrix or vector

mthe matrix or the vector
the value of the largest element

Definition at line 66 of file Redux.h.

Vector::Scalar shogun::linalg::vector_sum ( Vector  a)

Wrapper method for internal implementation of vector sum of values that works with generic dense vectors

avector whose sum has to be computed
the vector sum \(\sum_i a_i\)

Definition at line 79 of file Redux.h.

SHOGUN Machine Learning Toolbox - Documentation