00001 /* $Id: OSDataStructures.h 2698 2009-06-09 04:14:07Z kmartin $ */ 00020 #ifndef OSDATASTRUCTURES_H 00021 #define OSDATASTRUCTURES_H 00022 00023 00024 00025 #include "OSConfig.h" 00026 00027 #ifdef HAVE_CSTDLIB 00028 # include <cstdlib> 00029 #else 00030 # ifdef HAVE_STDLIB_H 00031 # include <stdlib.h> 00032 # endif 00033 #endif 00034 00035 00036 00037 00038 00042 class SparseMatrix { 00043 public: 00044 00049 bool bDeleteArrays; 00050 00055 bool isColumnMajor; 00056 00060 int startSize; 00061 00065 int valueSize; 00066 00071 int* starts; 00072 00077 int* indexes; 00078 00083 double* values; 00084 00089 SparseMatrix(); 00090 00099 SparseMatrix(bool isColumnMajor_, int startSize, int valueSize); 00104 ~SparseMatrix(); 00105 00111 bool display(int secondaryDim); 00112 00113 }; //SparseMatrix 00114 00115 00119 class SparseVector{ 00120 public: 00121 00127 SparseVector(int number); 00128 00133 SparseVector(); 00134 00139 ~SparseVector(); 00140 00145 bool bDeleteArrays; 00146 00150 int number; 00151 00155 int* indexes; 00156 00160 double* values; 00161 00162 }; //SparseVector 00163 00164 00168 class SparseJacobianMatrix { 00169 public: 00170 00175 bool bDeleteArrays; 00176 00180 int startSize; 00181 00185 int valueSize; 00186 00191 int* starts; 00192 00197 int* conVals; 00198 00202 int* indexes; 00203 00207 double* values; 00208 00213 SparseJacobianMatrix(); 00214 00221 SparseJacobianMatrix(int startSize, int valueSize); 00222 00227 ~SparseJacobianMatrix(); 00228 00229 }; //SparseJacobianMatrix 00230 00231 00232 00233 00234 00245 class SparseHessianMatrix { 00246 public: 00247 00252 bool bDeleteArrays; 00253 00257 int hessDimension; 00258 00262 int* hessRowIdx; 00263 00267 int* hessColIdx; 00268 00272 double* hessValues; 00273 00278 SparseHessianMatrix(); 00279 00286 SparseHessianMatrix(int startSize, int valueSize); 00287 00292 ~SparseHessianMatrix(); 00293 00294 }; //SparseHessianMatrix 00295 00299 class QuadraticTerms { 00300 00301 public: 00302 00307 int* rowIndexes; 00308 00312 int* varOneIndexes; 00313 00317 int* varTwoIndexes; 00318 00322 double* coefficients; 00323 00328 QuadraticTerms(); 00329 ~QuadraticTerms(); 00330 }; //QuadraticTerms 00331 00332 00336 class IntVector{ 00337 public: 00338 IntVector(); 00339 ~IntVector(); 00344 bool bDeleteArrays; 00345 int *el; 00346 };//class IntVector 00347 00351 class DoubleVector{ 00352 public: 00353 DoubleVector(); 00354 ~DoubleVector(); 00359 bool bDeleteArrays; 00360 double *el; 00361 };//class DoubleVector 00362 00363 00367 struct IndexValuePair{ 00371 int idx; 00372 00375 double value; 00376 00377 }; 00378 00379 00380 #endif 00381 00382 00383 00384