00001 // LAPACK++ (V. 1.1) 00002 // (C) 1992-1996 All Rights Reserved. 00003 00004 #ifndef _LA_SPD_BAND_MAT_DOUBLE_H_ 00005 #define _LA_SPD_BAND_MAT_DOUBLE_H_ 00006 00007 #include "arch.h" 00008 #include LA_GEN_MAT_DOUBLE_H 00009 #include LA_VECTOR_DOUBLE_H 00010 00011 00012 class DLLIMPORT LaSpdBandMatDouble 00013 { 00014 LaGenMatDouble data_; // internal storage. 00015 00016 int N_; // N_ is (NxN) 00017 int kl_; // kl_ = # subdiags 00018 static double outofbounds_; // out of range value returned. 00019 static int debug_; // print debug info. 00020 static int *info_; // print matrix info only, not values 00021 // originally 0, set to 1, and then 00022 // reset to 0 after use. 00023 00024 00025 public: 00026 00027 // constructors 00028 00029 inline LaSpdBandMatDouble(); 00030 inline LaSpdBandMatDouble(int,int); 00031 inline LaSpdBandMatDouble(const LaSpdBandMatDouble &); 00032 00033 // operators 00034 00035 inline LaSpdBandMatDouble& operator=(double); 00036 inline LaSpdBandMatDouble& operator=(const LaSpdBandMatDouble&); 00037 double& operator()(int,int); 00038 double& operator()(int,int) const; 00039 friend std::ostream& operator<<(std::ostream &, const LaSpdBandMatDouble &); 00040 00041 00042 // member functions 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 00048 inline LaSpdBandMatDouble& ref(LaSpdBandMatDouble &); 00049 inline LaSpdBandMatDouble& copy(const LaSpdBandMatDouble &); 00050 inline double* addr() const { // return address of matrix. 00051 return data_.addr();} 00052 inline int ref_count() const { // return ref_count of matrix. 00053 return data_.ref_count();} 00054 inline LaIndex index(int d) const { // return indices of matrix. 00055 return data_.index(d);} 00056 inline int subdiags() { // return # of subdiags of matrix. 00057 return (kl_);} 00058 inline int shallow() const { // return shallow flag. 00059 return data_.shallow();} 00060 inline int debug() const { // return debug flag. 00061 return debug_;} 00062 inline int debug(int d) { // set debug flag for lagenmat. 00063 return debug_ = d;} 00064 00065 inline LaSpdBandMatDouble& resize(const LaSpdBandMatDouble&); 00066 00067 inline const LaSpdBandMatDouble& info() const { 00068 int *t = info_; 00069 *t = 1; 00070 return *this;}; 00071 00072 inline LaSpdBandMatDouble print_data() const 00073 { std::cout << data_; return *this;} 00074 00075 // destructor 00076 00077 inline ~LaSpdBandMatDouble(); 00078 }; 00079 00080 // constructors 00081 00082 inline LaSpdBandMatDouble::LaSpdBandMatDouble() 00083 :data_() 00084 { 00085 00086 N_ = kl_ = 0; 00087 } 00088 00089 inline LaSpdBandMatDouble::LaSpdBandMatDouble(int n,int l) 00090 :data_(n,2*l+1) 00091 { 00092 00093 N_ = n; 00094 kl_ = l; 00095 } 00096 00097 inline LaSpdBandMatDouble::LaSpdBandMatDouble(const LaSpdBandMatDouble &A) 00098 { 00099 00100 data_.copy(A.data_); 00101 N_ = A.N_; 00102 kl_ = A.kl_; 00103 } 00104 00105 // destructor 00106 00107 inline LaSpdBandMatDouble::~LaSpdBandMatDouble() 00108 { 00109 } 00110 00111 00112 // member functions and operators 00113 00114 inline LaSpdBandMatDouble& LaSpdBandMatDouble::ref(LaSpdBandMatDouble &ob) 00115 { 00116 00117 data_.ref(ob.data_); 00118 N_ = ob.N_; 00119 kl_ = ob.kl_; 00120 00121 return *this; 00122 } 00123 00124 inline LaSpdBandMatDouble& LaSpdBandMatDouble::resize(const LaSpdBandMatDouble &ob) 00125 { 00126 00127 data_.resize(ob.data_); 00128 00129 return *this; 00130 } 00131 00132 00133 inline LaSpdBandMatDouble& LaSpdBandMatDouble::operator=(const LaSpdBandMatDouble &B) 00134 { 00135 data_ = B.data_; 00136 N_ = B.N_; 00137 kl_ = B.kl_; 00138 00139 return *this; 00140 } 00141 00142 inline int LaSpdBandMatDouble::size(int d) const 00143 { 00144 return(data_.size(d)); 00145 } 00146 00147 inline int LaSpdBandMatDouble::inc(int d) const 00148 { 00149 return(data_.inc(d)); 00150 } 00151 00152 inline int LaSpdBandMatDouble::gdim(int d) const 00153 { 00154 return(data_.gdim(d)); 00155 } 00156 00157 #endif 00158 // _LA_SPD_BAND_MAT_DOUBLE_H_ 00159