Lapack++
symd.h
Go to the documentation of this file.
00001 //      LAPACK++ (V. 1.1)
00002 //      (C) 1992-1996 All Rights Reserved.
00003 
00004 
00005 #include "arch.h"
00006 #ifndef _LA_SYMM_MAT_DOUBLE_H_
00007 #define _LA_SYMM_MAT_DOUBLE_H_
00008 
00009 #include LA_LOWER_TRIANG_MAT_DOUBLE_H
00010 
00011 class DLLIMPORT LaSymmMatDouble
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 LaSymmMatDouble();
00027     inline LaSymmMatDouble(int, int);
00028     inline LaSymmMatDouble(double*, int, int);
00029     inline LaSymmMatDouble(const LaSymmMatDouble &);
00030     inline ~LaSymmMatDouble();
00031 
00032     // operators
00033 
00034     inline LaSymmMatDouble& ref(LaSymmMatDouble &);
00035     LaSymmMatDouble& copy(const LaSymmMatDouble &);
00036     LaSymmMatDouble& operator=(const double &);
00037     inline LaSymmMatDouble& operator=(const LaSymmMatDouble &);
00038     inline double& operator()(int, int);
00039     inline const 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     {
00049         return lower_data_.addr();
00050     }
00051     inline int ref_count() const          // return ref_count of matrix.
00052     {
00053         return lower_data_.ref_count();
00054     }
00055     inline LaIndex index(int d) const       // return indices of matrix.
00056     {
00057         return lower_data_.index(d);
00058     }
00059     inline int shallow() const        // return indices of matrix.
00060     {
00061         return lower_data_.shallow();
00062     }
00063 
00064     inline int debug() const      // return debug flag.
00065     {
00066         return debug_;
00067     }
00068     inline int debug(int d)   // set debug flag.
00069     {
00070         return debug_ = d;
00071     }
00072 
00073     inline LaSymmMatDouble& resize(const LaSymmMatDouble&);
00075     inline LaSymmMatDouble& resize(int m, int n);
00076 
00077     inline const LaSymmMatDouble& info() const
00078     {
00079         int *t = info_;
00080         *t = 1;
00081         return *this;
00082     }
00083 
00084     //* I/O *//
00085 
00086     friend std::ostream& operator<<(std::ostream&, const LaSymmMatDouble&);
00087 
00088 };
00089 
00090 
00091 // constructor functions
00092 
00093 inline LaSymmMatDouble::LaSymmMatDouble() : lower_data_()
00094 {
00095 }
00096 
00097 inline LaSymmMatDouble::LaSymmMatDouble(int i, int j) : lower_data_(i, j)
00098 {
00099 }
00100 
00101 inline LaSymmMatDouble::LaSymmMatDouble(double *d, int i, int j): lower_data_(d, i, j)
00102 {
00103 }
00104 
00105 inline LaSymmMatDouble::LaSymmMatDouble(const LaSymmMatDouble &S)
00106 {
00107     lower_data_.copy(S.lower_data_);
00108 }
00109 
00110 // destructor function
00111 
00112 inline LaSymmMatDouble::~LaSymmMatDouble()
00113 {
00114     // automatically calls the destructor for LaLowerTriangMatDouble
00115 }
00116 
00117 // operator functions
00118 
00119 inline double& LaSymmMatDouble::operator()(int i, int j)
00120 {
00121 
00122     if (j > i)
00123         return (lower_data_(j, i));
00124     else
00125         return (lower_data_(i, j));
00126 
00127 }
00128 
00129 inline const double& LaSymmMatDouble::operator()(int i, int j) const
00130 {
00131 
00132     if (j > i)
00133         return (lower_data_(j, i));
00134     else
00135         return (lower_data_(i, j));
00136 
00137 }
00138 
00139 inline LaSymmMatDouble& LaSymmMatDouble::ref(LaSymmMatDouble &S)
00140 {
00141     lower_data_.ref(S.lower_data_);
00142 
00143     return *this;
00144 }
00145 
00146 inline LaSymmMatDouble& LaSymmMatDouble::resize(const LaSymmMatDouble &S)
00147 {
00148     lower_data_.resize(S.lower_data_);
00149 
00150     return *this;
00151 }
00152 
00153 inline LaSymmMatDouble& LaSymmMatDouble::resize(int m, int n)
00154 {
00155     lower_data_.resize(m, n);
00156 
00157     return *this;
00158 }
00159 
00160 inline LaSymmMatDouble& LaSymmMatDouble::operator=(const LaSymmMatDouble &S)
00161 {
00162     return copy(S);
00163 }
00164 
00165 inline int LaSymmMatDouble::size(int d) const
00166 {
00167     return(lower_data_.size(d));
00168 }
00169 
00170 inline int LaSymmMatDouble::inc(int d) const
00171 {
00172     return(lower_data_.inc(d));
00173 }
00174 
00175 inline int LaSymmMatDouble::gdim(int d) const
00176 {
00177     return(lower_data_.gdim(d));
00178 }
00179 
00180 #endif