Edinburgh Speech Tools  2.1-release
vec_mat_aux.cc File Reference
#include "EST_FMatrix.h"
#include "EST_system.h"
#include <cstdlib>
#include <climits>
#include "EST_unix.h"
#include "EST_math.h"
#include <ctime>
Include dependency graph for vec_mat_aux.cc:

Go to the source code of this file.

Functions

bool polynomial_fit (EST_FVector &x, EST_FVector &y, EST_FVector &co_effs, int order)
 least squares fit More...
 
bool polynomial_fit (EST_FVector &x, EST_FVector &y, EST_FVector &co_effs, EST_FVector &weights, int order)
 weighted least squares fit More...
 
float matrix_max (const EST_FMatrix &a)
 find largest element More...
 
int square (const EST_FMatrix &a)
 
float sum (const EST_FMatrix &a)
 sum of elements More...
 
EST_FMatrix diagonalise (const EST_FMatrix &a)
 extract leading diagonal as a matrix More...
 
void inplace_diagonalise (EST_FMatrix &a)
 inplace diagonalise More...
 
EST_FMatrix sub (const EST_FMatrix &a, ssize_t row, ssize_t col)
 
EST_FMatrix row (const EST_FMatrix &a, ssize_t row)
 
EST_FMatrix column (const EST_FMatrix &a, ssize_t col)
 
EST_FMatrix triangulate (const EST_FMatrix &a)
 
void transpose (const EST_FMatrix &a, EST_FMatrix &b)
 exchange rows and columns More...
 
EST_FMatrix backwards (EST_FMatrix &a)
 
EST_FMatrix fmatrix_abs (const EST_FMatrix &a)
 
int inverse (const EST_FMatrix &a, EST_FMatrix &inv)
 inverse More...
 
int inverse (const EST_FMatrix &a, EST_FMatrix &inv, int &singularity)
 
int pseudo_inverse (const EST_FMatrix &a, EST_FMatrix &inv)
 pseudo inverse (for non-square matrices) More...
 
int pseudo_inverse (const EST_FMatrix &a, EST_FMatrix &inv, int &singularity)
 
float determinant (const EST_FMatrix &a)
 
void eye (EST_FMatrix &a, const ssize_t n)
 some useful matrix creators make an identity matrix of dimension n More...
 
void eye (EST_FMatrix &a)
 make already square matrix into I without resizing More...
 
EST_FVector add (const EST_FVector &a, const EST_FVector &b)
 elementwise add More...
 
EST_FVector subtract (const EST_FVector &a, const EST_FVector &b)
 elementwise subtract More...
 
EST_FVector diagonal (const EST_FMatrix &a)
 extract leading diagonal as a vector More...
 
float polynomial_value (const EST_FVector &coeffs, const float x)
 
void symmetrize (EST_FMatrix &a)
 enforce symmetry More...
 
void stack_matrix (const EST_FMatrix &M, EST_FVector &v)
 stack columns on top of each other to make a vector More...
 
void make_random_matrix (EST_FMatrix &M, const float scale)
 all elements are randomised More...
 
void make_random_vector (EST_FVector &V, const float scale)
 all elements are randomised More...
 
void make_random_symmetric_matrix (EST_FMatrix &M, const float scale)
 used for covariance More...
 
void make_random_diagonal_matrix (EST_FMatrix &M, const float scale)
 used for variance More...
 
void make_poly_basis_function (EST_FMatrix &T, EST_FVector t)
 
ssize_t floor_matrix (EST_FMatrix &M, const float floor)
 
