Edinburgh Speech Tools  2.1-release
EST_DMatrix Class Reference

#include <include/EST_DMatrix.h>

Inheritance diagram for EST_DMatrix:
Collaboration diagram for EST_DMatrix:

Public Member Functions

 EST_DMatrix (int m, int n)
 size constructor More...
 
 EST_DMatrix (const EST_DMatrix &a)
 copy constructor More...
 
 EST_DMatrix (const EST_DMatrix &a, int b)
 CHECK - what does this do??? More...
 
 EST_DMatrix ()
 default constructor More...
 
EST_write_status save (const EST_String &filename, const EST_String &type=EST_DMatrix::default_file_type)
 Save in file (ascii or binary) More...
 
EST_read_status load (const EST_String &filename)
 Load from file (ascii or binary as defined in file) More...
 
EST_write_status est_save (const EST_String &filename, const EST_String &type)
 Save in file in est format. More...
 
EST_read_status est_load (const EST_String &filename)
 Load from file in est format (binary/ascii defined in file itself) More...
 
void copyin (double **x, ssize_t rows, ssize_t cols)
 Copy 2-d array x of size rows x cols into matrix. More...
 
EST_DMatrixoperator+= (const EST_DMatrix &a)
 Add elements of 2 same sized matrices. More...
 
EST_DMatrixoperator-= (const EST_DMatrix &a)
 Subtract elements of 2 same sized matrices. More...
 
EST_DMatrixoperator*= (const double f)
 elementwise multiply by scalar More...
 
EST_DMatrixoperator/= (const double f)
 elementwise divide by scalar More...
 
- Public Member Functions inherited from EST_TSimpleMatrix< double >
 EST_TSimpleMatrix (void)
 default constructor More...
 
 EST_TSimpleMatrix (int m, int n)
 size constructor More...
 
 EST_TSimpleMatrix (const EST_TSimpleMatrix< double > &m)
 copy constructor More...
 
void copy (const EST_TSimpleMatrix< double > &a)
 copy one matrix into another More...
 
void resize (int rows, int cols, int set=1)
 resize matrix More...
 
EST_TSimpleMatrix< double > & operator= (const EST_TSimpleMatrix< double > &s)
 assignment operator More...
 
- Public Member Functions inherited from EST_TMatrix< double >
 EST_TMatrix ()
 default constructor More...
 
 EST_TMatrix (const EST_TMatrix< double > &m)
 copy constructor More...
 
 EST_TMatrix (ssize_t rows, ssize_t cols)
 "size" constructor More...
 
 EST_TMatrix (ssize_t rows, ssize_t cols, double *memory, ptrdiff_t offset=0, int free_when_destroyed=0)
 construct from memory supplied by caller More...
 
 ~EST_TMatrix ()
 EST_TMatrix. More...
 
bool have_rows_before (ssize_t n) const
 
bool have_columns_before (ssize_t n) const
 
void resize (ssize_t rows, ssize_t cols, ssize_t set=1)
 
void fill (const double &v)
 fill matrix with value v More...
 
void fill ()
 
EST_TMatrixoperator= (const EST_TMatrix &s)
 assignment operator More...
 
EST_TMatrixadd_rows (const EST_TMatrix &s)
 The two versions of what might have been operator +=. More...
 
EST_TMatrixadd_columns (const EST_TMatrix &s)
 
ssize_t num_rows () const
 return number of rows More...
 
ssize_t num_columns () const
 return number of columns More...
 
INLINE const double & a_no_check (ssize_t row, ssize_t col) const
 const access with no bounds check, care recommend More...
 
INLINE double & a_no_check (ssize_t row, ssize_t col)
 access with no bounds check, care recommend More...
 
INLINE const double & a_no_check_1 (ssize_t row, ssize_t col) const
 
INLINE double & a_no_check_1 (ssize_t row, ssize_t col)
 
const double & a_check (ssize_t row, ssize_t col) const
 const element access function More...
 
double & a_check (ssize_t row, ssize_t col)
 non-const element access function More...
 
const double & a (ssize_t row, ssize_t col) const
 
double & a (ssize_t row, ssize_t col)
 
