lin_alg.h File Reference

Linear algebra utilities. More...

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

Go to the source code of this file.

Namespaces

namespace  linalg__private
 

Linear algebra utilities.


Defines

#define max_rand_i   100000

Functions

Vectorlinalg__private::AddExpert (double alpha, const Vector *const u, Vector *const v)
 Sets vector v to v + alpha * u ($ \vec{v} \gets \vec{v} + \alpha \vec{u} $).
Matrix * linalg__private::AddExpert (double alpha, const Matrix *const A, Matrix *const B)
 Sets matrix B to B + alpha * A ($ B \gets B + \alpha A $).
Vectorlinalg__private::AddTo (const Vector *const u, Vector *const v)
 Sets vector v to v + u ($ \vec{v} \gets \vec{v} + \vec{u} $).
Matrix * linalg__private::AddTo (const Matrix *const A, Matrix *const B)
 Sets matrix B to B + A ($ B \gets B + A $).
double linalg__private::ArgMinus (double x, double arg)
 Returns $ arg - x $.
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.
Vectorlinalg__private::DiagToVector (const Matrix *const diag_matrix, Vector *diag_vector)
 Inits the components of a vector to the diagonal entries of a square matrix.
Vectorlinalg__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.
Vectorlinalg__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 ($ C = A \bullet B $, sum_vector $ \gets \sum_i \vec{C_{row i}} $).
double linalg__private::ExpArg (double x, double arg)
 Returns $ x^{arg} $.
double linalg__private::Inv (double x, double arg)
 Returns $ 1 / x $.
void linalg__private::MakeSubMatrixByColumns (Vector column_indices, Matrix A, Matrix *A_sub)
 Inits a matrix to the columns of A specified in column_indices.
Vectorlinalg__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 ($ v_i \gets function(u_i, arg) $).
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 ($ B_{i,j} \gets function(A_{i,j}, arg) $).
Vectorlinalg__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 ($ v_i \gets function(v_i, arg) $).
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 ($ A_{i,j} \gets function(A_{i,j}, arg) $).
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 ($ \tilde{A}_{i,j} \gets function(A_{i,j}, arg) $, sum_vector $ \gets \sum_i \vec{\tilde{A}_{row i}} $).
double linalg__private::MinusArg (double x, double arg)
 Returns $ x - arg $.
Vectorlinalg__private::MulInit (const Vector *const u, const Matrix *const A, Vector *const v)
 Inits a vector to u A or A' u ($ \vec{u} \gets \vec{u} A $ or $ \vec{u} \gets A^T \vec{u} $).
Vectorlinalg__private::MulInit (const Matrix *const A, const Vector *const u, Vector *const v)
 Inits a vector to A * u ($ \vec{v} \gets A \vec{u} $).
Matrix * linalg__private::MulInit (const Matrix *const A, const Matrix *const B, Matrix *const C)
 Inits a matrix to A * B ($ C \gets A B $).
Matrix * linalg__private::MulOverwrite (const Matrix *const A, const Matrix *const B, Matrix *const C)
 Overwrites a matrix with A * B ($ C \gets A B $).
Matrix * linalg__private::MulTransAInit (const Matrix *const A, const Matrix *const B, Matrix *C)
 Inits a matrix to A' * B ($ C \gets A^T B $).
Matrix * linalg__private::MulTransAOverwrite (const Matrix *const A, const Matrix *const B, Matrix *const C)
 Overwrites a matrix with A' * B ($ C \gets A^T B $).
Matrix * linalg__private::MulTransBInit (const Matrix *const A, const Matrix *const B, Matrix *C)
 Inits a matrix to A * B' ($ C \gets A B^T $).
Matrix * linalg__private::MulTransBOverwrite (const Matrix *const A, Matrix *const B, Matrix *const C)
 Overwrites a matrix with A * B' ($ C \gets A B^T $).
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 $ x + arg $.
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.
Vectorlinalg__private::Scale (double alpha, Vector *v)
 Sets v to alpha * v ($ \vec{v} \gets \alpha \vec{v} $).
Matrix * linalg__private::Scale (double alpha, Matrix *A)
 Sets A to alpha * A ($ A \gets \alpha * A $).
Vectorlinalg__private::ScaleInit (double alpha, const Vector *const u, Vector *v)
 Inits a vector to alpha * u ($ \vec{v} \gets \alpha \vec{u} $).
Matrix * linalg__private::ScaleInit (double alpha, const Matrix *const A, Matrix *B)
 Inits a matrix to alpha * A ($ B \gets \alpha A $).
double linalg__private::Square (double x, double arg)
 Returns $ x^2 $.
double linalg__private::SquareArg (double x, double arg)
 Returns $ arg (x^2) $.
Vectorlinalg__private::SubFrom (const Vector *const u, Vector *const v)
 Sets vector v to v - u ($ \vec{v} \gets \vec{v} - \vec{u} $).
Matrix * linalg__private::SubFrom (const Matrix *const A, Matrix *const B)
 Sets matrix B to B - A ($ B \gets B - A $).
Vectorlinalg__private::SubInit (const Vector *const u, const Vector *const v, Vector *w)
 Inits a vector to u - v ($ \vec{w} \gets \vec{u} - \vec{v} $).
Matrix * linalg__private::SubInit (const Matrix *const A, const Matrix *const B, Matrix *C)
 Inits a matrix to A - B ($ C \gets A - B $).
Matrix * linalg__private::SubOverwrite (const Matrix *const A, const Matrix *const B, Matrix *const C)
 Overwrites a matrix with A - B ($ C \gets A - B $).
double linalg__private::Sum (Vector *v)
 Returns the sum of the components of vector v (returns $ \sum v_i $).
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 $ \gets \sum_i \vec{A_{row i}} $).
double linalg__private::TanhArg (double x, double arg)
 Returns $ \tanh(arg x) $.
double linalg__private::Times (double x, double arg)
 Returns $ arg x $.
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 $ \gets \sum_i function(v_i, arg) $).
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.

Detailed Description

Linear algebra utilities.

Author:
Nishant Mehta

Definition in file lin_alg.h.

Generated on Mon Jan 24 12:04:38 2011 for FASTlib by  doxygen 1.6.3