24 #ifndef __SPARSEARRAY_H_
25 #define __SPARSEARRAY_H_
38 #define COMPARE_EPS 1e-12
86 inline operator D() {
return value; }
114 typename HashMap<I,D*>::const_iterator iterator =
hashData->find(index);
117 D* dummy = (*iterator).second;
137 long sumSize =
sizeof *
this;
139 sumSize +=
hashData->size() * (
sizeof(
D*)+
sizeof(
D));
virtual I size()
Definition: sparsearray.h:110
D value
Definition: sparsearray.h:90
bool operator>(D el2)
Definition: sparsearray.h:71
void set(const I index, D value, D *dummy)
Definition: sparsearray.h:60
ArrayElement & operator[](const I index)
Definition: sparsearray.h:112
Definition: sparsearray.h:48
virtual ~SparseArray()
Definition: sparsearray.h:100
unsigned int I
type for matrix indices
Definition: matrix.h:36
I index
Definition: sparsearray.h:89
D operator+(ArrayElement &el2)
Definition: sparsearray.h:68
HashMap< I, D * > * hashData
Definition: sparsearray.h:148
virtual void reallocate(I arraySize)
Definition: sparsearray.h:104
D & operator=(D value)
Definition: sparsearray.h:74
SparseArray(I arraySize)
Definition: sparsearray.h:95
HashMap< I, D * > * hashData
Definition: sparsearray.h:91
virtual void allocate()
Definition: sparsearray.h:150
Definition: sparsearray.h:45
ArrayElement elementDummy
Definition: sparsearray.h:145
ArrayElement()
Definition: sparsearray.h:51
virtual long getRealSize()
sets the data (row-wise).
Definition: sparsearray.h:135
D * dummy
Definition: sparsearray.h:92
virtual void freeData()
Definition: sparsearray.h:158
void reallocate(HashMap< I, D * > *hashData)
Definition: sparsearray.h:53
I arraySize
set of all array values
Definition: sparsearray.h:147
double D
type for matrix elements
Definition: matrix.h:38