uutgmd.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_UNIT_UPPER_TRIANG_MAT_DOUBLE_H_
00007 #define _LA_UNIT_UPPER_TRIANG_MAT_DOUBLE_H_
00008 
00009 #include "lafnames.h"
00010 #include LA_GEN_MAT_DOUBLE_H
00011 
00012 
00013 //#define UNIT_UPPER_INDEX_CHK
00014 
00015 class DLLIMPORT LaUnitUpperTriangMatDouble
00016 {
00017   LaGenMatDouble data_;
00018   static double outofbounds_;
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 public:
00024 
00025   // constructors
00026 
00027   inline LaUnitUpperTriangMatDouble();
00028   inline LaUnitUpperTriangMatDouble(int,int);
00029   inline LaUnitUpperTriangMatDouble(double*,int,int);
00030   inline LaUnitUpperTriangMatDouble(const LaUnitUpperTriangMatDouble &);
00031 
00032   // operators
00033 
00034   inline LaUnitUpperTriangMatDouble& ref(LaUnitUpperTriangMatDouble &);
00035   inline LaUnitUpperTriangMatDouble& ref(LaGenMatDouble &);
00036   LaUnitUpperTriangMatDouble& copy(LaUnitUpperTriangMatDouble &);
00037         LaUnitUpperTriangMatDouble& operator=(const double &);
00038   inline LaUnitUpperTriangMatDouble& operator=(const LaUnitUpperTriangMatDouble &);
00039   double& operator()(int,int);
00040   double& operator()(int,int) const;
00041 
00042   inline operator LaGenMatDouble();
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 matrix.
00048         return data_.addr();}
00049   inline int ref_count() const {        // return ref_count of matrix.
00050         return data_.ref_count();}
00051   inline LaIndex index(int d) const {     // return indices of matrix.
00052         return data_.index(d);}
00053   inline int shallow() const {      // return indices of matrix.
00054         return data_.shallow();}
00055   inline int debug() const {    // return debug flag.
00056         return debug_;}
00057   inline int debug(int d) { // set debug flag.
00058         return debug_ = d;}
00059 
00060   inline LaUnitUpperTriangMatDouble& resize(const LaUnitUpperTriangMatDouble&);
00061 
00062   inline const LaUnitUpperTriangMatDouble& info() const {
00063         int *t = info_;
00064         *t = 1;
00065         return *this;};
00066 
00067 
00068 
00069   friend DLLIMPORT std::ostream &operator<<(std::ostream &, const LaUnitUpperTriangMatDouble &);
00070 
00071   // destructor
00072 
00073   inline ~LaUnitUpperTriangMatDouble();
00074 };
00075 
00076 DLLIMPORT std::ostream &operator<<(std::ostream &s, const LaUnitUpperTriangMatDouble &ob);
00077 
00078   // constructor functions
00079 
00080 inline LaUnitUpperTriangMatDouble::LaUnitUpperTriangMatDouble() : data_()
00081 {
00082     *info_ = 0;
00083 }
00084 
00085 inline LaUnitUpperTriangMatDouble::LaUnitUpperTriangMatDouble(int i,int j):
00086     data_(i,j)
00087 {
00088     *info_ = 0;
00089 }
00090 
00091 inline LaUnitUpperTriangMatDouble::LaUnitUpperTriangMatDouble(double *d,int i,int j):data_(d,i,j)
00092 {
00093     *info_ = 0;
00094 }
00095 
00096 inline LaUnitUpperTriangMatDouble::LaUnitUpperTriangMatDouble(const LaUnitUpperTriangMatDouble &A)
00097 {
00098 
00099   data_.copy(A.data_);
00100 }
00101 
00102   
00103   // operator functions
00104 
00105 inline LaUnitUpperTriangMatDouble& LaUnitUpperTriangMatDouble::ref(LaUnitUpperTriangMatDouble &ob)
00106 {
00107 
00108   data_.ref(ob.data_);
00109 
00110   return *this;
00111 }
00112   
00113 inline LaUnitUpperTriangMatDouble& LaUnitUpperTriangMatDouble::ref(LaGenMatDouble &ob)
00114 {
00115 
00116   data_.ref(ob);
00117 
00118   return *this;
00119 }
00120  
00121 inline LaUnitUpperTriangMatDouble& LaUnitUpperTriangMatDouble::resize(const LaUnitUpperTriangMatDouble &ob)
00122 {
00123 
00124   data_.resize(ob.data_);
00125 
00126   return *this;
00127 }
00128 
00129 
00130      
00131 inline LaUnitUpperTriangMatDouble& LaUnitUpperTriangMatDouble::operator=(const LaUnitUpperTriangMatDouble &U)
00132 {
00133 
00134     data_ = U.data_;
00135 
00136     return *this;
00137 }
00138 
00139 
00140 
00141   // destructor function
00142 
00143 inline LaUnitUpperTriangMatDouble::~LaUnitUpperTriangMatDouble()
00144 {
00145 }
00146 
00147 inline int LaUnitUpperTriangMatDouble::size(int d) const
00148 {
00149    return(data_.size(d));
00150 }
00151 
00152 inline int LaUnitUpperTriangMatDouble::inc(int d) const
00153 {
00154    return(data_.inc(d));
00155 }
00156 
00157 inline int LaUnitUpperTriangMatDouble::gdim(int d) const
00158 {
00159    return(data_.gdim(d));
00160 }
00161 
00162 
00163 // type conversions between LaGenMat and LaUnitUpTriMat
00164 
00165 inline LaUnitUpperTriangMatDouble::operator LaGenMatDouble()
00166 {
00167   LaGenMatDouble G;
00168 
00169   G.ref((*this).data_);
00170 
00171   return G;
00172 }
00173 
00174 #endif 
00175 // _LA_UNIT_UPPER_TRIANG_MAT_DOUBLE_H_

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