Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

SparseVector Class Reference
[Datastructures]

#include <OpenMS/DATASTRUCTURES/SparseVector.h>

List of all members.


Detailed Description

binned sparse vector implementation, which does not contain zero-elements

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
SparseVectoroperator= (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...


Member Typedef Documentation

typedef SparseVectorConstIterator const_iterator

typedef SparseVectorConstIterator ConstIterator

typedef SparseVectorIterator iterator

typedef SparseVectorIterator Iterator


Constructor & Destructor Documentation

SparseVector (  ) 

default constructor

SparseVector ( int  size  ) 

detailed constructor

SparseVector ( const SparseVector source  ) 

copy constructor

virtual ~SparseVector (  )  [virtual]

destructor


Member Function Documentation

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

Parameters:
newsize 

iterator begin (  ) 

begin iterator

iterator end (  ) 

end iterator

const_iterator begin (  )  const

const begin iterator

const_iterator end (  )  const

const end iterator


Friends And Related Function Documentation

friend class SparseVectorIterator [friend]

friend class SparseVectorConstIterator [friend]

friend class DoubleProxy [friend]


Member Data Documentation

std::map<UInt, double> values_ [private]

UInt size_ [private]


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:44 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1