Linear algebra utilities. More...
Go to the source code of this file.
Namespaces | |
namespace | linalg__private |
Linear algebra utilities. | |
Defines | |
#define | max_rand_i 100000 |
Functions | |
Vector * | linalg__private::AddExpert (double alpha, const Vector *const u, Vector *const v) |
Sets vector v to v + alpha * u (![]() | |
Matrix * | linalg__private::AddExpert (double alpha, const Matrix *const A, Matrix *const B) |
Sets matrix B to B + alpha * A (![]() | |
Vector * | linalg__private::AddTo (const Vector *const u, Vector *const v) |
Sets vector v to v + u (![]() | |
Matrix * | linalg__private::AddTo (const Matrix *const A, Matrix *const B) |
Sets matrix B to B + A (![]() | |
double | linalg__private::ArgMinus (double x, double arg) |
Returns ![]() | |
void | linalg__private::Center (Matrix X, Matrix *X_centered) |
Sets a matrix to a centered matrix, where centering is done by subtracting the sum over the columns (a column vector) from each column of the matrix. | |
Matrix * | linalg__private::ColVector (index_t n, double value, Matrix *col_vector) |
Inits a n-dimensional column vector and sets all entries to value. | |
Matrix * | linalg__private::DiagMatrixInit (index_t n, double value, Matrix *diag_matrix) |
Inits a n by n diagonal matrix and sets the diagonal entries to value. | |
Vector * | linalg__private::DiagToVector (const Matrix *const diag_matrix, Vector *diag_vector) |
Inits the components of a vector to the diagonal entries of a square matrix. | |
Vector * | linalg__private::DotMultiplyInit (const Vector *const u, const Vector *const v, Vector *w) |
Multiplies u and v entry-wise and Inits a vector to the result. | |
Matrix * | linalg__private::DotMultiplyInit (const Matrix *const A, const Matrix *const B, Matrix *C) |
Multiplies A and B entry-wise and Inits a matrix to the result. | |
Vector * | linalg__private::DotMultiplyOverwrite (const Vector *const u, Vector *const v) |
Multiplies u and v entry-wise and overwrites vector v with the result. | |
Matrix * | linalg__private::DotMultiplyOverwrite (const Matrix *const A, Matrix *const B) |
Multiplies A and B entry-wise and overwrites matrix B with the result. | |
Matrix * | linalg__private::DotMultiplySum (const Matrix *const A, const Matrix *const B, Matrix *sum_vector) |
Multiplies A and B (N by M matrices) entry-wise and Inits a 1 by N matrix to the sum over the transformed rows of the result (![]() ![]() | |
double | linalg__private::ExpArg (double x, double arg) |
Returns ![]() | |
double | linalg__private::Inv (double x, double arg) |
Returns ![]() | |
void | linalg__private::MakeSubMatrixByColumns (Vector column_indices, Matrix A, Matrix *A_sub) |
Inits a matrix to the columns of A specified in column_indices. | |
Vector * | linalg__private::MapInit (double(*function)(double, double), double arg, const Vector *const u, Vector *v) |
Inits a vector to the result of applying function with argument arg to a vector (![]() | |
Matrix * | linalg__private::MapInit (double(*function)(double, double), double arg, const Matrix *const A, Matrix *B) |
Inits a matrix to the result of applying function with argument arg to a matrix (![]() | |
Vector * | linalg__private::MapOverwrite (double(*function)(double, double), double arg, Vector *const v) |
Applies function with argument arg to vector v and overwrites v with the result (![]() | |
Matrix * | linalg__private::MapOverwrite (double(*function)(double, double), double arg, Matrix *A) |
Applies function with argument arg to matrix A and overwrites A with the result (![]() | |
Matrix * | linalg__private::MatrixMapSum (double(*function)(double, double), double arg, const Matrix *const A, Matrix *sum_vector) |
Applies function with argument arg to a M by N Matrix and Inits a 1 by N matrix to the sum over the transformed rows (![]() ![]() | |
double | linalg__private::MinusArg (double x, double arg) |
Returns ![]() | |
Vector * | linalg__private::MulInit (const Vector *const u, const Matrix *const A, Vector *const v) |
Inits a vector to u A or A' u (![]() ![]() | |
Vector * | linalg__private::MulInit (const Matrix *const A, const Vector *const u, Vector *const v) |
Inits a vector to A * u (![]() | |
Matrix * | linalg__private::MulInit (const Matrix *const A, const Matrix *const B, Matrix *const C) |
Inits a matrix to A * B (![]() | |
Matrix * | linalg__private::MulOverwrite (const Matrix *const A, const Matrix *const B, Matrix *const C) |
Overwrites a matrix with A * B (![]() | |
Matrix * | linalg__private::MulTransAInit (const Matrix *const A, const Matrix *const B, Matrix *C) |
Inits a matrix to A' * B (![]() | |
Matrix * | linalg__private::MulTransAOverwrite (const Matrix *const A, const Matrix *const B, Matrix *const C) |
Overwrites a matrix with A' * B (![]() | |
Matrix * | linalg__private::MulTransBInit (const Matrix *const A, const Matrix *const B, Matrix *C) |
Inits a matrix to A * B' (![]() | |
Matrix * | linalg__private::MulTransBOverwrite (const Matrix *const A, Matrix *const B, Matrix *const C) |
Overwrites a matrix with A * B' (![]() | |
void | linalg__private::Orthogonalize (const Matrix W_old, Matrix *W) |
Orthogonalize W and return the result in W, using Eigen Decomposition. | |
double | linalg__private::Plus (double x, double arg) |
Returns ![]() | |
void | linalg__private::RandMatrix (index_t n_rows, index_t n_cols, Matrix *A) |
Inits a matrix to uniform random entries in [0,1]. | |
Matrix * | linalg__private::RandNormalInit (index_t d, index_t n, Matrix *A) |
Inits a matrix to random normally distributed entries from N(0,1). | |
void | linalg__private::RandVector (Vector &v) |
Overwrites a dimension-N vector to a random vector on the unit sphere in R^N. | |
Matrix * | linalg__private::RepeatMatrix (index_t num_row_reps, index_t num_col_reps, Matrix base_matrix, Matrix *new_matrix) |
Inits a matrix to a num_row_reps by num_col_reps block matrix where each block is base_matrix. | |
void | linalg__private::SaveCorrectly (const char *filename, Matrix a) |
Save the matrix to a file so that rows in the matrix correspond to rows in the file: This just means call data::Save() on the transpose of the matrix. | |
Vector * | linalg__private::Scale (double alpha, Vector *v) |
Sets v to alpha * v (![]() | |
Matrix * | linalg__private::Scale (double alpha, Matrix *A) |
Sets A to alpha * A (![]() | |
Vector * | linalg__private::ScaleInit (double alpha, const Vector *const u, Vector *v) |
Inits a vector to alpha * u (![]() | |
Matrix * | linalg__private::ScaleInit (double alpha, const Matrix *const A, Matrix *B) |
Inits a matrix to alpha * A (![]() | |
double | linalg__private::Square (double x, double arg) |
Returns ![]() | |
double | linalg__private::SquareArg (double x, double arg) |
Returns ![]() | |
Vector * | linalg__private::SubFrom (const Vector *const u, Vector *const v) |
Sets vector v to v - u (![]() | |
Matrix * | linalg__private::SubFrom (const Matrix *const A, Matrix *const B) |
Sets matrix B to B - A (![]() | |
Vector * | linalg__private::SubInit (const Vector *const u, const Vector *const v, Vector *w) |
Inits a vector to u - v (![]() | |
Matrix * | linalg__private::SubInit (const Matrix *const A, const Matrix *const B, Matrix *C) |
Inits a matrix to A - B (![]() | |
Matrix * | linalg__private::SubOverwrite (const Matrix *const A, const Matrix *const B, Matrix *const C) |
Overwrites a matrix with A - B (![]() | |
double | linalg__private::Sum (Vector *v) |
Returns the sum of the components of vector v (returns ![]() | |
Matrix * | linalg__private::Sum (const Matrix *const A, Matrix *sum_vector) |
Sums over the rows of a M by N matrix and Inits a 1 by N matrix storing the sum (sum_vector ![]() | |
double | linalg__private::TanhArg (double x, double arg) |
Returns ![]() | |
double | linalg__private::Times (double x, double arg) |
Returns ![]() | |
double | linalg__private::VectorMapSum (double(*function)(double, double), double arg, const Vector *const v) |
Applies function with argument arg to vector v and returns the sum of the transformed components (sum ![]() | |
Matrix * | linalg__private::VectorToDiag (const Vector *const diag_vector, Matrix *diag_matrix) |
Inits the diagonal entries of a N by N diagonal matrix to the entries of a N-dimensional vector. | |
Matrix * | linalg__private::VectorToDiag (const Matrix *const diag_vector, Matrix *diag_matrix) |
Inits the diagonal entries of a N by N diagonal matrix to the entries of a 1 by N matrix. | |
void | linalg__private::WhitenUsingEig (Matrix X, Matrix *X_whitened, Matrix *whitening_matrix) |
Whitens a matrix using the eigen decomposition of the covariance matrix. | |
void | linalg__private::WhitenUsingSVD (Matrix X, Matrix *X_whitened, Matrix *whitening_matrix) |
Whitens a matrix using the singular value decomposition of the covariance matrix. |
Linear algebra utilities.
Definition in file lin_alg.h.