lin_alg.hpp File Reference
Include dependency graph for lin_alg.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Namespaces

mlpack

Linear algebra utility functions, generally performed on matrices or vectors.

mlpack::math

Miscellaneous math routines.

## Functions

void Center (const arma::mat &x, arma::mat &xCentered)
Creates a centered matrix, where centering is done by subtracting the sum over the columns (a column vector) from each column of the matrix. More...

void Orthogonalize (const arma::mat &x, arma::mat &W)
Orthogonalize x and return the result in W, using eigendecomposition. More...

void Orthogonalize (arma::mat &x)
Orthogonalize x in-place. More...

void RandVector (arma::vec &v)
Overwrites a dimension-N vector to a random vector on the unit sphere in R^N. More...

void RemoveRows (const arma::mat &input, const std::vector< size_t > &rowsToRemove, arma::mat &output)
Remove a certain set of rows in a matrix while copying to a second matrix. More...

template
<
typename
T
>
Sign (const T x)
Signum function. More...

void Smat (const arma::vec &input, arma::mat &output)
The inverse of Svec. More...

void Svec (const arma::mat &input, arma::vec &output)
Upper triangular representation of a symmetric matrix, scaled such that, dot(Svec(A), Svec(B)) == dot(A, B) for symmetric A, B. More...

void Svec (const arma::sp_mat &input, arma::sp_vec &output)

size_t SvecIndex (size_t i, size_t j, size_t n)
Return the index such that A[i,j] == factr(i, j) * svec(A)[pos(i, j)], where factr(i, j) = sqrt(2) if i != j and 1 otherwise. More...

void SymKronId (const arma::mat &A, arma::mat &op)
If A is a symmetric matrix, then SymKronId returns an operator Op such that. More...

void VectorPower (arma::vec &vec, const double power)
Auxiliary function to raise vector elements to a specific power. More...

void WhitenUsingSVD (const arma::mat &x, arma::mat &xWhitened, arma::mat &whiteningMatrix)
Whitens a matrix using the singular value decomposition of the covariance matrix. More...

## Detailed Description

Linear algebra utilities.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Definition in file lin_alg.hpp.