Vector representation and operations, allows operation in selected subspace. Also serves as the helper structure for passing matrix-operation intermediate data between higher-level matrix objects and functions.
More...
|
|
| Indexed_Vector (const DIMTYPE n) |
| | allocates for n features via reset(); starts unnarrowed (get_n()==get_d()==n)
|
|
| Indexed_Vector (const Indexed_Vector &iv) |
| | copy-constructor (deep-copies the raw buffer and the index map)
|
|
Indexed_Vector & | operator= (Indexed_Vector const &iv) |
| | deep-copy assignment (reallocates only if iv's capacity differs)
|
|
void | reset (const DIMTYPE n_max) |
| | (re)allocates for n_max features and resets to full, unnarrowed dimensionality (get_n()==get_d()==n_max, identity index map)
|
|
void | redim (const DIMTYPE n=0) |
| | keeps the existing allocation (reset() must have run already), resets to an unnarrowed identity index map, and sets get_n()==get_d()==n (n==0 means the full allocated capacity)
|
|
DATATYPE & | operator[] (const DIMTYPE i) |
| | raw (unindexed) element access, i in [0,get_n())
|
|
DATATYPE & | at_raw (const DIMTYPE i) |
| | raw (unindexed) element access, i in [0,get_n()) – same as operator[]
|
|
DATATYPE & | at (const DIMTYPE i) |
| | indexed access through the narrow_to() subset map, i in [0,get_d())
|
|
DATATYPE * | get_raw () |
| | raw pointer to the underlying buffer (get_n() valid entries)
|
|
const DATATYPE & | operator[] (const DIMTYPE i) const |
| | read-only raw (unindexed) element access, i in [0,get_n())
|
|
const DATATYPE & | at_raw (const DIMTYPE i) const |
| | read-only raw (unindexed) element access – same as the const operator[]
|
|
const DATATYPE & | at (const DIMTYPE i) const |
| | read-only indexed access through the narrow_to() subset map, i in [0,get_d())
|
|
const DATATYPE * | get_raw () const |
| | read-only raw pointer to the underlying buffer (get_n() valid entries)
|
| void | narrow_to (const PSubset sub) |
| | fill _index[] -> access to data is then mapped to sub-vector; get_d() becomes the subset size.
|
|
void | denarrow () |
| | reset _index[] -> access is reset to the full vector (identity map, get_d()==get_n())
|
|
DIMTYPE | get_n () const |
| | the full ("raw") dimensionality set by reset()/redim()
|
|
DIMTYPE | get_d () const |
| | the current virtual (narrow_to()'d) dimensionality, get_d()<=get_n()
|
|
void | set_all_raw_to (const DATATYPE val) |
| | sets all get_n() raw entries to val (ignores the index map)
|
|
void | subtract_raw (const Indexed_Vector &vr) |
| | this -= vr, elementwise over the raw get_n() entries (requires vr.get_n()==get_n())
|
|
void | copy_raw (const Indexed_Vector &vr) |
| | this = vr, elementwise over the raw get_n() entries (requires vr.get_n()==get_n())
|
template<typename DATATYPE, typename DIMTYPE, class SUBSET>
class FST::Indexed_Vector< DATATYPE, DIMTYPE, SUBSET >
Vector representation and operations, allows operation in selected subspace. Also serves as the helper structure for passing matrix-operation intermediate data between higher-level matrix objects and functions.