EST_FMatrix cov_prod (const EST_FVector &v1, const EST_FVector &v2)
 matrix product of two vectors (#rows = length of first vector, #cols = length of second vector) More...
 
void est_seed ()
 the user should use est_seed to seed the random number generator More...
 

Function Documentation

bool polynomial_fit ( EST_FVector x,
EST_FVector y,
EST_FVector co_effs,
int  order 
)

least squares fit

Definition at line 49 of file vec_mat_aux.cc.

bool polynomial_fit ( EST_FVector x,
EST_FVector y,
EST_FVector co_effs,
EST_FVector weights,
int  order 
)

weighted least squares fit

Definition at line 60 of file vec_mat_aux.cc.

float matrix_max ( const EST_FMatrix a)

find largest element

Definition at line 129 of file vec_mat_aux.cc.

int square ( const EST_FMatrix a)

Definition at line 142 of file vec_mat_aux.cc.

float sum ( const EST_FMatrix a)

sum of elements

Definition at line 147 of file vec_mat_aux.cc.

EST_FMatrix diagonalise ( const EST_FMatrix a)

extract leading diagonal as a matrix

Definition at line 158 of file vec_mat_aux.cc.

void inplace_diagonalise ( EST_FMatrix a)

inplace diagonalise

Definition at line 176 of file vec_mat_aux.cc.

EST_FMatrix sub ( const EST_FMatrix a,
ssize_t  row,
ssize_t  col 
)

Definition at line 187 of file vec_mat_aux.cc.

EST_FMatrix row ( const EST_FMatrix a,
ssize_t  row 
)

Definition at line 210 of file vec_mat_aux.cc.

EST_FMatrix column ( const EST_FMatrix a,
ssize_t  col 
)

Definition at line 221 of file vec_mat_aux.cc.

EST_FMatrix triangulate ( const EST_FMatrix a)

Definition at line 232 of file vec_mat_aux.cc.

void transpose ( const EST_FMatrix a,
EST_FMatrix b 
)

exchange rows and columns

Definition at line 244 of file vec_mat_aux.cc.

EST_FMatrix backwards ( EST_FMatrix a)

Definition at line 254 of file vec_mat_aux.cc.

EST_FMatrix fmatrix_abs ( const EST_FMatrix a)

Definition at line 270 of file vec_mat_aux.cc.

int inverse ( const EST_FMatrix a,
EST_FMatrix inv 
)

inverse

Definition at line 298 of file vec_mat_aux.cc.

int inverse ( const EST_FMatrix a,
EST_FMatrix inv,
int singularity 
)

Definition at line 304 of file vec_mat_aux.cc.

int pseudo_inverse ( const EST_FMatrix a,
EST_FMatrix inv 
)

pseudo inverse (for non-square matrices)

Definition at line 405 of file vec_mat_aux.cc.

int pseudo_inverse ( const EST_FMatrix a,
EST_FMatrix inv,
int singularity 
)

Definition at line 411 of file vec_mat_aux.cc.

float determinant ( const EST_FMatrix a)

Definition at line 436 of file vec_mat_aux.cc.

void eye ( EST_FMatrix a,
const ssize_t  n 
)

some useful matrix creators make an identity matrix of dimension n

Definition at line 473 of file vec_mat_aux.cc.

void eye ( EST_FMatrix a)

make already square matrix into I without resizing

Definition at line 486 of file vec_mat_aux.cc.

EST_FVector add ( const EST_FVector a,
const EST_FVector b 
)

elementwise add

Definition at line 501 of file vec_mat_aux.cc.

EST_FVector subtract ( const EST_FVector a,
const EST_FVector b 
)

elementwise subtract

Definition at line 519 of file vec_mat_aux.cc.

EST_FVector diagonal ( const EST_FMatrix a)

extract leading diagonal as a vector

Definition at line 537 of file vec_mat_aux.cc.

float polynomial_value ( const EST_FVector coeffs,
const float  x 
)

Definition at line 554 of file vec_mat_aux.cc.

void symmetrize ( EST_FMatrix a)

enforce symmetry

Definition at line 564 of file vec_mat_aux.cc.

void stack_matrix ( const EST_FMatrix M,
EST_FVector v 
)

stack columns on top of each other to make a vector

Definition at line 588 of file vec_mat_aux.cc.

void make_random_matrix ( EST_FMatrix M,
const float  scale 
)

all elements are randomised

Definition at line 599 of file vec_mat_aux.cc.

void make_random_vector ( EST_FVector V,
const float  scale 
)

all elements are randomised

Definition at line 612 of file vec_mat_aux.cc.

void make_random_symmetric_matrix ( EST_FMatrix M,
const float  scale 
)

used for covariance

Definition at line 624 of file vec_mat_aux.cc.

void make_random_diagonal_matrix ( EST_FMatrix M,
const float  scale 
)

used for variance

Definition at line 644 of file vec_mat_aux.cc.

void make_poly_basis_function ( EST_FMatrix T,
EST_FVector  t 
)

Definition at line 660 of file vec_mat_aux.cc.

ssize_t floor_matrix ( EST_FMatrix M,
const float  floor 
)

Definition at line 676 of file vec_mat_aux.cc.

EST_FMatrix cov_prod ( const EST_FVector v1,
const EST_FVector v2 
)

matrix product of two vectors (#rows = length of first vector, #cols = length of second vector)

Definition at line 690 of file vec_mat_aux.cc.

void est_seed ( )

the user should use est_seed to seed the random number generator

Definition at line 705 of file vec_mat_aux.cc.