Lapack++
|
00001 // -*-C++-*- 00002 00003 // Copyright (C) 2004 00004 // Christian Stimming <stimming@tuhh.de> 00005 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public License as 00008 // published by the Free Software Foundation; either version 2, or (at 00009 // your option) any later version. 00010 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU Lesser General Public License for more details. 00015 00016 // You should have received a copy of the GNU Lesser General Public License along 00017 // with this library; see the file COPYING. If not, write to the Free 00018 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, 00019 // USA. 00020 00021 // LAPACK++ (V. 1.1) 00022 // (C) 1992-1996 All Rights Reserved. 00023 00028 #ifndef _LA_ROW_VECTOR_DOUBLE_H_ 00029 #define _LA_ROW_VECTOR_DOUBLE_H_ 00030 00031 #include "lafnames.h" 00032 00033 #ifndef _LA_GEN_MAT_DOUBLE_H_ 00034 #include LA_GEN_MAT_DOUBLE_H 00035 #endif 00036 00037 00046 class LaRowVectorDouble: public LaGenMatDouble 00047 { 00048 public: 00049 00050 inline LaRowVectorDouble(); 00051 inline LaRowVectorDouble(int); 00052 inline LaRowVectorDouble(double*, int); 00053 inline LaRowVectorDouble(const LaGenMatDouble&); 00054 00055 inline int size() const; 00056 inline int inc() const; 00057 inline LaIndex index() const; 00058 inline int start() const; 00059 inline int end() const; 00060 00061 00062 inline double& operator()(int i); 00063 inline const double& operator()(int i) const ; 00064 inline LaRowVectorDouble operator()(const LaIndex&); 00065 00066 inline LaRowVectorDouble& operator=(const LaGenMatDouble &A); 00067 inline LaRowVectorDouble& operator=(double d); 00068 00069 }; 00070 00071 00072 inline LaRowVectorDouble::LaRowVectorDouble() : LaGenMatDouble(1, 0) {} 00073 inline LaRowVectorDouble::LaRowVectorDouble(int i) : LaGenMatDouble(1, i) {} 00074 00075 00076 inline LaRowVectorDouble::LaRowVectorDouble(double *d, int m) : 00077 LaGenMatDouble(d, 1, m) {} 00078 00079 00080 inline LaRowVectorDouble::LaRowVectorDouble(const LaGenMatDouble& G) : 00081 LaGenMatDouble(G) 00082 { 00083 assert(G.size(0) == 1); 00084 00085 } 00086 00087 00088 inline int LaRowVectorDouble::size() const 00089 { 00090 return LaGenMatDouble::size(0) * LaGenMatDouble::size(1); 00091 } 00092 00093 inline double& LaRowVectorDouble::operator()(int i) 00094 { 00095 return LaGenMatDouble::operator()(0, i); 00096 } 00097 00098 inline const double& LaRowVectorDouble::operator()(int i) const 00099 { 00100 return LaGenMatDouble::operator()(0, i); 00101 } 00102 00103 inline LaRowVectorDouble LaRowVectorDouble::operator()(const LaIndex& I) 00104 { 00105 return LaGenMatDouble::operator()(LaIndex(0, 0), I); 00106 } 00107 00108 inline LaRowVectorDouble& LaRowVectorDouble::operator=(const LaGenMatDouble &A) 00109 { 00110 LaGenMatDouble::copy(A); 00111 return *this; 00112 } 00113 00114 inline LaRowVectorDouble& LaRowVectorDouble::operator=(double d) 00115 { 00116 LaGenMatDouble::operator=(d); 00117 return *this; 00118 } 00119 00120 #if 0 00121 inline LaRowVectorDouble& LaRowVectorDouble::copy(const LaGenMatDouble &A) 00122 { 00123 assert(A.size(0) == 1 || A.size(1) == 1); //make sure rhs is a 00124 // a vector. 00125 LaGenMatDouble::copy(A); 00126 return *this; 00127 } 00128 00129 00130 inline LaRowVectorDouble& LaRowVectorDouble::ref(const LaGenMatDouble &A) 00131 { 00132 assert(A.size(0) == 1 || A.size(1) == 1); 00133 LaGenMatDouble::ref(A); 00134 return *this; 00135 } 00136 00137 00138 inline LaRowVectorDouble& LaRowVectorDouble::inject(const LaGenMatDouble &A) 00139 { 00140 assert(A.size(0) == 1 || A.size(1) == 1); 00141 LaGenMatDouble::inject(A); 00142 return *this; 00143 } 00144 00145 #endif 00146 00147 inline int LaRowVectorDouble::inc() const 00148 { 00149 return LaGenMatDouble::inc(1); 00150 } 00151 00152 inline LaIndex LaRowVectorDouble::index() const 00153 { 00154 return LaGenMatDouble::index(1); 00155 } 00156 00157 inline int LaRowVectorDouble::start() const 00158 { 00159 return LaGenMatDouble::start(1); 00160 } 00161 00162 inline int LaRowVectorDouble::end() const 00163 { 00164 return LaGenMatDouble::end(1); 00165 } 00166 00167 #endif 00168 // _LA_ROW_VECTOR_DOUBLE_H_