29 #ifndef __SPARSEMATRIX_HPP
30 #define __SPARSEMATRIX_HPP
49 int _maxEntriesPerRow;
52 Pointer(
int ) rowSizes;
54 Pointer(
MatrixEntry< T > ) operator[] (
int idx ) {
return m_ppElements[idx]; }
55 ConstPointer(
MatrixEntry< T > ) operator[] (
int idx )
const {
return m_ppElements[idx]; }
60 void Resize(
int rows );
61 void Resize(
int rows ,
int maxEntriesPerRow );
62 void SetRowSize(
int row ,
int count );
63 int Entries(
void )
const;
96 bool write( FILE* fp )
const;
97 bool write(
const char* fileName )
const;
98 bool read( FILE* fp );
99 bool read(
const char* fileName );
109 std::vector< T2* > out;
113 if( _dim )
for(
int t=0 ; t<int(out.size()) ; t++ )
delete[] out[t];
116 T2* operator[](
int t ) {
return out[t]; }
117 const T2* operator[](
int t )
const {
return out[t]; }
118 int threads(
void )
const {
return int(out.size()) ; }
119 void resize(
size_t threads ,
int dim )
121 if( threads!=out.size() || _dim<dim )
123 for(
int t=0 ; t<int(out.size()) ; t++ )
delete[] out[t];
124 out.resize( threads );
125 for(
int t=0 ; t<int(out.size()) ; t++ ) out[t] =
new T2[dim];
168 #ifndef DOXY_IGNORE_THIS
169 #include "SparseMatrix.inl"