00001 #ifndef CSV_H 00002 #define CSV_H 00003 00004 /** 00005 class deals with compressed sparse %vector format 00006 00007 only nonzero %vector components are stored in the array a 00008 corresponding indices are stored in the array ind 00009 00010 JK, 25.2.2007 00011 */ 00012 00013 class compvect 00014 { 00015 public: 00016 compvect (); 00017 compvect (long *ii,long nonz); 00018 ~compvect (); 00019 void copy (compvect *bc); 00020 void setup_vector (double *b,long nc); 00021 void test_ordering (); 00022 void axpy (compvect *x,double aa); 00023 void axpy_known (compvect *x,double aa); 00024 00025 void reorder_components (); 00026 double dotprod (compvect *cv); 00027 00028 00029 00030 00031 /// number of all components (including zero components) of the stored %vector 00032 long n; 00033 /// number of nonzero components of the stored %vector 00034 long nz; 00035 /// array containing nonzero components 00036 double *a; 00037 /// array containing indices of nonzero components 00038 long *ind; 00039 00040 /// indicator of reordering 00041 long ordering; 00042 /// limit for components extraction 00043 double limit; 00044 }; 00045 00046 00047 00048 #endif