const double & operator() (ssize_t row, ssize_t col) const
 const element access operator More...
 
double & operator() (ssize_t row, ssize_t col)
 non-const element access operator More...
 
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 More...
 
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 More...
 
void sub_matrix (EST_TMatrix< double > &sm, ssize_t r=0, ptrdiff_t numr=EST_ALL, ssize_t c=0, ptrdiff_t numc=EST_ALL)
 Make the matrix sm a window into this matrix. More...
 
void copy_row (ssize_t r, double *buf, ptrdiff_t offset=0, int num=-1) const
 
void copy_row (ssize_t r, EST_TVector< double > &t, ptrdiff_t offset=0, int num=-1) const
 
void copy_column (ssize_t c, double *buf, ptrdiff_t offset=0, int num=-1) const
 
void copy_column (ssize_t c, EST_TVector< double > &t, ptrdiff_t offset=0, int num=-1) const
 
void set_row (ssize_t n, const double *buf, ptrdiff_t offset=0, int num=-1)
 
void set_row (ssize_t n, const EST_TVector< double > &t, ptrdiff_t offset=0, int num=-1)
 
void set_row (ssize_t r, const EST_TMatrix< double > &from, ssize_t from_r, ssize_t from_offset=0, ptrdiff_t offset=0, int num=-1)
 
void set_column (ssize_t n, const double *buf, ptrdiff_t offset=0, int num=-1)
 
void set_column (ssize_t n, const EST_TVector< double > &t, ptrdiff_t offset=0, int num=-1)
 
void set_column (ssize_t c, const EST_TMatrix< double > &from, ssize_t from_c, ssize_t from_offset=0, ptrdiff_t offset=0, int num=-1)
 
void set_memory (double *buffer, ptrdiff_t offset, ssize_t rows, ssize_t columns, int free_when_destroyed=0)
 
EST_read_status load (const class EST_String &filename)
 load Matrix from file - Not currently implemented. More...
 
EST_write_status save (const class EST_String &filename) const
 save Matrix to file filename More...
 
- Public Member Functions inherited from EST_TVector< double >
INLINE ssize_t vcell_pos (ssize_t c, ssize_t cs) const
 The memory access rule, in one place for easy reference. More...
 
INLINE ssize_t vcell_pos (ssize_t c) const
 
INLINE ssize_t vcell_pos_1 (ssize_t c) const
 
INLINE const double & fast_a_v (int c) const
 quick method for returning (x[n]) More...
 
INLINE double & fast_a_v (int c)
 
INLINE const double & fast_a_1 (int c) const
 
INLINE double & fast_a_1 (int c)
 
void set_values (const double *data, int step, int start_c, int num_c)
 Get and set values from array. More...
 
void get_values (double *data, int step, int start_c, int num_c) const
 
void copy (const EST_TVector< double > &a)
 private copy function, called from all other copying functions. More...
 
void copy_data (const EST_TVector< double > &a)
 just copy data, no resizing, no size check. More...
 
void just_resize (int new_cols, double **old_vals)
 resize the memory and reset the bounds, but don't set values. More...
 
void default_vals ()
 sets data and length to default values (0 in both cases). More...
 
 EST_TVector ()
 default constructor More...
 
 EST_TVector (const EST_TVector< double > &v)
 copy constructor More...
 
 EST_TVector (ssize_t n)
 "size" constructor - make vector of size n. More...
 
 EST_TVector (int, double *memory, int offset=0, int free_when_destroyed=0)
 construct from memory supplied by caller More...
 
 ~EST_TVector ()
 destructor. More...
 
void resize (ssize_t n, int set=1)
 
const double * memory () const
 
double * memory ()
 
void set_memory (double *buffer, int offset, ssize_t columns, int free_when_destroyed=0)
 
EST_TVectoroperator= (const EST_TVector &s)
 assignment operator More...
 
void fill (const double &v)
 Fill entire array will value v. More...
 
void empty ()
 Fill vector with default value. More...
 
int operator== (const EST_TVector &v) const
 is true if vectors are equal size and all elements are equal. More...
 
