In file ../include/EST_TVector.h:

template<class T> class EST_TVector


Inheritance:


Public Fields

[more]T* p_memory
Pointer to the start of the vector.
[more]unsigned int p_num_columns
Visible shape
[more]unsigned int p_offset
How to access the memory
[more]static const T* def_val
default value, used for filling matrix after resizing
[more]static T* error_return
A reference to this variable is returned if you try and access beyond the bounds of the matrix.

Public Methods

[more]INLINE unsigned int vcell_pos (unsigned int c, unsigned int cs) const
The memory access rule, in one place for easy reference
[more]INLINE const T& fast_a_v (int c) const
quick method for returning \(x[n]\)
[more]void set_values (const T* data, int step, int start_c, int num_c)
Get and set values from array
[more]void copy (const EST_TVector<T> &a)
private copy function, called from all other copying functions
[more]void copy_data (const EST_TVector<T> &a)
just copy data, no resizing, no size check
[more]void just_resize (int new_cols, T** 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<T> &v)
copy constructor
[more] EST_TVector (int n)
"size" constructor - make vector of size n
[more] EST_TVector (int, T* 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)
resize vector.
[more]const T* memory () const
For when you absolutely have to have access to the memory
[more] access

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

[more]EST_TVector& operator= (const EST_TVector &s)
assignment operator
[more]void fill (const T &v)
Fill entire array will value <parameter>v</parameter>
[more]void empty ()
Fill vector with default value
[more]EST_write_status save (const EST_String &filename)
Save vector to file <parameter>filename</parameter>
[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 (T* dest, int offset=0, int num=-1) const
Copy data in and out.
[more]void sub_vector (EST_TVector<T> &sv, int start_c=0, int len=-1)
Create a sub vector
[more]void integrity () const


Documentation

oT* p_memory
Pointer to the start of the vector. The start of allocated memory is p_memory-p_offset.

ounsigned int p_num_columns
Visible shape

ounsigned int p_offset
How to access the memory

oINLINE unsigned int vcell_pos(unsigned int c, unsigned int cs) const
The memory access rule, in one place for easy reference

oINLINE const T& fast_a_v(int c) const
quick method for returning \(x[n]\)

ovoid set_values(const T* data, int step, int start_c, int num_c)
Get and set values from array

ovoid copy(const EST_TVector<T> &a)
private copy function, called from all other copying functions

ovoid copy_data(const EST_TVector<T> &a)
just copy data, no resizing, no size check

ovoid just_resize(int new_cols, T** old_vals)
resize the memory and reset the bounds, but don't set values

ovoid default_vals()
sets data and length to default values (0 in both cases)

o EST_TVector()
default constructor

o EST_TVector(const EST_TVector<T> &v)
copy constructor

o EST_TVector(int n)
"size" constructor - make vector of size n

o EST_TVector(int, T* memory, int offset=0, int free_when_destroyed=0)
construct from memory supplied by caller

o ~EST_TVector()
destructor

ostatic const T* def_val
default value, used for filling matrix after resizing

ostatic T* error_return
A reference to this variable is returned if you try and access beyond the bounds of the matrix. The vaue is undefined, but you can check for the reference you get having the same address as this variable to test for an error.

ovoid resize(int n, int set=1)
resize vector. If <expr>set=1</expr>, then the current values in the vector are preserved up to the new length <parameter>n</parameter>. If the new length exceeds the old length, the rest of the vector is filled with the <variable>def_val</variable>

oconst T* memory() const
For when you absolutely have to have access to the memory

o access
Basic access methods for vectors.

oint num_columns() const
number of items in vector

oint length() const
number of items in vector

oint n() const
number of items in vector

oINLINE const T& a_no_check(int n) const
read-only const access operator: without bounds checking

oINLINE T& a_no_check(int n)
read/write non-const access operator: without bounds checking

oINLINE const T& a_no_check_1(int n) const
read-only const access operator: without bounds checking

oINLINE T& a_no_check_1(int n)
read/write non-const access operator: without bounds checking

oconst T& a_check(int n) const
read-only const access operator: with bounds checking

oT& a_check(int n)
read/write non-const access operator: with bounds checking

oconst T& operator () (int n) const
read-only const access operator: return reference to nth member

oT& operator [] (int n)
read/write non const access operator: return reference to nth member

oEST_TVector& operator=(const EST_TVector &s)
assignment operator

ovoid fill(const T &v)
Fill entire array will value <parameter>v</parameter>

ovoid empty()
Fill vector with default value

oEST_write_status save(const EST_String &filename)
Save vector to file <parameter>filename</parameter>

oint operator == (const EST_TVector &v) const
is true if vectors are equal size and all elements are equal

oint operator != (const EST_TVector &v) const
is true if vectors are not equal size or a single elements isn't equal

ovoid copy_section(T* dest, int offset=0, int num=-1) const
Copy data in and out. Subclassed by SimpleVector for speed.

ovoid sub_vector(EST_TVector<T> &sv, int start_c=0, int len=-1)
Create a sub vector

ovoid integrity() const


Direct child classes:
EST_TSimpleVector
EST_TMatrix
Friends:
ostream& operator << (ostream &st, const EST_TVector<T> &m)
class EST_TMatrix<T>

Alphabetic index HTML hierarchy of classes or Java


This page is part of the Edinburgh Speech Tools Library documentation
Copyright University of Edinburgh 1997
Contact: speech_tools@cstr.ed.ac.uk