00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef CompCol_Mat_double_H
00037 #define CompCol_Mat_double_H
00038
00039 #include "vecdefs.h"
00040 #include VECTOR_H
00041
00042 class CompRow_Mat_double;
00043 class Coord_Mat_double;
00044
00045 class CompCol_Mat_double {
00046
00047 private:
00048 VECTOR_double val_;
00049 VECTOR_int rowind_;
00050 VECTOR_int colptr_;
00051
00052 int base_;
00053 int nz_;
00054 int dim_[2];
00055
00056 public:
00057 CompCol_Mat_double(void);
00058 CompCol_Mat_double(const CompCol_Mat_double &S);
00059 CompCol_Mat_double(const CompRow_Mat_double &R);
00060 CompCol_Mat_double(const Coord_Mat_double &CO);
00061 CompCol_Mat_double(int M, int N, int nz, double *val, int *r,
00062 int *c, int base=0);
00063 CompCol_Mat_double(int M, int N, int nz, const VECTOR_double &val,
00064 const VECTOR_int &r, const VECTOR_int &c,
00065 int base=0);
00066 ~CompCol_Mat_double() {};
00067
00068
00069
00070
00071
00072 double& val(int i) { return val_(i); }
00073 int& row_ind(int i) { return rowind_(i); }
00074 int& col_ptr(int i) { return colptr_(i);}
00075
00076 const double& val(int i) const { return val_(i); }
00077 const int& row_ind(int i) const { return rowind_(i); }
00078 const int& col_ptr(int i) const { return colptr_(i);}
00079
00080 int dim(int i) const {return dim_[i];};
00081 int size(int i) const {return dim_[i];};
00082 int NumNonzeros() const {return nz_;};
00083 int base() const {return base_;}
00084
00085
00086
00087
00088
00089 CompCol_Mat_double& operator=(const CompCol_Mat_double &C);
00090 CompCol_Mat_double& newsize(int M, int N, int nz);
00091
00092
00093
00094
00095
00096 double operator() (int i, int j) const;
00097 double& set(int i, int j);
00098
00099
00100
00101
00102
00103 VECTOR_double operator*(const VECTOR_double &x) const;
00104 VECTOR_double trans_mult(const VECTOR_double &x) const;
00105
00106 };
00107
00108 std::ostream& operator << (std::ostream & os, const CompCol_Mat_double & mat);
00109 void readHB(const char *c, CompCol_Mat_double &M);
00110
00111 #endif
00112
00113