int operator!= (const EST_TVector &v) const
 is true if vectors are not equal size or a single elements isn't equal. More...
 
void copy_section (double *dest, int offset=0, int num=-1) const
 Copy data in and out. Subclassed by SimpleVector for speed. More...
 
void set_section (const double *src, int offset=0, int num=-1)
 
void sub_vector (EST_TVector< double > &sv, int start_c=0, int len=-1)
 Create a sub vector. More...
 
void integrity () const
 
INLINE ssize_t num_columns () const
 number of items in vector. More...
 
INLINE ssize_t length () const
 number of items in vector. More...
 
INLINE ssize_t n () const
 number of items in vector. More...
 
INLINE const double & a_no_check (ssize_t n) const
 read-only const access operator: without bounds checking More...
 
INLINE double & a_no_check (ssize_t n)
 read/write non-const access operator: without bounds checking More...
 
INLINE const double & a_no_check_1 (ssize_t n) const
 read-only const access operator: without bounds checking More...
 
INLINE double & a_no_check_1 (ssize_t n)
 read/write non-const access operator: without bounds checking More...
 
const double & a_check (ssize_t n) const
 read-only const access operator: with bounds checking More...
 
double & a_check (ssize_t n)
 read/write non-const access operator: with bounds checking More...
 
const double & a (ssize_t n) const
 
double & a (ssize_t n)
 
const double & operator() (ssize_t n) const
 read-only const access operator: return reference to nth member More...
 
double & operator[] (ssize_t n)
 read/write non const access operator: return reference to nth member More...
 

Static Public Attributes

static EST_String default_file_type = "est_ascii"
 
- Static Public Attributes inherited from EST_TVector< double >
static const double * def_val
 default value, used for filling matrix after resizing More...
 
static double * error_return
 

Friends

EST_DMatrix operator* (const EST_DMatrix &a, const double x)
 Multiply all elements of matrix by x. More...
 
EST_DMatrix operator* (const double x, const EST_DMatrix &a)
 Multiply all elements of matrix by x. More...
 
EST_DVector operator* (const EST_DMatrix &a, const EST_DVector &v)
 Multiply matrix by vector. More...
 
EST_DVector operator* (const EST_DVector &v, const EST_DMatrix &a)
 Multiply vector by matrix. More...
 
EST_DMatrix operator* (const EST_DMatrix &a, const EST_DMatrix &b)
 Multiply matrix by matrix. More...
 

Additional Inherited Members

- Public Attributes inherited from EST_TVector< double >
double * p_memory
 
ssize_t p_num_columns
 Visible shape. More...
 
ssize_t p_offset
 How to access the memory. More...
 
ssize_t p_column_step
 
bool p_sub_matrix
 
- Protected Member Functions inherited from EST_TSimpleMatrix< double >
void copy_data (const EST_TSimpleMatrix< double > &a)
 
- Protected Member Functions inherited from EST_TMatrix< double >
INLINE ssize_t mcell_pos (ssize_t r, ssize_t c, ssize_t rs, ssize_t cs) const
 
INLINE ssize_t mcell_pos (ssize_t r, ssize_t c) const
 
INLINE ssize_t mcell_pos_1 (ssize_t r, ssize_t c) const
 
INLINE const double & fast_a_m (ssize_t r, ssize_t c) const
 quick method for returning x[m][n] More...
 
INLINE double & fast_a_m (ssize_t r, ssize_t c)
 
INLINE const double & fast_a_1 (ssize_t r, ssize_t c) const
 
INLINE double & fast_a_1 (ssize_t r, ssize_t c)
 
void set_values (const double *data, ssize_t r_step, ssize_t c_step, ssize_t start_r, ssize_t num_r, ssize_t start_c, ssize_t num_c)
 Get and set values from array. More...
 
void get_values (double *data, ssize_t r_step, ssize_t c_step, ssize_t start_r, ssize_t num_r, ssize_t start_c, ssize_t num_c) const
 
void copy (const EST_TMatrix< double > &a)
 private resize and copy function. More...
 
void copy_data (const EST_TMatrix< double > &a)
 just copy data, no resizing, no size check. More...
 
