Logo Search packages:      
Sourcecode: speech-tools version File versions  Download package

EST_TMatrix< T > Class Template Reference

#include <EST_TMatrix.h>

Inheritance diagram for EST_TMatrix< T >:

EST_DMatrix EST_FMatrix EST_IMatrix

List of all members.


Detailed Description

template<class T>
class EST_TMatrix< T >

Template Matrix class.

This is an extension of the EST_TVector class to two dimensions.

See also:
matrix_example

EST_TVector

Definition at line 88 of file EST_TMatrix.h.


io

Matrix file io.

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 { filename}
ostream & operator<< (ostream &st, const EST_TMatrix< T > &a)
 print matirx.

Public Member Functions

EST_TMatrixadd_columns (const EST_TMatrix &s)
EST_TMatrixadd_rows (const EST_TMatrix &s)
 The two versions of what might have been operator +=.
void copy (const EST_TVector< T > &a)
 private copy function, called from all other copying functions.
void copy_data (const EST_TVector< T > &a)
 just copy data, no resizing, no size check.
void copy_section (T *dest, int offset=0, int num=-1) const
 Copy data in and out. Subclassed by SimpleVector for speed.
void empty ()
 Fill vector with default value.
 EST_TMatrix (int rows, int cols, T *memory, int offset=0, int free_when_destroyed=0)
 construct from memory supplied by caller
 EST_TMatrix (int rows, int cols)
 "size" constructor
 EST_TMatrix (const EST_TMatrix< T > &m)
 copy constructor
 EST_TMatrix ()
 default constructor
INLINE T & fast_a_1 (int c)
INLINE const T & fast_a_1 (int c) const
INLINE T & fast_a_v (int c)
INLINE const T & fast_a_v (int c) const
 quick method for returning \(x[n]\)
void fill ()
void fill (const T &v)
 fill matrix with value v
void get_values (T *data, int step, int start_c, int num_c) const
bool have_columns_before (int n) const
bool have_rows_before (int n) const
void integrity () const
void just_resize (int new_cols, T **old_vals)
 resize the memory and reset the bounds, but don't set values.
T * memory ()
const T * memory () const
int operator!= (const EST_TVector &v) const
 is true if vectors are not equal size or a single elements isn't equal.
EST_TMatrixoperator= (const EST_TMatrix &s)
 assignment operator
int operator== (const EST_TVector &v) const
 is true if vectors are equal size and all elements are equal.
void resize (int n, int set=1)
void resize (int rows, int cols, int set=1)
void set_memory (T *buffer, int offset, int columns, int free_when_destroyed=0)
void set_section (const T *src, int offset=0, int num=-1)
void set_values (const T *data, int step, int start_c, int num_c)
 Get and set values from array.
void sub_vector (EST_TVector< T > &sv, int start_c=0, int len=-1)
 Create a sub vector.
INLINE unsigned int vcell_pos (unsigned int c) const
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
 ~EST_TMatrix ()
 EST_TMatrix.
access
Basic access methods for vectors.

T & a (int n)
const T & a (int n) const
T & a_check (int n)
 read/write non-const access operator: with bounds checking
const T & a_check (int n) const
 read-only const access operator: with bounds checking
INLINE T & a_no_check (int n)
 read/write non-const access operator: without bounds checking
INLINE const T & a_no_check (int n) const
 read-only const access operator: without bounds checking
INLINE T & a_no_check_1 (int n)
 read/write non-const access operator: without bounds checking
INLINE const T & a_no_check_1 (int n) const
 read-only const access operator: without bounds checking
int length () const
 number of items in vector.
int n () const
 number of items in vector.
const T & operator() (int n) const
 read-only const access operator: return reference to nth member
T & operator[] (int n)
 read/write non const access operator: return reference to nth member
access
Basic access methods for matrices.

T & a (int row, int col)
const T & a (int row, int col) const
T & a_check (int row, int col)
 non-const element access function
const T & a_check (int row, int col) const
 const element access function
INLINE T & a_no_check (int row, int col)
 access with no bounds check, care recommend
INLINE const T & a_no_check (int row, int col) const
 const access with no bounds check, care recommend
INLINE T & a_no_check_1 (int row, int col)
INLINE const T & a_no_check_1 (int row, int col) const
int num_columns () const
 return number of columns
int num_rows () const
 return number of rows
T & operator() (int row, int col)
 non-const element access operator
const T & operator() (int row, int col) const
 const element access operator
Sub-Matrix/Vector Extraction
All of these return matrecies and vectors which share memory with the original, so altering values them alters the original.

void column (EST_TVector< T > &cv, int c, int start_r=0, int len=-1)
 Make the vector { cv} a window onto column { c}.
void row (EST_TVector< T > &rv, int r, int start_c=0, int len=-1)
 Make the vector { rv} a window onto row { r}.
void sub_matrix (EST_TMatrix< T > &sm, int r=0, int numr=EST_ALL, int c=0, int numc=EST_ALL)
 Make the matrix { sm} a window into this matrix.
Copy in and out
Copy data between buffers and the matrix.

void copy_column (int c, EST_TVector< T > &t, int offset=0, int num=-1) const
void copy_column (int c, T *buf, int offset=0, int num=-1) const
void copy_row (int r, EST_TVector< T > &t, int offset=0, int num=-1) const
void copy_row (int r, T *buf, int offset=0, int num=-1) const
void set_column (int c, const EST_TMatrix< T > &from, int from_c, int from_offset=0, int offset=0, int num=-1)
void set_column (int n, const T *buf, int offset=0, int num=-1)
void set_memory (T *buffer, int offset, int rows, int columns, int free_when_destroyed=0)
void set_row (int r, const EST_TMatrix< T > &from, int from_r, int from_offset=0, int offset=0, int num=-1)
void set_row (int n, const EST_TVector< T > &t, int offset=0, int num=-1)
void set_row (int n, const T *buf, int offset=0, int num=-1)

Public Attributes

unsigned int p_column_step
T * p_memory
unsigned int p_num_columns
 Visible shape.
unsigned int p_offset
 How to access the memory.
bool p_sub_matrix

Static Public Attributes

static const T * def_val = &def_val_DMatrix
 default value, used for filling matrix after resizing
static T * error_return = &error_return_DMatrix

Protected Member Functions

void copy (const EST_TMatrix< T > &a)
 private resize and copy function.
void copy_data (const EST_TMatrix< T > &a)
 just copy data, no resizing, no size check.
void default_vals ()
 sets data and length to default values (0 in both cases).
INLINE T & fast_a_1 (int r, int c)
INLINE const T & fast_a_1 (int r, int c) const
INLINE T & fast_a_m (int r, int c)
INLINE const T & fast_a_m (int r, int c) const
 quick method for returning { x[m][n]}
void get_values (T *data, int r_step, int c_step, int start_r, int num_r, int start_c, int num_c) const
void just_resize (int new_rows, int new_cols, T **old_vals)
 resize the memory and reset the bounds, but don't set values.
INLINE unsigned int mcell_pos (int r, int c) const
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
void set_values (const T *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.

Protected Attributes

unsigned int p_num_rows
 Visible shape.
unsigned int p_row_step
 How to access the memory.

Friends

class EST_TMatrix< T >
 Matrix must be friend to set up subvectors.
ostream & operator<< (ostream &st, const EST_TVector< T > &m)
 print out vector.

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

Generated by  Doxygen 1.6.0   Back to index