EST_write_status save(const EST_String &filename, const EST_String &type=EST_DMatrix::default_file_type)
Save in file (ascii or binary)
EST_DVector(const EST_DVector &a)
Copy constructor.
int square(const EST_DMatrix &a)
void est_seed()
the user should use est_seed to seed the random number generator
void eye(EST_DMatrix &a, const int n)
some useful matrix creators make an identity matrix of dimension n
EST_DMatrix cov_prod(const EST_DVector &v1, const EST_DVector &v2)
matrix product of two vectors (#rows = length of first vector, #cols = length of second vector) ...
static EST_String default_file_type
void make_random_vector(EST_DVector &M, const double scale)
all elements are randomised
double determinant(const EST_DMatrix &a)
EST_DMatrix(const EST_DMatrix &a)
copy constructor
void inplace_diagonalise(EST_DMatrix &a)
inplace diagonalise
friend EST_DMatrix operator*(const EST_DMatrix &a, const double x)
Multiply all elements of matrix by x.
double polynomial_value(const EST_DVector &coeffs, const double x)
EST_DMatrix DMatrix_abs(const EST_DMatrix &a)
const double & a(ssize_t row, ssize_t col) const
void copyin(double **x, ssize_t rows, ssize_t cols)
Copy 2-d array x of size rows x cols into matrix.
void make_poly_basis_function(EST_DMatrix &T, EST_DVector t)
void column(EST_TVector< double > &cv, ssize_t c, ssize_t start_r=0, int len=-1)
Make the vector cv a window onto column c
EST_DVector subtract(const EST_DVector &a, const EST_DVector &b)
elementwise subtract
int pseudo_inverse(const EST_DMatrix &a, EST_DMatrix &inv)
pseudo inverse (for non-square matrices)
EST_DMatrix()
default constructor
void make_random_symmetric_matrix(EST_DMatrix &M, const double scale)
used for covariance
double sum(const EST_DMatrix &a)
sum of elements
EST_DVector diagonal(const EST_DMatrix &a)
extract leading diagonal as a vector
int floor_matrix(EST_DMatrix &M, const double floor)
EST_DMatrix & operator+=(const EST_DMatrix &a)
Add elements of 2 same sized matrices.
void make_random_diagonal_matrix(EST_DMatrix &M, const double scale)
used for variance
void symmetrize(EST_DMatrix &a)
enforce symmetry
EST_DMatrix operator+(const EST_DMatrix &a, const EST_DMatrix &b)
EST_DVector add(const EST_DVector &a, const EST_DVector &b)
elementwise add
A vector class for double precision floating point numbers. EST_DVector x should be used instead of f...
bool polynomial_fit(EST_DVector &x, EST_DVector &y, EST_DVector &co_effs, int order)
least squares fit
EST_DVector()
Default constructor.
void row(EST_TVector< double > &rv, ssize_t r, ssize_t start_c=0, int len=-1)
Make the vector rv a window onto row r
void transpose(const EST_DMatrix &a, EST_DMatrix &b)
exchange rows and columns
EST_DMatrix & operator*=(const double f)
elementwise multiply by scalar
void make_random_matrix(EST_DMatrix &M, const double scale)
all elements are randomised
void multiply(const EST_DMatrix &a, const EST_DMatrix &b, EST_DMatrix &c)
void stack_matrix(const EST_DMatrix &M, EST_DVector &v)
stack columns on top of each other to make a vector
EST_DMatrix triangulate(const EST_DMatrix &a)
EST_DMatrix operator-(const EST_DMatrix &a, const EST_DMatrix &b)
EST_DMatrix & operator/=(const double f)
elementwise divide by scalar
EST_DVector(int n)
Size constructor.
EST_read_status load(const EST_String &filename)
Load from file (ascii or binary as defined in file)
EST_DMatrix diagonalise(const EST_DMatrix &a)
extract leading diagonal as a matrix
A subclass of EST_TMatrix which copies using memcopy.
EST_DMatrix & operator-=(const EST_DMatrix &a)
Subtract elements of 2 same sized matrices.
int singular(EST_DMatrix &a)
not implemented ??
INLINE ssize_t n() const
number of items in vector.
EST_write_status est_save(const EST_String &filename, const EST_String &type)
Save in file in est format.
EST_DMatrix(int m, int n)
size constructor
int inverse(const EST_DMatrix &a, EST_DMatrix &inv)
inverse
EST_DMatrix sub(const EST_DMatrix &a, ssize_t row, ssize_t col)
EST_read_status est_load(const EST_String &filename)
Load from file in est format (binary/ascii defined in file itself)