void just_resize (ssize_t new_rows, ssize_t new_cols, double **old_vals)
 resize the memory and reset the bounds, but don't set values. More...
 
void default_vals ()
 sets data and length to default values (0 in both cases). More...
 
- Protected Attributes inherited from EST_TMatrix< double >
ssize_t p_num_rows
 Visible shape. More...
 
ssize_t p_row_step
 How to access the memory. More...
 

Detailed Description

A matrix class for double precision floating point numbers. EST_DMatrix x should be used instead of double **x wherever possible.

Definition at line 58 of file EST_DMatrix.h.

Constructor & Destructor Documentation

EST_DMatrix::EST_DMatrix ( int  m,
int  n 
)
inline

size constructor

Definition at line 62 of file EST_DMatrix.h.

EST_DMatrix::EST_DMatrix ( const EST_DMatrix a)
inline

copy constructor

Definition at line 64 of file EST_DMatrix.h.

EST_DMatrix::EST_DMatrix ( const EST_DMatrix a,
int  b 
)

CHECK - what does this do???

Definition at line 60 of file EST_DMatrix.cc.

EST_DMatrix::EST_DMatrix ( )
inline

default constructor

Definition at line 70 of file EST_DMatrix.h.

Member Function Documentation

EST_write_status EST_DMatrix::save ( const EST_String filename,
const EST_String type = EST_DMatrix::default_file_type 
)

Save in file (ascii or binary)

Definition at line 328 of file EST_DMatrix.cc.

EST_read_status EST_DMatrix::load ( const EST_String filename)

Load from file (ascii or binary as defined in file)

Definition at line 516 of file EST_DMatrix.cc.

EST_write_status EST_DMatrix::est_save ( const EST_String filename,
const EST_String type 
)

Save in file in est format.

Definition at line 365 of file EST_DMatrix.cc.

EST_read_status EST_DMatrix::est_load ( const EST_String filename)

Load from file in est format (binary/ascii defined in file itself)

Definition at line 439 of file EST_DMatrix.cc.

void EST_DMatrix::copyin ( double **  x,
ssize_t  rows,
ssize_t  cols 
)

Copy 2-d array x of size rows x cols into matrix.

Definition at line 316 of file EST_DMatrix.cc.

EST_DMatrix & EST_DMatrix::operator+= ( const EST_DMatrix a)

Add elements of 2 same sized matrices.

Definition at line 70 of file EST_DMatrix.cc.

EST_DMatrix & EST_DMatrix::operator-= ( const EST_DMatrix a)

Subtract elements of 2 same sized matrices.

Definition at line 90 of file EST_DMatrix.cc.

EST_DMatrix & EST_DMatrix::operator*= ( const double  f)

elementwise multiply by scalar

Definition at line 110 of file EST_DMatrix.cc.

EST_DMatrix & EST_DMatrix::operator/= ( const double  f)

elementwise divide by scalar

Definition at line 121 of file EST_DMatrix.cc.

Friends And Related Function Documentation

EST_DMatrix operator* ( const EST_DMatrix a,
const double  x 
)
friend

Multiply all elements of matrix by x.

Definition at line 183 of file EST_DMatrix.cc.

EST_DMatrix operator* ( const double  x,
const EST_DMatrix a 
)
friend

Multiply all elements of matrix by x.

Definition at line 178 of file EST_DMatrix.cc.

EST_DVector operator* ( const EST_DMatrix a,
const EST_DVector v 
)
friend

Multiply matrix by vector.

Definition at line 195 of file EST_DMatrix.cc.

EST_DVector operator* ( const EST_DVector v,
const EST_DMatrix a 
)
friend

Multiply vector by matrix.

Definition at line 254 of file EST_DMatrix.cc.

EST_DMatrix operator* ( const EST_DMatrix a,
const EST_DMatrix b 
)
friend

Multiply matrix by matrix.

Definition at line 286 of file EST_DMatrix.cc.

Member Data Documentation

EST_String EST_DMatrix::default_file_type = "est_ascii"
static

Definition at line 66 of file EST_DMatrix.h.


The documentation for this class was generated from the following files: