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

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
static double * error_return

Friends

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

Additional Inherited Members

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

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 54 of file EST_DMatrix.h.

Constructor & Destructor Documentation

◆ EST_DMatrix() [1/4]

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

size constructor

Definition at line 58 of file EST_DMatrix.h.

◆ EST_DMatrix() [2/4]

EST_DMatrix::EST_DMatrix ( const EST_DMatrix & a)
inline

copy constructor

Definition at line 60 of file EST_DMatrix.h.

◆ EST_DMatrix() [3/4]

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

CHECK - what does this do???

Definition at line 57 of file EST_DMatrix.cc.

◆ EST_DMatrix() [4/4]

EST_DMatrix::EST_DMatrix ( )
inline

default constructor

Definition at line 66 of file EST_DMatrix.h.

Member Function Documentation

◆ save()

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 320 of file EST_DMatrix.cc.

◆ load()

EST_read_status EST_DMatrix::load ( const EST_String & filename)

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

Definition at line 494 of file EST_DMatrix.cc.

◆ est_save()

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

Save in file in est format.

Definition at line 357 of file EST_DMatrix.cc.

◆ est_load()

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 418 of file EST_DMatrix.cc.

◆ copyin()

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

Copy 2-d array {\tt x} of size {\tt rows x cols} into matrix.

Definition at line 308 of file EST_DMatrix.cc.

◆ operator+=()

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

Add elements of 2 same sized matrices.

Definition at line 67 of file EST_DMatrix.cc.

◆ operator-=()

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

Subtract elements of 2 same sized matrices.

Definition at line 87 of file EST_DMatrix.cc.

◆ operator*=()

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

elementwise multiply by scalar

Definition at line 107 of file EST_DMatrix.cc.

◆ operator/=()

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

elementwise divide by scalar

Definition at line 118 of file EST_DMatrix.cc.

◆ operator* [1/4]

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

Multiply all elements of matrix by {\tt x}.

Definition at line 175 of file EST_DMatrix.cc.

◆ operator* [2/4]

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

Multiply matrix by vector.

Definition at line 187 of file EST_DMatrix.cc.

◆ operator* [3/4]

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

Multiply vector by matrix.

Definition at line 246 of file EST_DMatrix.cc.

◆ operator* [4/4]

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

Multiply matrix by matrix.

Definition at line 278 of file EST_DMatrix.cc.

Member Data Documentation

◆ default_file_type

EST_String EST_DMatrix::default_file_type = "est_ascii"
static

Definition at line 62 of file EST_DMatrix.h.


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