12#ifndef MLPACK_CORE_MATH_LIN_ALG_HPP
13#define MLPACK_CORE_MATH_LIN_ALG_HPP
37void Center(
const arma::mat& x, arma::mat& xCentered);
46 arma::mat& whiteningMatrix);
74 const std::vector<size_t>& rowsToRemove,
86void Svec(
const arma::mat& input, arma::vec& output);
88void Svec(
const arma::sp_mat& input, arma::sp_vec& output);
96void Smat(
const arma::vec& input, arma::mat& output);
130 return (T(0) < x) - (x < T(0));
137#include "lin_alg_impl.hpp"
void VectorPower(arma::vec &vec, const double power)
Auxiliary function to raise vector elements to a specific power.
void RandVector(arma::vec &v)
Overwrites a dimension-N vector to a random vector on the unit sphere in R^N.
void Orthogonalize(const arma::mat &x, arma::mat &W)
Orthogonalize x and return the result in W, using eigendecomposition.
T Sign(const T x)
Signum function.
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,...
void Svec(const arma::mat &input, arma::vec &output)
Upper triangular representation of a symmetric matrix, scaled such that, dot(Svec(A),...
void WhitenUsingSVD(const arma::mat &x, arma::mat &xWhitened, arma::mat &whiteningMatrix)
Whitens a matrix using the singular value decomposition of the covariance matrix.
void SymKronId(const arma::mat &A, arma::mat &op)
If A is a symmetric matrix, then SymKronId returns an operator Op such that.
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.
void Smat(const arma::vec &input, arma::mat &output)
The inverse of Svec.
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 ...
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.