lacvd.h

Go to the documentation of this file.
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 { return LaGenMatDouble::size(0)*LaGenMatDouble::size(1); }
00093 
00094 inline double& LaColVectorDouble::operator()(int i)
00095 { 
00096     return LaGenMatDouble::operator()(i,0);
00097 }
00098 
00099 inline const double& LaColVectorDouble::operator()(int i) const
00100 { 
00101     return LaGenMatDouble::operator()(i,0);
00102 }
00103 
00104 inline LaColVectorDouble LaColVectorDouble::operator()(const LaIndex& I)
00105 { 
00106     return LaGenMatDouble::operator()(I,LaIndex(0,0)); 
00107 }
00108 
00109 inline LaColVectorDouble& LaColVectorDouble::operator=(const LaGenMatDouble &A)
00110 {
00111     LaGenMatDouble::copy(A);
00112     return *this;
00113 }
00114 
00115 inline LaColVectorDouble& LaColVectorDouble::operator=(double d)
00116 {
00117     LaGenMatDouble::operator=(d);
00118     return *this;
00119 }
00120 
00121 #if 0
00122 inline LaColVectorDouble& LaColVectorDouble::copy(const LaGenMatDouble &A)
00123 {
00124     assert(A.size(1) == 1);   //make sure A is a column vector.
00125     LaGenMatDouble::copy(A);
00126     return *this;
00127 }
00128 
00129 
00130 inline LaColVectorDouble& LaColVectorDouble::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 inline LaColVectorDouble& LaColVectorDouble::inject(const LaGenMatDouble &A)
00138 {
00139     assert(A.size(0) == 1 || A.size(1) == 1);
00140     LaGenMatDouble::inject(A);
00141     return *this;
00142 }
00143 #endif
00144    
00145 
00146 inline int LaColVectorDouble::inc() const
00147 {
00148     return LaGenMatDouble::inc(0);
00149 }
00150 
00151 inline LaIndex LaColVectorDouble::index() const
00152 {
00153     return LaGenMatDouble::index(0);
00154 }
00155 
00156 inline int LaColVectorDouble::start() const
00157 {
00158     return LaGenMatDouble::start(0);
00159 }
00160 
00161 inline int LaColVectorDouble::end() const
00162 {
00163     return LaGenMatDouble::end(0);
00164 }
00165 
00166 #endif 
00167     // _LA_COL_VECTOR_DOUBLE_H_

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