Loading...
Searching...
No Matches
EST_TVector< T > Class Template Reference
Inheritance diagram for EST_TVector< T >:
[legend]

## Public Member Functions

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 (unsigned int c) const
INLINE unsigned int | vcell_pos_1 (unsigned int c) const
INLINE const T & | fast_a_v (int c) const
| quick method for returning (x[n])
INLINE T & | fast_a_v (int c)
INLINE const T & | fast_a_1 (int c) const
INLINE T & | fast_a_1 (int c)
void | set_values (const T *data, int step, int start_c, int num_c)
| Get and set values from array.
void | get_values (T *data, int step, int start_c, int num_c) const
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 | just_resize (int new_cols, T **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 (const EST_TVector< T > &v)
| copy constructor
| EST_TVector (int n)
| "size" constructor - make vector of size n.
| EST_TVector (int, T *memory, int offset=0, int free_when_destroyed=0)
| construct from memory supplied by caller
| ~EST_TVector ()
| destructor.
void | resize (int n, int set=1)
const T * | memory () const
T * | memory ()

## Public Attributes

T * | 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

## Static Public Attributes

static const T * | def_val
| default value, used for filling matrix after resizing
static T * | error_return

## access

Basic access methods for vectors.
class | EST_TMatrix< T >
| Matrix must be friend to set up subvectors.
ostream & | operator<< (ostream &st, const EST_TVector< T > &m)
| print out vector.
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 T & | a_no_check (int n) const
| read-only const access operator: without bounds checking
INLINE T & | a_no_check (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
INLINE T & | a_no_check_1 (int n)
| read/write non-const access operator: without bounds checking
const T & | a_check (int n) const
| read-only const access operator: with bounds checking
T & | a_check (int n)
| read/write non-const access operator: with bounds checking
const T & | a (int n) const
T & | a (int n)
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
void | set_memory (T *buffer, int offset, int columns, int free_when_destroyed=0)
EST_TVector & | operator= (const EST_TVector &s)
| assignment operator
void | fill (const T &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 (T *dest, int offset=0, int num=-1) const
| Copy data in and out. Subclassed by SimpleVector for speed.
void | set_section (const T *src, int offset=0, int num=-1)
void | sub_vector (EST_TVector< T > &sv, int start_c=0, int len=-1)
| Create a sub vector.
void | integrity () const

## Detailed Description

template<class T>
class EST_TVector< T >

Definition at line 147 of file EST_TVector.h.

## Constructor & Destructor Documentation

## EST_TVector() [1/4]

template<class T>

EST_TVector< T >::EST_TVector | ( |  | ) |

default constructor

Definition at line 61 of file EST_TVector.cc.

## EST_TVector() [2/4]

template<class T>

EST_TVector< T >::EST_TVector | ( | const EST_TVector< T > & | v | ) |

copy constructor

Definition at line 74 of file EST_TVector.cc.

## EST_TVector() [3/4]

template<class T>

EST_TVector< T >::EST_TVector | ( | int | n | ) |

"size" constructor - make vector of size n.

Definition at line 67 of file EST_TVector.cc.

## EST_TVector() [4/4]

template<class T>

EST_TVector< T >::EST_TVector | ( | int | n,
|  | T * | memory,
|  | int | offset = 0,
|  | int | free_when_destroyed = 0 )

construct from memory supplied by caller

Definition at line 81 of file EST_TVector.cc.

## ~EST_TVector()

template<class T>

EST_TVector< T >::~EST_TVector | ( |  | ) |

destructor.

Definition at line 90 of file EST_TVector.cc.

## Member Function Documentation

## vcell_pos() [1/2]

template<class T>

INLINE unsigned int EST_TVector< T >::vcell_pos | ( | unsigned int | c,
|  | unsigned int | cs ) const

inline

The memory access rule, in one place for easy reference.

Definition at line 167 of file EST_TVector.h.

## vcell_pos() [2/2]

template<class T>

INLINE unsigned int EST_TVector< T >::vcell_pos | ( | unsigned int | c | ) | const

inline

Definition at line 171 of file EST_TVector.h.

## vcell_pos_1()

template<class T>

INLINE unsigned int EST_TVector< T >::vcell_pos_1 | ( | unsigned int | c | ) | const

inline

Definition at line 177 of file EST_TVector.h.

## fast_a_v() [1/2]

template<class T>

INLINE const T & EST_TVector< T >::fast_a_v | ( | int | c | ) | const

inline

quick method for returning (x[n])

Definition at line 183 of file EST_TVector.h.

## fast_a_v() [2/2]

template<class T>

INLINE T & EST_TVector< T >::fast_a_v | ( | int | c | ) |

inline

Definition at line 185 of file EST_TVector.h.

## fast_a_1() [1/2]

template<class T>

INLINE const T & EST_TVector< T >::fast_a_1 | ( | int | c | ) | const

inline

Definition at line 187 of file EST_TVector.h.

## fast_a_1() [2/2]

template<class T>

INLINE T & EST_TVector< T >::fast_a_1 | ( | int | c | ) |

inline

Definition at line 188 of file EST_TVector.h.

## set_values()

template<class T>

void EST_TVector< T >::set_values | ( | const T * | data,
|  | int | step,
|  | int | start_c,
|  | int | num_c )

Get and set values from array.

Definition at line 126 of file EST_TVector.cc.

## get_values()

template<class T>

void EST_TVector< T >::get_values | ( | T * | data,
|  | int | step,
|  | int | start_c,
|  | int | num_c ) const

Definition at line 137 of file EST_TVector.cc.

## copy()

template<class T>

void EST_TVector< T >::copy | ( | const EST_TVector< T > & | a | ) |

private copy function, called from all other copying functions.

Definition at line 154 of file EST_TVector.cc.

## copy_data()

template<class T>

void EST_TVector< T >::copy_data | ( | const EST_TVector< T > & | a | ) |

just copy data, no resizing, no size check.

Definition at line 148 of file EST_TVector.cc.

## just_resize()

template<class T>

void EST_TVector< T >::just_resize | ( | int | new_cols,
|  | T ** | old_vals )

resize the memory and reset the bounds, but don't set values.

Definition at line 161 of file EST_TVector.cc.

## default_vals()

template<class T>

void EST_TVector< T >::default_vals | ( |  | ) |

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

Definition at line 50 of file EST_TVector.cc.

## resize()

template<class T>

void EST_TVector< T >::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>

Definition at line 196 of file EST_TVector.cc.

## memory() [1/2]

template<class T>

const T * EST_TVector< T >::memory | ( |  | ) | const

inline

For when you absolutely have to have access to the memory.

Definition at line 241 of file EST_TVector.h.

## memory() [2/2]

template<class T>

T * EST_TVector< T >::memory | ( |  | ) |

inline

Definition at line 242 of file EST_TVector.h.

## num_columns()

template<class T>

INLINE int EST_TVector< T >::num_columns | ( |  | ) | const

inline

number of items in vector.

Definition at line 250 of file EST_TVector.h.

## length()

template<class T>

INLINE int EST_TVector< T >::length | ( |  | ) | const

inline

number of items in vector.

Definition at line 252 of file EST_TVector.h.

## n()

template<class T>

INLINE int EST_TVector< T >::n | ( |  | ) | const

inline

number of items in vector.

Definition at line 254 of file EST_TVector.h.

## a_no_check() [1/2]

template<class T>

INLINE const T & EST_TVector< T >::a_no_check | ( | int | n | ) | const

inline

read-only const access operator: without bounds checking

Definition at line 257 of file EST_TVector.h.

## a_no_check() [2/2]

template<class T>

INLINE T & EST_TVector< T >::a_no_check | ( | int | n | ) |

inline

read/write non-const access operator: without bounds checking

Definition at line 259 of file EST_TVector.h.

## a_no_check_1() [1/2]

template<class T>

INLINE const T & EST_TVector< T >::a_no_check_1 | ( | int | n | ) | const

inline

read-only const access operator: without bounds checking

Definition at line 261 of file EST_TVector.h.

## a_no_check_1() [2/2]

template<class T>

INLINE T & EST_TVector< T >::a_no_check_1 | ( | int | n | ) |

inline

read/write non-const access operator: without bounds checking

Definition at line 263 of file EST_TVector.h.

## a_check() [1/2]

template<class T>

const T & EST_TVector< T >::a_check | ( | int | n | ) | const

read-only const access operator: with bounds checking

Definition at line 249 of file EST_TVector.cc.

## a_check() [2/2]

template<class T>

T & EST_TVector< T >::a_check | ( | int | n | ) |

read/write non-const access operator: with bounds checking

Definition at line 240 of file EST_TVector.cc.

## a() [1/2]

template<class T>

const T & EST_TVector< T >::a | ( | int | n | ) | const

inline

Definition at line 272 of file EST_TVector.h.

## a() [2/2]

template<class T>

T & EST_TVector< T >::a | ( | int | n | ) |

inline

Definition at line 273 of file EST_TVector.h.

## operator()()

template<class T>

const T & EST_TVector< T >::operator() | ( | int | n | ) | const

inline

read-only const access operator: return reference to nth member

Definition at line 276 of file EST_TVector.h.

## operator[]()

template<class T>

T & EST_TVector< T >::operator[] | ( | int | n | ) |

inline

read/write non const access operator: return reference to nth member

Definition at line 283 of file EST_TVector.h.

## set_memory()

template<class T>

void EST_TVector< T >::set_memory | ( | T * | buffer,
|  | int | offset,
|  | int | columns,
|  | int | free_when_destroyed = 0 )

Definition at line 112 of file EST_TVector.cc.

## operator=()

template<class T>

EST_TVector< T > & EST_TVector< T >::operator= | ( | const EST_TVector< T > & | s | ) |

assignment operator

Definition at line 233 of file EST_TVector.cc.

## fill()

template<class T>

void EST_TVector< T >::fill | ( | const T & | v | ) |

Fill entire array will value <parameter>v</parameter>.

Definition at line 105 of file EST_TVector.cc.

## empty()

template<class T>

void EST_TVector< T >::empty | ( |  | ) |

inline

Fill vector with default value.

Definition at line 297 of file EST_TVector.h.

## operator==()

template<class T>

int EST_TVector< T >::operator== | ( | const EST_TVector< T > & | v | ) | const

is true if vectors are equal size and all elements are equal.

Definition at line 255 of file EST_TVector.cc.

## operator!=()

template<class T>

int EST_TVector< T >::operator!= | ( | const EST_TVector< T > & | v | ) | const

inline

is true if vectors are not equal size or a single elements isn't equal.

Definition at line 302 of file EST_TVector.h.

## copy_section()

template<class T>

void EST_TVector< T >::copy_section | ( | T * | dest,
|  | int | offset = 0,
|  | int | num = -1 ) const

Copy data in and out. Subclassed by SimpleVector for speed.

Definition at line 271 of file EST_TVector.cc.

## set_section()

template<class T>

void EST_TVector< T >::set_section | ( | const T * | src,
|  | int | offset = 0,
|  | int | num = -1 )

Definition at line 285 of file EST_TVector.cc.

## sub_vector()

template<class T>

void EST_TVector< T >::sub_vector | ( | EST_TVector< T > & | sv,
|  | int | start_c = 0,
|  | int | len = -1 )

Create a sub vector.

Definition at line 298 of file EST_TVector.cc.

## integrity()

template<class T>

void EST_TVector< T >::integrity | ( |  | ) | const

Definition at line 315 of file EST_TVector.cc.

## Friends And Related Symbol Documentation

## EST_TMatrix< T >

template<class T>

friend class EST_TMatrix< T >

friend

Matrix must be friend to set up subvectors.

Definition at line 313 of file EST_TVector.h.

## operator<<

template<class T>

ostream & operator<< | ( | ostream & | st,
|  | const EST_TVector< T > & | m )

friend

print out vector.

Definition at line 313 of file EST_TVector.h.

## Member Data Documentation

## p_memory

template<class T>

T* EST_TVector< T >::p_memory

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

Definition at line 154 of file EST_TVector.h.

## p_num_columns

template<class T>

unsigned int EST_TVector< T >::p_num_columns

Visible shape.

Definition at line 157 of file EST_TVector.h.

## p_offset

template<class T>

unsigned int EST_TVector< T >::p_offset

How to access the memory.

Definition at line 160 of file EST_TVector.h.

## p_column_step

template<class T>

unsigned int EST_TVector< T >::p_column_step

Definition at line 161 of file EST_TVector.h.

## p_sub_matrix

template<class T>

bool EST_TVector< T >::p_sub_matrix

Definition at line 163 of file EST_TVector.h.

## def_val

template<class T>

const T* EST_TVector< T >::def_val

static

default value, used for filling matrix after resizing

Definition at line 223 of file EST_TVector.h.

## error_return

template<class T>

T* EST_TVector< T >::error_return

static

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

Definition at line 230 of file EST_TVector.h.

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

- include/EST_TVector.h
- base_class/EST_TVector.cc