00001
00002
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
00014
00015 class DLLIMPORT LaUnitUpperTriangMatDouble
00016 {
00017 LaGenMatDouble data_;
00018 static double outofbounds_;
00019 static int debug_;
00020 static int *info_;
00021
00022
00023 public:
00024
00025
00026
00027 inline LaUnitUpperTriangMatDouble();
00028 inline LaUnitUpperTriangMatDouble(int,int);
00029 inline LaUnitUpperTriangMatDouble(double*,int,int);
00030 inline LaUnitUpperTriangMatDouble(const LaUnitUpperTriangMatDouble &);
00031
00032
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;
00045 inline int inc(int d) const;
00046 inline int gdim(int d) const;
00047 inline double* addr() const {
00048 return data_.addr();}
00049 inline int ref_count() const {
00050 return data_.ref_count();}
00051 inline LaIndex index(int d) const {
00052 return data_.index(d);}
00053 inline int shallow() const {
00054 return data_.shallow();}
00055 inline int debug() const {
00056 return debug_;}
00057 inline int debug(int d) {
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
00072
00073 inline ~LaUnitUpperTriangMatDouble();
00074 };
00075
00076 DLLIMPORT std::ostream &operator<<(std::ostream &s, const LaUnitUpperTriangMatDouble &ob);
00077
00078
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
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
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
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