Lapack++
spdtrmd.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_TRIDIAG_MAT_DOUBLE_H_
00006 #define _LA_SPD_TRIDIAG_MAT_DOUBLE_H_
00007 
00008 #include "arch.h"
00009 #include "lafnames.h"
00010 #include LA_VECTOR_DOUBLE_H
00011 
00012 class DLLIMPORT LaSpdTridiagMatDouble
00013 {
00014     int size_;
00015     LaVectorDouble d_;  /* main diag */
00016     LaVectorDouble dl_; /* lower diag */
00017     static double outofbounds_; /* return this address, when addresing
00018                                         out of bounds */
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 public:
00025 
00026     // constructors / destructor
00027 
00028     inline LaSpdTridiagMatDouble();
00029     inline LaSpdTridiagMatDouble(int N);
00030     inline LaSpdTridiagMatDouble(const LaSpdTridiagMatDouble &);
00031     inline ~LaSpdTridiagMatDouble();
00032 
00033     // operators and member functions
00034 
00035     double& operator()(int i, int j);
00036     double operator()(int i, int j) const;
00037     LaVectorDouble diag(int); /* 0 main, -1 lower, 1 upper */
00038     inline LaSpdTridiagMatDouble& ref(LaSpdTridiagMatDouble&);
00039     inline LaSpdTridiagMatDouble& copy(const LaSpdTridiagMatDouble&);
00040     inline const LaSpdTridiagMatDouble& 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 LaSpdTridiagMatDouble&);
00055 
00056 
00057 };
00058 
00059 DLLIMPORT std::ostream& operator<<(std::ostream& s, const LaSpdTridiagMatDouble& td);
00060 
00061 // constructors
00062 
00063 inline LaSpdTridiagMatDouble::LaSpdTridiagMatDouble():
00064     d_(), dl_()
00065 {
00066     size_ = 0;
00067 }
00068 
00069 inline LaSpdTridiagMatDouble::LaSpdTridiagMatDouble(int N):
00070     d_(N), dl_(N - 1)
00071 {
00072     size_ = N;
00073 }
00074 
00075 inline LaSpdTridiagMatDouble::LaSpdTridiagMatDouble(const LaSpdTridiagMatDouble& td): d_(td.d_), dl_(td.dl_)
00076 {
00077     size_ = td.size_;
00078 }
00079 
00080 // destructor
00081 
00082 inline LaSpdTridiagMatDouble::~LaSpdTridiagMatDouble()
00083 {
00084 }
00085 
00086 
00087 // operators and member functions
00088 
00089 
00090 
00091 
00092 
00093 inline LaSpdTridiagMatDouble& LaSpdTridiagMatDouble::ref(LaSpdTridiagMatDouble&T)
00094 {
00095     d_.ref(T.d_);
00096     dl_.ref(T.dl_);
00097     size_ = T.size_;
00098 
00099     return *this;
00100 }
00101 
00102 
00103 inline LaSpdTridiagMatDouble& LaSpdTridiagMatDouble::copy(const LaSpdTridiagMatDouble&T)
00104 {
00105     d_.copy(T.d_);
00106     dl_.copy(T.dl_);
00107     size_ = T.size_;
00108 
00109     return *this;
00110 }
00111 
00112 inline int LaSpdTridiagMatDouble::size() const
00113 {
00114     return size_;
00115 }
00116 
00117 
00118 
00119 #endif
00120 // _LA_SPD_TRIDIAG_MAT_DOUBLE_H_