29 #ifndef __SPARSEMATRIX_HPP 30 #define __SPARSEMATRIX_HPP 33 # pragma GCC system_header 37 #include "allocator.h" 57 int _maxEntriesPerRow;
61 static int UseAllocator(
void);
62 static void SetAllocator(
int blockSize );
73 void Resize(
int rows );
74 void Resize(
int rows ,
int maxEntriesPerRow );
75 void SetRowSize(
int row ,
int count );
76 int Entries(
void )
const;
109 bool write( FILE* fp )
const;
110 bool write(
const char* fileName )
const;
111 bool read( FILE* fp );
112 bool read(
const char* fileName );
125 if( _dim )
for(
int t=0 ; t<int(out.size()) ; t++ )
delete[] out[t];
130 int threads(
void )
const {
return int( out.size() ); }
133 if( threads!=out.size() || _dim<dim )
135 for(
int t=0 ; t<int(out.size()) ; t++ )
delete[] out[t];
136 out.resize( threads );
137 for(
int t=0 ; t<int(out.size()) ; t++ ) out[t] =
new T2[dim];
169 #if defined _WIN32 && !defined __MINGW32__ 172 #endif // _WIN32 || __MINGW32__ 185 #include "sparse_matrix.hpp"
static Allocator< MatrixEntry< T > > internalAllocator
void read(std::istream &stream, Type &value)
Function for reading data from a stream.
PCL_EXPORTS void Multiply(const double in1[2], const double in2[2], double out[2])
const T2 * operator[](int t) const
PCL_EXPORTS int Solve(const double *eqns, const double *values, double *solutions, int dim)
MatrixEntry< T > ** m_ppElements
void resize(int threads, int dim)
This templated class assists in memory allocation and is well suited for instances when it is known t...
void write(std::ostream &stream, Type value)
Function for writing data to a stream.