Lapack++
|
00001 // LAPACK++ (V. 1.1) 00002 // (C) 1992-1996 All Rights Reserved. 00003 00004 00005 #include "arch.h" 00006 #ifndef _LA_SYMM_TRIDIAG_MAT_DOUBLE_H_ 00007 #define _LA_SYMM_TRIDIAG_MAT_DOUBLE_H_ 00008 00009 #include LA_VECTOR_DOUBLE_H 00010 00011 class DLLIMPORT LaSymmTridiagMatDouble 00012 { 00013 int size_; 00014 LaVectorDouble d_; /* main diag */ 00015 LaVectorDouble dl_; /* lower diag */ 00016 static double outofbounds_; /* return this address, when addresing 00017 out of bounds */ 00018 static int debug_; // print debug info. 00019 static int *info_; // print matrix info only, not values 00020 // originally 0, set to 1, and then 00021 // reset to 0 after use. 00022 00023 public: 00024 00025 // constructors / destructor 00026 00027 inline LaSymmTridiagMatDouble(); 00028 inline LaSymmTridiagMatDouble(int N); 00029 inline LaSymmTridiagMatDouble(const LaSymmTridiagMatDouble &); 00030 inline ~LaSymmTridiagMatDouble(); 00031 00032 // operators and member functions 00033 00034 double& operator()(int i, int j); 00035 double operator()(int i, int j) const; 00036 LaVectorDouble diag(int); /* 0 main, -1 lower, 1 upper */ 00037 LaVectorDouble diag(int) const; 00038 inline LaSymmTridiagMatDouble& ref(LaSymmTridiagMatDouble&); 00039 inline LaSymmTridiagMatDouble& copy(const LaSymmTridiagMatDouble&); 00040 inline const LaSymmTridiagMatDouble& info() const 00041 { 00042 int *t = info_; 00043 *t = 1; 00044 return *this; 00045 }; 00046 inline int debug() const // return debug flag. 00047 { 00048 return debug_; 00049 } 00050 inline int size() const; 00051 00052 00053 00054 friend DLLIMPORT std::ostream& operator<<(std::ostream&, const LaSymmTridiagMatDouble&); 00055 00056 00057 }; 00058 00059 DLLIMPORT std::ostream& operator<<(std::ostream& s, const LaSymmTridiagMatDouble& td); 00060 00061 // constructors 00062 00063 inline LaSymmTridiagMatDouble::LaSymmTridiagMatDouble(): 00064 d_(), dl_() 00065 { 00066 size_ = 0; 00067 } 00068 00069 inline LaSymmTridiagMatDouble::LaSymmTridiagMatDouble(int N): 00070 d_(N), dl_(N - 1) 00071 { 00072 size_ = N; 00073 } 00074 00075 inline LaSymmTridiagMatDouble::LaSymmTridiagMatDouble(const LaSymmTridiagMatDouble& td): d_(td.d_), dl_(td.dl_) 00076 { 00077 size_ = td.size_; 00078 } 00079 00080 // destructor 00081 00082 inline LaSymmTridiagMatDouble::~LaSymmTridiagMatDouble() 00083 { 00084 } 00085 00086 00087 // operators and member functions 00088 00089 00090 00091 inline LaSymmTridiagMatDouble& LaSymmTridiagMatDouble::ref(LaSymmTridiagMatDouble&T) 00092 { 00093 d_.ref(T.d_); 00094 dl_.ref(T.dl_); 00095 size_ = T.size_; 00096 00097 return *this; 00098 } 00099 00100 00101 inline LaSymmTridiagMatDouble& LaSymmTridiagMatDouble::copy(const LaSymmTridiagMatDouble&T) 00102 { 00103 d_.copy(T.d_); 00104 dl_.copy(T.dl_); 00105 size_ = T.size_; 00106 00107 return *this; 00108 } 00109 00110 inline int LaSymmTridiagMatDouble::size() const 00111 { 00112 return size_; 00113 } 00114 00115 00116 00117 #endif 00118 // _LA_SYMM_TRIDIAG_MAT_DOUBLE_H_