symd.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_SYMM_MAT_DOUBLE_H_
00007 #define _LA_SYMM_MAT_DOUBLE_H_
00008 
00009 #include LA_LOWER_TRIANG_MAT_DOUBLE_H
00010 
00011 class DLLIMPORT LaSymmMatDouble
00012 {
00013   LaLowerTriangMatDouble lower_data_;
00014   static int debug_;        // print out debug info.
00015   static int* info_;        // print out information on matrix.
00016 
00017 public:
00018 
00019         /*::::::::::::::::::::::::::*/
00020 
00021         /* Constructors/Destructors */
00022 
00023         /*::::::::::::::::::::::::::*/
00024 
00025 
00026   inline LaSymmMatDouble();
00027   inline LaSymmMatDouble(int,int);
00028   inline LaSymmMatDouble(double*,int,int);
00029   inline LaSymmMatDouble(const LaSymmMatDouble &);
00030   inline ~LaSymmMatDouble();
00031 
00032   // operators
00033 
00034   inline LaSymmMatDouble& ref(LaSymmMatDouble &);
00035   LaSymmMatDouble& copy(const LaSymmMatDouble &);
00036   LaSymmMatDouble& operator=(const double &);
00037   inline LaSymmMatDouble& operator=(const LaSymmMatDouble &);
00038   inline double& operator()(int,int);
00039   inline double& operator()(int,int) const;
00040 
00041   operator LaGenMatDouble();
00042   operator LaLowerTriangMatDouble();
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 data.
00048         return lower_data_.addr();}
00049   inline int ref_count() const {        // return ref_count of matrix.
00050         return lower_data_.ref_count();}
00051   inline LaIndex index(int d) const {     // return indices of matrix.
00052         return lower_data_.index(d);}
00053   inline int shallow() const {      // return indices of matrix.
00054         return lower_data_.shallow();}
00055 
00056   inline int debug() const {    // return debug flag.
00057         return debug_;}
00058   inline int debug(int d) { // set debug flag.
00059         return debug_ = d;}
00060 
00061   inline LaSymmMatDouble& resize(const LaSymmMatDouble&);
00063   inline LaSymmMatDouble& resize(int m, int n);
00064 
00065   inline const LaSymmMatDouble& info() const {
00066         int *t = info_;
00067         *t = 1;
00068         return *this;}
00069 
00070   //* I/O *//
00071 
00072   friend std::ostream& operator<<(std::ostream&, const LaSymmMatDouble&);
00073 
00074 };
00075 
00076 
00077   // constructor functions
00078 
00079 inline LaSymmMatDouble::LaSymmMatDouble() : lower_data_()
00080 {
00081 }
00082 
00083 inline LaSymmMatDouble::LaSymmMatDouble(int i,int j) : lower_data_(i,j)
00084 {
00085 }
00086 
00087 inline LaSymmMatDouble::LaSymmMatDouble(double *d,int i,int j):lower_data_(d,i,j)
00088 {
00089 }
00090 
00091 inline LaSymmMatDouble::LaSymmMatDouble(const LaSymmMatDouble &S)
00092 {
00093   lower_data_.copy(S.lower_data_);
00094 }
00095 
00096   // destructor function
00097 
00098 inline LaSymmMatDouble::~LaSymmMatDouble()
00099 {
00100         // automatically calls the destructor for LaLowerTriangMatDouble
00101 }
00102 
00103   // operator functions
00104 
00105 inline double& LaSymmMatDouble::operator()(int i, int j)
00106 {
00107 
00108   if (j>i)
00109      return (lower_data_(j,i));
00110   else
00111      return (lower_data_(i,j));
00112 
00113 }
00114 
00115 inline double& LaSymmMatDouble::operator()(int i, int j) const
00116 {
00117 
00118   if (j>i)
00119      return (lower_data_(j,i));
00120   else
00121      return (lower_data_(i,j));
00122 
00123 }
00124 
00125 inline LaSymmMatDouble& LaSymmMatDouble::ref(LaSymmMatDouble &S)
00126 {
00127   lower_data_.ref(S.lower_data_);
00128 
00129   return *this;
00130 }
00131 
00132 inline LaSymmMatDouble& LaSymmMatDouble::resize(const LaSymmMatDouble &S)
00133 {
00134     lower_data_.resize(S.lower_data_);
00135 
00136     return *this;
00137 }
00138 
00139 inline LaSymmMatDouble& LaSymmMatDouble::resize(int m, int n)
00140 {
00141     lower_data_.resize(m,n);
00142 
00143     return *this;
00144 }
00145 
00146 inline LaSymmMatDouble& LaSymmMatDouble::operator=(const LaSymmMatDouble &S)
00147 {
00148         return copy(S);
00149 }
00150 
00151 inline int LaSymmMatDouble::size(int d) const
00152 {
00153    return(lower_data_.size(d));
00154 }
00155 
00156 inline int LaSymmMatDouble::inc(int d) const
00157 {
00158    return(lower_data_.inc(d));
00159 }
00160 
00161 inline int LaSymmMatDouble::gdim(int d) const
00162 {
00163    return(lower_data_.gdim(d));
00164 }
00165 
00166 #endif

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