#include <OpenMS/DATASTRUCTURES/SparseVector.h>
sparse Vector for use in BinnedRep
since the BinnedReps tend to be very sparse at low binsizes
this should use less space than a normal vector ad distance functions can just ignore (hop()) zeroes, so it should be a little bit faster, too
Public Types | |
typedef SparseVectorConstIterator | const_iterator |
typedef SparseVectorConstIterator | ConstIterator |
typedef SparseVectorIterator | iterator |
typedef SparseVectorIterator | Iterator |
Public Member Functions | |
Constructor and Desctructor | |
SparseVector () | |
default constructor | |
SparseVector (int size) | |
detailed constructor | |
SparseVector (const SparseVector &source) | |
copy constructor | |
virtual | ~SparseVector () |
destructor | |
SparseVector & | operator= (const SparseVector &source) |
assignment operator | |
const DoubleProxy | operator[] (UInt pos) const |
DoubleProxy handles the conversion to int and ,the writing ( if != 0 ). | |
DoubleProxy | operator[] (UInt pos) |
UInt | size () const |
size of the represented vector | |
UInt | nonzero_size () const |
number of nonzero elements, i.e. the space actually used | |
double | at (UInt pos) const |
at (see stl vector docs) | |
void | push_back (double value) |
push_back (see stl vector docs) | |
void | clear () |
removes all elements | |
void | resize (UInt newsize) |
resizes the the vector to | |
Iterators | |
iterator | begin () |
begin iterator | |
iterator | end () |
end iterator | |
const_iterator | begin () const |
const begin iterator | |
const_iterator | end () const |
const end iterator | |
Private Attributes | |
std::map< UInt, double > | values_ |
UInt | size_ |
Friends | |
class | SparseVectorIterator |
class | SparseVectorConstIterator |
class | DoubleProxy |
Classes | |
class | DoubleProxy |
class DoubleProxy allows the SparseVector to differentiate between writing and reading, so zeros can be ignored More... | |
class | SparseVectorConstIterator |
const_iterator for SparseVector More... | |
class | SparseVectorIterator |
iterator for SparseVector More... |
typedef SparseVectorIterator iterator |
typedef SparseVectorIterator Iterator |
SparseVector | ( | ) |
default constructor
SparseVector | ( | int | size | ) |
detailed constructor
SparseVector | ( | const SparseVector & | source | ) |
copy constructor
virtual ~SparseVector | ( | ) | [virtual] |
destructor
SparseVector& operator= | ( | const SparseVector & | source | ) |
assignment operator
const DoubleProxy operator[] | ( | UInt | pos | ) | const |
DoubleProxy handles the conversion to int and ,the writing ( if != 0 ).
DoubleProxy operator[] | ( | UInt | pos | ) |
UInt size | ( | ) | const |
size of the represented vector
UInt nonzero_size | ( | ) | const |
number of nonzero elements, i.e. the space actually used
double at | ( | UInt | pos | ) | const |
at (see stl vector docs)
void push_back | ( | double | value | ) |
push_back (see stl vector docs)
void clear | ( | ) |
removes all elements
void resize | ( | UInt | newsize | ) |
resizes the the vector to
newsize |
iterator begin | ( | ) |
begin iterator
iterator end | ( | ) |
end iterator
const_iterator begin | ( | ) | const |
const begin iterator
const_iterator end | ( | ) | const |
const end iterator
friend class SparseVectorIterator [friend] |
friend class SparseVectorConstIterator [friend] |
friend class DoubleProxy [friend] |
Generated Tue Apr 1 15:36:44 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |