SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 
命名空间 | | 函数
shogun::linalg 命名空间参考

命名空间

 implementation
 
 special_purpose
 

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

函数

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 matrix_product (Matrix A, Matrix B, Matrix C, bool transpose_A=false, bool transpose_B=false, bool overwrite=true)
 
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 subtract (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 elementwise_product (Matrix A, Matrix B, Matrix C)
 
template<Backend backend = linalg_traits<Core>::backend, class Matrix >
implementation::elementwise_square
< backend, Matrix >
::ReturnType 
elementwise_square (Matrix m)
 
template<Backend backend = linalg_traits<Core>::backend, class Matrix , class ResultMatrix >
void elementwise_square (Matrix m, ResultMatrix result)
 
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 sum (Matrix m, bool no_diag=false)
 
template<Backend backend = linalg_traits<Redux>::backend, class Matrix >
Matrix::Scalar sum_symmetric (Matrix m, bool no_diag=false)
 
template<Backend backend = linalg_traits<Redux>::backend, class Matrix >
Matrix::Scalar sum_symmetric (Block< Matrix > b, bool no_diag=false)
 
template<Backend backend = linalg_traits<Redux>::backend, class Matrix >
implementation::colwise_sum
< backend, Matrix >
::ReturnType 
colwise_sum (Matrix m, bool no_diag=false)
 
template<Backend backend = linalg_traits<Redux>::backend, class Matrix , class Vector >
void colwise_sum (Matrix m, Vector result, bool no_diag=false)
 
template<Backend backend = linalg_traits<Redux>::backend, class Matrix >
implementation::rowwise_sum
< backend, Matrix >
::ReturnType 
rowwise_sum (Matrix m, bool no_diag=false)
 
template<Backend backend = linalg_traits<Redux>::backend, class Matrix , class Vector >
void rowwise_sum (Matrix m, Vector result, bool no_diag=false)
 
template<Backend backend = linalg_traits<Redux>::backend, class Vector >
Vector::Scalar vector_sum (Vector a)
 
template<Backend backend = linalg_traits<Redux>::backend, class Matrix >
Matrix::Scalar max (Matrix m)
 
template<Backend backend = linalg_traits<Core>::backend, class Matrix , class Vector >
void set_rows_const (Matrix A, Vector v)
 

函数说明

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

在文件 Core.h66 行定义.

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

在文件 Block.h102 行定义.

implementation::colwise_sum<backend,Matrix>::ReturnType shogun::linalg::colwise_sum ( Matrix  m,
bool  no_diag = false 
)

Wrapper method for internal implementation of matrix colwise sum of values that works with generic dense matrices

参数
mthe matrix whose colwise sum of co-efficients has to be computed
no_diagif true, diagonal entries are excluded from the sum (default - false)
返回
the colwise sum of co-efficients computed as \(s_j=\sum_{i}m_{i,j}\)

在文件 Redux.h113 行定义.

void shogun::linalg::colwise_sum ( Matrix  m,
Vector  result,
bool  no_diag = false 
)

Wrapper method for internal implementation of matrix colwise sum of values that works with generic dense matrices

参数
mthe matrix whose colwise sum of co-efficients has to be computed
no_diagif true, diagonal entries are excluded from the sum (default - false)
resultPre-allocated vector for the result of the computation

在文件 Redux.h128 行定义.

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

在文件 Redux.h56 行定义.

void shogun::linalg::elementwise_product ( Matrix  A,
Matrix  B,
Matrix  C 
)

Performs the operation C = A .* B where ".*" denotes elementwise multiplication

在文件 Core.h89 行定义.

implementation::elementwise_square<backend,Matrix>::ReturnType shogun::linalg::elementwise_square ( Matrix  m)

Wrapper method for internal implementation of square of co-efficients that works with generic dense matrices.

参数
mthe matrix whose squared co-efficients matrix has to be computed
返回
another matrix whose co-efficients are \(m'_{i,j}=m_(i,j}^2\) for all \(i,j\)

在文件 Core.h103 行定义.

void shogun::linalg::elementwise_square ( Matrix  m,
ResultMatrix  result 
)

Wrapper method for internal implementation of square of co-efficients that works with generic dense matrices.

参数
mthe matrix whose squared co-efficients matrix has to be computed
resultPre-allocated matrix for the result of the computation

在文件 Core.h116 行定义.

void shogun::linalg::matrix_product ( Matrix  A,
Matrix  B,
Matrix  C,
bool  transpose_A = false,
bool  transpose_B = false,
bool  overwrite = true 
)

Performs matrix multiplication

参数
AFirst matrix
BSecond matrix
CResult of the operation
transpose_AWhether to the transpose of A should be used instead of A
transpose_BWhether to the transpose of B should be used instead of B
overwriteIf true, the values in C are overwritten with the result, otherwise, the result is added to the existing values

在文件 Core.h58 行定义.

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

Returns the largest element in a matrix or vector

在文件 Redux.h177 行定义.

implementation::rowwise_sum<backend,Matrix>::ReturnType shogun::linalg::rowwise_sum ( Matrix  m,
bool  no_diag = false 
)

Wrapper method for internal implementation of matrix rowwise sum of values that works with generic dense matrices

参数
mthe matrix whose rowwise sum of co-efficients has to be computed
no_diagif true, diagonal entries are excluded from the sum (default - false)
返回
the rowwise sum of co-efficients computed as \(s_i=\sum_{j}m_{i,j}\)

在文件 Redux.h142 行定义.

void shogun::linalg::rowwise_sum ( Matrix  m,
Vector  result,
bool  no_diag = false 
)

Wrapper method for internal implementation of matrix rowwise sum of values that works with generic dense matrices

参数
mthe matrix whose rowwise sum of co-efficients has to be computed
no_diagif true, diagonal entries are excluded from the sum (default - false)
resultPre-allocated vector for the result of the computation

在文件 Redux.h157 行定义.

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

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

在文件 Core.h82 行定义.

void shogun::linalg::set_rows_const ( Matrix  A,
Vector  v 
)

Sets each row of a matrix to some constant value. That is, perfoms the operation A[i,j] = v[i], for all i and j

在文件 Util.h49 行定义.

void shogun::linalg::subtract ( 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

在文件 Core.h74 行定义.

Matrix::Scalar shogun::linalg::sum ( Matrix  m,
bool  no_diag = false 
)

Wrapper method for internal implementation of matrix sum of values that works with generic dense matrices

参数
mthe matrix whose sum of co-efficients has to be computed
no_diagif true, diagonal entries are excluded from the sum (default - false)
返回
the sum of co-efficients computed as \(\sum_{i,j}m_{i,j}\)

在文件 Redux.h70 行定义.

Matrix::Scalar shogun::linalg::sum_symmetric ( Matrix  m,
bool  no_diag = false 
)

Wrapper method for internal implementation of symmetric matrix sum of values that works with generic dense matrices

参数
mthe matrix whose sum of co-efficients has to be computed
no_diagif true, diagonal entries are excluded from the sum (default - false)
返回
the sum of co-efficients computed as \(\sum_{i,j}m_{i,j}\)

在文件 Redux.h84 行定义.

Matrix::Scalar shogun::linalg::sum_symmetric ( Block< Matrix >  b,
bool  no_diag = false 
)

Wrapper method for internal implementation of symmetric matrix-block sum of values that works with generic dense matrix blocks

参数
bthe matrix-block whose sum of co-efficients has to be computed
no_diagif true, diagonal entries are excluded from the sum (default - false)
返回
the sum of co-efficients computed as \(\sum_{i,j}b_{i,j}\)

在文件 Redux.h98 行定义.

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

在文件 Redux.h170 行定义.


SHOGUN 机器学习工具包 - 项目文档