Edinburgh Speech Tools 2.4-release
EST_FMatrix Class Reference

#include <include/EST_FMatrix.h>

Inheritance diagram for EST_FMatrix:
Collaboration diagram for EST_FMatrix:

Public Member Functions

 EST_FMatrix (int m, int n)
 size constructor More...
 
 EST_FMatrix (const EST_FMatrix &a)
 copy constructor More...
 
 EST_FMatrix (const EST_FMatrix &a, int b)
 CHECK - what does this do??? More...
 
 EST_FMatrix ()
 default constructor More...
 
EST_write_status save (const EST_String &filename, const EST_String &type=EST_FMatrix::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 (float **x, int rows, int cols)
 Copy 2-d array {\tt x} of size {\tt rows x cols} into matrix. More...
 
EST_FMatrixoperator+= (const EST_FMatrix &a)
 Add elements of 2 same sized matrices. More...
 
EST_FMatrixoperator-= (const EST_FMatrix &a)
 Subtract elements of 2 same sized matrices. More...
 
EST_FMatrixoperator*= (const float f)
 elementwise multiply by scalar More...
 
EST_FMatrixoperator/= (const float f)
 elementwise divide by scalar More...
 
- Public Member Functions inherited from EST_TSimpleMatrix< float >
 EST_TSimpleMatrix (void)
 default constructor More...
 
 EST_TSimpleMatrix (int m, int n)
 size constructor More...
 
 EST_TSimpleMatrix (const EST_TSimpleMatrix< float > &m)
 copy constructor More...
 
void copy (const EST_TSimpleMatrix< float > &a)
 copy one matrix into another More...
 
void resize (int rows, int cols, int set=1)
 resize matrix More...
 
EST_TSimpleMatrix< float > & operator= (const EST_TSimpleMatrix< float > &s)
 assignment operator More...
 
- Public Member Functions inherited from EST_TMatrix< float >
 EST_TMatrix ()
 default constructor More...
 
 EST_TMatrix (const EST_TMatrix< float > &m)
 copy constructor More...
 
 EST_TMatrix (int rows, int cols)
 "size" constructor More...
 
 EST_TMatrix (int rows, int cols, float *memory, int offset=0, int free_when_destroyed=0)
 construct from memory supplied by caller More...
 
 ~EST_TMatrix ()
 EST_TMatrix. More...
 
int num_rows () const
 return number of rows More...
 
int num_columns () const
 return number of columns More...
 
INLINE const float & a_no_check (int row, int col) const
 const access with no bounds check, care recommend More...
 
INLINE float & a_no_check (int row, int col)
 access with no bounds check, care recommend More...
 
INLINE const float & a_no_check_1 (int row, int col) const
 
INLINE float & a_no_check_1 (int row, int col)
 
const float & a_check (int row, int col) const
 const element access function More...
 
float & a_check (int row, int col)
 non-const element access function More...
 
const float & a (int row, int col) const
 
float & a (int row, int col)
 
const float & operator() (int row, int col) const
 const element access operator More...
 
float & operator() (int row, int col)
 non-const element access operator More...
 
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 float &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)
 
void row (EST_TVector< float > &rv, int r, int start_c=0, int len=-1)
 Make the vector {\tt rv} a window onto row {\tt r}. More...
 
void column (EST_TVector< float > &cv, int c, int start_r=0, int len=-1)
 Make the vector {\tt cv} a window onto column {\tt c}. More...
 
