spdmd.h

Go to the documentation of this file.
00001 //      LAPACK++ (V. 1.1)
00002 //      (C) 1992-1996 All Rights Reserved.
00003 
00004 
00005 #ifndef _LA_SPD_MAT_DOUBLE_H_
00006 #define _LA_SPD_MAT_DOUBLE_H_
00007 
00008 #include LA_LOWER_TRIANG_MAT_DOUBLE_H
00009 
00010 
00011 class DLLIMPORT LaSpdMatDouble
00012 {
00013   LaLowerTriangMatDouble lower_data_;
00014   static int debug_;        // print out debug info.
00015   static int* info_;        // print out information on matrix.
00016 
00017 public:
00018 
00019         /*::::::::::::::::::::::::::*/
00020 
00021         /* Constructors/Destructors */
00022 
00023         /*::::::::::::::::::::::::::*/
00024 
00025 
00026   inline LaSpdMatDouble();
00027   inline LaSpdMatDouble(int,int);
00028   inline LaSpdMatDouble(double*,int,int);
00029   inline LaSpdMatDouble(const LaSpdMatDouble &);
00030   inline ~LaSpdMatDouble();
00031 
00032   // operators
00033 
00034   inline LaSpdMatDouble& ref(LaSpdMatDouble &);
00035   LaSpdMatDouble& copy(const LaSpdMatDouble &);
00036   LaSpdMatDouble& operator=(const double &);
00037   inline LaSpdMatDouble& operator=(LaSpdMatDouble &);
00038   inline double& operator()(int,int);
00039   inline double& operator()(int,int) const;
00040 
00041   operator LaGenMatDouble();
00042   operator LaLowerTriangMatDouble();
00043 
00044   inline int size(int) const ;           // submatrix size
00045   inline int inc(int d) const ;          // explicit increment
00046   inline int gdim(int d) const ;         // global dimensions
00047   inline double* addr() const {        // return address of data.
00048         return lower_data_.addr();}
00049   inline int ref_count() const {        // return ref_count of matrix.
00050         return lower_data_.ref_count();}
00051   inline LaIndex index(int d) const {     // return indices of matrix.
00052         return lower_data_.index(d);}
00053   inline int shallow() const {      // return indices of matrix.
00054         return lower_data_.shallow();}
00055 
00056   inline int debug() const {    // return debug flag.
00057         return debug_;}
00058   inline int debug(int d) { // set debug flag.
00059         return debug_ = d;}
00060 
00061   inline LaSpdMatDouble& resize(const LaSpdMatDouble&);
00062 
00063   inline const LaSpdMatDouble& info() const {
00064         int *t = info_;
00065         *t = 1;
00066         return *this;}
00067 
00068   //* I/O *//
00069 
00070   friend std::ostream& operator<<(std::ostream&, const LaSpdMatDouble&);
00071 
00072 };
00073 
00074 
00075   // constructor functions
00076 
00077 inline LaSpdMatDouble::LaSpdMatDouble() : lower_data_()
00078 {
00079 }
00080 
00081 inline LaSpdMatDouble::LaSpdMatDouble(int i,int j) : lower_data_(i,j)
00082 {
00083 }
00084 
00085 inline LaSpdMatDouble::LaSpdMatDouble(double *d,int i,int j):lower_data_(d,i,j)
00086 {
00087 }
00088 
00089 inline LaSpdMatDouble::LaSpdMatDouble(const LaSpdMatDouble &S)
00090 {
00091   lower_data_.copy(S.lower_data_);
00092 }
00093 
00094   // destructor function
00095 
00096 inline LaSpdMatDouble::~LaSpdMatDouble()
00097 {
00098         // automatically calls the destructor for LaLowerTriangMatDouble
00099 }
00100 
00101   // operator functions
00102 
00103 inline double& LaSpdMatDouble::operator()(int i, int j)
00104 {
00105 
00106   if (j>i)
00107      return (lower_data_(j,i));
00108   else
00109      return (lower_data_(i,j));
00110 
00111 }
00112 
00113 inline double& LaSpdMatDouble::operator()(int i, int j) const
00114 {
00115 
00116   if (j>i)
00117      return (lower_data_(j,i));
00118   else
00119      return (lower_data_(i,j));
00120 
00121 }
00122 
00123 inline LaSpdMatDouble& LaSpdMatDouble::ref(LaSpdMatDouble &S)
00124 {
00125   lower_data_.ref(S.lower_data_);
00126 
00127   return *this;
00128 }
00129 
00130 inline LaSpdMatDouble& LaSpdMatDouble::resize(const LaSpdMatDouble &S)
00131 {
00132     lower_data_.resize(S.lower_data_);
00133 
00134     return *this;
00135 }
00136 
00137 inline LaSpdMatDouble& LaSpdMatDouble::operator=(LaSpdMatDouble &S)
00138 {
00139         return copy(S);
00140 }
00141 
00142 inline int LaSpdMatDouble::size(int d) const
00143 {
00144    return(lower_data_.size(d));
00145 }
00146 
00147 inline int LaSpdMatDouble::inc(int d) const
00148 {
00149    return(lower_data_.inc(d));
00150 }
00151 
00152 inline int LaSpdMatDouble::gdim(int d) const
00153 {
00154    return(lower_data_.gdim(d));
00155 }
00156 
00157 #endif 
00158 // _LA_SPD_MAT_DOUBLE_H_

Generated on Sat Jul 14 11:40:36 2007 for Lapack++ by  doxygen 1.5.0