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

Namespaces

namespace  implementation

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

Parameters
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

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

Parameters
afirst vector
bsecond vector
Returns
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

Parameters
mthe matrix or the vector
Returns
the value of the largest element

Definition at line 66 of file Redux.h.

void shogun::linalg::scale ( Matrix  A,
Matrix  B,
typename Matrix::Scalar  alpha 
)

Performs the operation B = alpha*A. Works for both matrices and vectors

Definition at line 66 of file Core.h.

void shogun::linalg::scale ( Matrix  A,
typename Matrix::Scalar  alpha 
)

Performs the operation A = alpha*A. Works for both matrices and vectors

Definition at line 73 of file Core.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

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

Definition at line 79 of file Redux.h.


SHOGUN Machine Learning Toolbox - Documentation