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_COL_VECTOR_DOUBLE_H_ 00029 #define _LA_COL_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 LaColVectorDouble: public LaGenMatDouble 00047 { 00048 public: 00049 00050 inline LaColVectorDouble(); 00051 inline LaColVectorDouble(int); 00052 inline LaColVectorDouble(double*, int); 00053 inline LaColVectorDouble(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 LaColVectorDouble operator()(const LaIndex&); 00065 00066 inline LaColVectorDouble& operator=(const LaGenMatDouble &A); 00067 inline LaColVectorDouble& operator=(double d); 00068 00069 }; 00070 00071 00072 inline LaColVectorDouble::LaColVectorDouble() : LaGenMatDouble(0, 1) {} 00073 inline LaColVectorDouble::LaColVectorDouble(int i) : LaGenMatDouble(i, 1) {} 00074 00075 00076 inline LaColVectorDouble::LaColVectorDouble(double *d, int m) : 00077 LaGenMatDouble(d, m, 1) {} 00078 00079 00080 inline LaColVectorDouble::LaColVectorDouble(const LaGenMatDouble& G) : 00081 LaGenMatDouble(G) 00082 { 00083 assert(G.size(1) == 1); 00084 00085 } 00086 00087 //note that vectors can be either stored columnwise, or row-wise 00088 00089 // this will handle the 0x0 case as well. 00090 00091 inline int LaColVectorDouble::size() const 00092 { 00093 return LaGenMatDouble::size(0) * LaGenMatDouble::size(1); 00094 } 00095 00096 inline double& LaColVectorDouble::operator()(int i) 00097 { 00098 return LaGenMatDouble::operator()(i, 0); 00099 } 00100 00101 inline const double& LaColVectorDouble::operator()(int i) const 00102 { 00103 return LaGenMatDouble::operator()(i, 0); 00104 } 00105 00106 inline LaColVectorDouble LaColVectorDouble::operator()(const LaIndex& I) 00107 { 00108 return LaGenMatDouble::operator()(I, LaIndex(0, 0)); 00109 } 00110 00111 inline LaColVectorDouble& LaColVectorDouble::operator=(const LaGenMatDouble &A) 00112 { 00113 LaGenMatDouble::copy(A); 00114 return *this; 00115 } 00116 00117 inline LaColVectorDouble& LaColVectorDouble::operator=(double d) 00118 { 00119 LaGenMatDouble::operator=(d); 00120 return *this; 00121 } 00122 00123 #if 0 00124 inline LaColVectorDouble& LaColVectorDouble::copy(const LaGenMatDouble &A) 00125 { 00126 assert(A.size(1) == 1); //make sure A is a column vector. 00127 LaGenMatDouble::copy(A); 00128 return *this; 00129 } 00130 00131 00132 inline LaColVectorDouble& LaColVectorDouble::ref(const LaGenMatDouble &A) 00133 { 00134 assert(A.size(0) == 1 || A.size(1) == 1); 00135 LaGenMatDouble::ref(A); 00136 return *this; 00137 } 00138 00139 inline LaColVectorDouble& LaColVectorDouble::inject(const LaGenMatDouble &A) 00140 { 00141 assert(A.size(0) == 1 || A.size(1) == 1); 00142 LaGenMatDouble::inject(A); 00143 return *this; 00144 } 00145 #endif 00146 00147 00148 inline int LaColVectorDouble::inc() const 00149 { 00150 return LaGenMatDouble::inc(0); 00151 } 00152 00153 inline LaIndex LaColVectorDouble::index() const 00154 { 00155 return LaGenMatDouble::index(0); 00156 } 00157 00158 inline int LaColVectorDouble::start() const 00159 { 00160 return LaGenMatDouble::start(0); 00161 } 00162 00163 inline int LaColVectorDouble::end() const 00164 { 00165 return LaGenMatDouble::end(0); 00166 } 00167 00168 #endif 00169 // _LA_COL_VECTOR_DOUBLE_H_