iRoCS Toolbox
1.1.0
|
The SparseFV class specifies a vector with sparse storage. More...
#include <SparseFV.hh>
Public Types | |
typedef std::list< svt::SparseItem >::const_iterator | const_iterator |
typedef const double & | const_reference |
typedef std::list< svt::SparseItem >::iterator | iterator |
typedef double & | reference |
typedef unsigned int | size_type |
Public Member Functions | |
SparseFV () | |
Constructor. More... | |
~SparseFV () | |
Destructor. More... | |
const_iterator | begin () const |
iterator | begin () |
void | cleanup () |
cleanup function to delete items with value 0 (maybe someone needs this) More... | |
void | clear () |
Clear FV's data. More... | |
double | dotProduct (const svt::SparseFV &fv) const |
Calculate and return dot product of *this and specified FV. More... | |
const_iterator | end () const |
iterator | end () |
double | getLabel () const |
Returns label of FV. More... | |
void | operator*= (double factor) |
void | operator+= (const svt::SparseFV &fv) |
bool | operator== (const svt::SparseFV &fv) const |
comparison More... | |
double | operator[] (size_type index) const |
Return const reference to value data item with specified index. More... | |
reference | operator[] (size_type index) |
Return reference to value data item with specified index. More... | |
void | readWithoutLabel (std::istream &is) |
Read FV from input stream without label. More... | |
void | resize (size_type s) |
resizing sparse vector has no effect on the vector. More... | |
void | setLabel (double value) |
Set FV's label. More... | |
void | setUniqueID (unsigned int uid) |
void | setZero () |
size_type | size () const |
size of sparse vector is just the value of the last resize() More... | |
double | square () const |
Calculate and return square of FV. More... | |
unsigned int | uniqueID () const |
void | writeWithoutLabel (std::ostream &os) const |
Write FV to output stream without label. More... | |
Static Public Member Functions | |
static const char * | helpPipeFormat () |
Protected Attributes | |
size_type | _size |
unsigned int | _uniqueID |
std::list< svt::SparseItem > | pFeatures |
double | pLabel |
double | pSquare |
bool | pSquareValid |
Friends | |
std::ostream & | operator<< (std::ostream &os, const svt::SparseFV &fv) |
std::istream & | operator>> (std::istream &is, svt::SparseFV &fv) |
The SparseFV class specifies a vector with sparse storage.
only non-zero elements of thethe vector are stored in a list
Definition at line 137 of file SparseFV.hh.
typedef std::list<svt::SparseItem>::iterator svt::SparseFV::iterator |
Definition at line 140 of file SparseFV.hh.
typedef std::list<svt::SparseItem>::const_iterator svt::SparseFV::const_iterator |
Definition at line 141 of file SparseFV.hh.
typedef double& svt::SparseFV::reference |
Definition at line 142 of file SparseFV.hh.
typedef const double& svt::SparseFV::const_reference |
Definition at line 143 of file SparseFV.hh.
typedef unsigned int svt::SparseFV::size_type |
Definition at line 144 of file SparseFV.hh.
|
inline |
|
inline |
Destructor.
Definition at line 164 of file SparseFV.hh.
|
inline |
|
inline |
Set FV's label.
value | new label value |
Definition at line 187 of file SparseFV.hh.
Referenced by svt::operator>>().
|
inline |
Definition at line 192 of file SparseFV.hh.
|
inline |
Definition at line 198 of file SparseFV.hh.
|
inline |
Clear FV's data.
Definition at line 209 of file SparseFV.hh.
|
inline |
Definition at line 215 of file SparseFV.hh.
Referenced by dotProduct(), and operator+=().
|
inline |
Definition at line 220 of file SparseFV.hh.
|
inline |
Definition at line 226 of file SparseFV.hh.
Referenced by dotProduct().
|
inline |
Definition at line 231 of file SparseFV.hh.
|
inline |
Return const reference to value data item with specified index.
index |
Definition at line 246 of file SparseFV.hh.
Return reference to value data item with specified index.
index |
Definition at line 269 of file SparseFV.hh.
|
inline |
resizing sparse vector has no effect on the vector.
Just remebering this value to return it, if someone asks for size() (just for compatibility to other containters)
Definition at line 303 of file SparseFV.hh.
|
inline |
size of sparse vector is just the value of the last resize()
Definition at line 321 of file SparseFV.hh.
|
inline |
cleanup function to delete items with value 0 (maybe someone needs this)
Definition at line 339 of file SparseFV.hh.
|
inline |
|
inline |
Calculate and return dot product of *this and specified FV.
fv |
Definition at line 395 of file SparseFV.hh.
|
inline |
|
inline |
Definition at line 450 of file SparseFV.hh.
|
inline |
Definition at line 478 of file SparseFV.hh.
|
inline |
Definition at line 487 of file SparseFV.hh.
|
inline |
Read FV from input stream without label.
is |
Definition at line 503 of file SparseFV.hh.
Referenced by svt::operator>>().
|
inline |
Write FV to output stream without label.
os |
Definition at line 543 of file SparseFV.hh.
Referenced by svt::operator<<().
|
inlinestatic |
Definition at line 553 of file SparseFV.hh.
|
friend |
Definition at line 578 of file SparseFV.hh.
|
friend |
Definition at line 586 of file SparseFV.hh.
|
protected |
Definition at line 567 of file SparseFV.hh.
Referenced by operator+=(), and operator==().
|
protected |
Definition at line 568 of file SparseFV.hh.
Referenced by svt::operator<<().
|
protected |
Definition at line 569 of file SparseFV.hh.
|
mutableprotected |
Definition at line 571 of file SparseFV.hh.
|
mutableprotected |
Definition at line 572 of file SparseFV.hh.
|
protected |
Definition at line 573 of file SparseFV.hh.