void sub_matrix (EST_TMatrix< float > &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. More...
 
void copy_row (int r, float *buf, int offset=0, int num=-1) const
 
void copy_row (int r, EST_TVector< float > &t, int offset=0, int num=-1) const
 
void copy_column (int c, float *buf, int offset=0, int num=-1) const
 
void copy_column (int c, EST_TVector< float > &t, int offset=0, int num=-1) const
 
void set_row (int n, const float *buf, int offset=0, int num=-1)
 
void set_row (int n, const EST_TVector< float > &t, int offset=0, int num=-1)
 
void set_row (int r, const EST_TMatrix< float > &from, int from_r, int from_offset=0, int offset=0, int num=-1)
 
void set_column (int n, const float *buf, int offset=0, int num=-1)
 
void set_column (int n, const EST_TVector< float > &t, int offset=0, int num=-1)
 
void set_column (int c, const EST_TMatrix< float > &from, int from_c, int from_offset=0, int offset=0, int num=-1)
 
void set_memory (float *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. More...
 
EST_write_status save (const class EST_String &filename) const
 save Matrix to file {\tt filename} More...
 
- Public Member Functions inherited from EST_TVector< float >
const EST_DMatrixdef_val
 
const EST_DVectordef_val
 
const EST_FMatrixdef_val
 
EST_DMatrixerror_return
 
EST_DVectorerror_return
 
EST_FMatrixerror_return
 
INLINE unsigned int vcell_pos (unsigned int c, unsigned int cs) const
 The memory access rule, in one place for easy reference. More...
 
INLINE unsigned int vcell_pos (unsigned int c) const
 
INLINE unsigned int vcell_pos_1 (unsigned int c) const
 
INLINE const float & fast_a_v (int c) const
 quick method for returning (x[n]) More...
 
INLINE float & fast_a_v (int c)
 
INLINE const float & fast_a_1 (int c) const
 
INLINE float & fast_a_1 (int c)
 
void set_values (const float *data, int step, int start_c, int num_c)
 Get and set values from array. More...
 
void get_values (float *data, int step, int start_c, int num_c) const
 
void copy (const EST_TVector< float > &a)
 private copy function, called from all other copying functions. More...
 
void copy_data (const EST_TVector< float > &a)
 just copy data, no resizing, no size check. More...
 
void just_resize (int new_cols, float **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< float > &v)
 copy constructor More...
 
 EST_TVector (int n)
 "size" constructor - make vector of size n. More...
 
 EST_TVector (int, float *memory, int offset=0, int free_when_destroyed=0)
 construct from memory supplied by caller More...
 
 ~EST_TVector ()
 destructor. More...
 
void resize (int n, int set=1)
 
const float * memory () const
 
float * memory ()
 
INLINE int num_columns () const
 number of items in vector. More...
 
INLINE int length () const
 number of items in vector. More...
 
INLINE int n () const
 number of items in vector. More...
 
INLINE const float & a_no_check (int n) const
 read-only const access operator: without bounds checking More...
 
INLINE float & a_no_check (int n)
 read/write non-const access operator: without bounds checking More...
 
INLINE const float & a_no_check_1 (int n) const
 read-only const access operator: without bounds checking More...
 
INLINE float & a_no_check_1 (int n)
 read/write non-const access operator: without bounds checking More...
 
const float & a_check (int n) const
 read-only const access operator: with bounds checking More...
 
float & a_check (int n)
 read/write non-const access operator: with bounds checking More...
 
const float & a (int n) const
 
float & a (int n)
 
const float & operator() (int n) const
 read-only const access operator: return reference to nth member More...
 
float & operator[] (int n)
 read/write non const access operator: return reference to nth member More...
 
void set_memory (float *buffer, int offset, int columns, int free_when_destroyed=0)
 
EST_TVectoroperator= (const EST_TVector &s)
 assignment operator More...
 
void fill (const float &v)
 Fill entire array will value <parameter>v</parameter>. 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 (float *dest, int offset=0, int num=-1) const
 Copy data in and out. Subclassed by SimpleVector for speed. More...
 
void set_section (const float *src, int offset=0, int num=-1)
 
void sub_vector (EST_TVector< float > &sv, int start_c=0, int len=-1)
 Create a sub vector. More...
 
void integrity () const
 

Static Public Attributes

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

Friends

EST_FMatrix operator* (const EST_FMatrix &a, const float x)
 Multiply all elements of matrix by {\tt x}. More...
 
EST_FVector operator* (const EST_FMatrix &a, const EST_FVector &v)
 Multiply matrix by vector. More...
 
EST_FVector operator* (const EST_FVector &v, const EST_FMatrix &a)
 Multiply vector by matrix. More...
 
EST_FMatrix operator* (const EST_FMatrix &a, const EST_FMatrix &b)
 Multiply matrix by matrix. More...
 

Additional Inherited Members

- Public Attributes inherited from EST_TVector< float >
float * p_memory
 
unsigned int p_num_columns
 Visible shape. More...
 
unsigned int p_offset
 How to access the memory. More...
 
unsigned int p_column_step
 
bool p_sub_matrix
 
- Protected Member Functions inherited from EST_TSimpleMatrix< float >
void copy_data (const EST_TSimpleMatrix< float > &a)
 
- Protected Member Functions inherited from EST_TMatrix< float >
INLINE unsigned int mcell_pos (int r, int c, int rs, int cs) const
 
INLINE unsigned int mcell_pos (int r, int c) const
 
INLINE unsigned int mcell_pos_1 (int r, int c) const
 
INLINE const float & fast_a_m (int r, int c) const
 quick method for returning {\tt x[m][n]} More...
 
INLINE float & fast_a_m (int r, int c)
 
INLINE const float & fast_a_1 (int r, int c) const
 
INLINE float & fast_a_1 (int r, int c)
 
void set_values (const float *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. More...
 
void get_values (float *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< float > &a)
 private resize and copy function. More...
 
void copy_data (const EST_TMatrix< float > &a)
 just copy data, no resizing, no size check. More...
 
void just_resize (int new_rows, int new_cols, float **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< float >
unsigned int p_num_rows
 Visible shape. More...
 
unsigned int p_row_step
 How to access the memory. More...
 

Detailed Description

A matrix class for floating point numbers. EST_FMatrix x should be used instead of float **x wherever possible.

Definition at line 56 of file EST_FMatrix.h.

Constructor & Destructor Documentation

◆ EST_FMatrix() [1/4]

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

size constructor

Definition at line 60 of file EST_FMatrix.h.

◆ EST_FMatrix() [2/4]

EST_FMatrix::EST_FMatrix ( const EST_FMatrix a)
inline

copy constructor

Definition at line 62 of file EST_FMatrix.h.

◆ EST_FMatrix() [3/4]

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

CHECK - what does this do???

Definition at line 64 of file EST_FMatrix.cc.

◆ EST_FMatrix() [4/4]

EST_FMatrix::EST_FMatrix ( )
inline

default constructor

Definition at line 68 of file EST_FMatrix.h.

Member Function Documentation

◆ save()

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

Save in file (ascii or binary)

Definition at line 340 of file EST_FMatrix.cc.

◆ load()

EST_read_status EST_FMatrix::load ( const EST_String filename)

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

Definition at line 513 of file EST_FMatrix.cc.

◆ est_save()

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

Save in file in est format.

Definition at line 376 of file EST_FMatrix.cc.

◆ est_load()

EST_read_status EST_FMatrix::est_load ( const EST_String filename)

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

Definition at line 437 of file EST_FMatrix.cc.

◆ copyin()

void EST_FMatrix::copyin ( float **  x,
int  rows,
int  cols 
)

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

Definition at line 328 of file EST_FMatrix.cc.

◆ operator+=()

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

Add elements of 2 same sized matrices.

Definition at line 74 of file EST_FMatrix.cc.

◆ operator-=()

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

Subtract elements of 2 same sized matrices.

Definition at line 94 of file EST_FMatrix.cc.

◆ operator*=()

EST_FMatrix & EST_FMatrix::operator*= ( const float  f)

elementwise multiply by scalar

Definition at line 114 of file EST_FMatrix.cc.

◆ operator/=()

EST_FMatrix & EST_FMatrix::operator/= ( const float  f)

elementwise divide by scalar

Definition at line 125 of file EST_FMatrix.cc.

Friends And Related Function Documentation

◆ operator* [1/4]

EST_FMatrix operator* ( const EST_FMatrix a,
const float  x 
)
friend

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

Definition at line 182 of file EST_FMatrix.cc.

◆ operator* [2/4]

EST_FVector operator* ( const EST_FMatrix a,
const EST_FVector v 
)
friend

Multiply matrix by vector.

Definition at line 207 of file EST_FMatrix.cc.

◆ operator* [3/4]

EST_FVector operator* ( const EST_FVector v,
const EST_FMatrix a 
)
friend

Multiply vector by matrix.

Definition at line 266 of file EST_FMatrix.cc.

◆ operator* [4/4]

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

Multiply matrix by matrix.

Definition at line 298 of file EST_FMatrix.cc.

Member Data Documentation

◆ default_file_type

EST_String EST_FMatrix::default_file_type = "est_ascii"
static

Definition at line 64 of file EST_FMatrix.h.


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