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 CompRow_Mat_double_H
00037 #define CompRow_Mat_double_H
00038
00039
00040 #include "vecdefs.h"
00041 #include VECTOR_H
00042
00043 class CompCol_Mat_double;
00044 class Coord_Mat_double;
00045
00046 class CompRow_Mat_double {
00047
00048 private:
00049 VECTOR_double val_;
00050 VECTOR_int rowptr_;
00051 VECTOR_int colind_;
00052
00053 int base_;
00054 int nz_;
00055 int dim_[2];
00056
00057 public:
00058 CompRow_Mat_double(void);
00059 CompRow_Mat_double(const CompRow_Mat_double &S);
00060 CompRow_Mat_double(const CompCol_Mat_double &C);
00061 CompRow_Mat_double(const Coord_Mat_double &CO);
00062 CompRow_Mat_double(int M, int N, int nz, double *val, int *r,
00063 int *c, int base=0);
00064 CompRow_Mat_double(int M, int N, int nz, const VECTOR_double &val,
00065 const VECTOR_int &r, const VECTOR_int &c,
00066 int base=0);
00067 ~CompRow_Mat_double() {};
00068
00069
00070
00071
00072
00073 double& val(int i) { return val_(i); }
00074 int& row_ptr(int i) { return rowptr_(i); }
00075 int& col_ind(int i) { return colind_(i);}
00076
00077 const double& val(int i) const { return val_(i); }
00078 const int& row_ptr(int i) const { return rowptr_(i); }
00079 const int& col_ind(int i) const { return colind_(i);}
00080
00081 int dim(int i) const {return dim_[i];};
00082 int size(int i) const {return dim_[i];};
00083 int NumNonzeros() const {return nz_;};
00084 int base() const {return base_;}
00085
00086
00087
00088
00089
00090 CompRow_Mat_double& operator=(const CompRow_Mat_double &R);
00091 CompRow_Mat_double& newsize(int M, int N, int nz);
00092
00093
00094
00095
00096
00097 double operator() (int i, int j) const;
00098 double& set(int i, int j);
00099
00100
00101
00102
00103
00104 VECTOR_double operator*(const VECTOR_double &x) const;
00105 VECTOR_double trans_mult(const VECTOR_double &x) const;
00106
00107 };
00108
00109 std::ostream& operator << (std::ostream & os, const CompRow_Mat_double & mat);
00110
00111 #endif
00112
00113