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 00033 #ifndef _BLAS1_PP_H_ 00034 #define _BLAS1_PP_H_ 00035 00036 #include "blas1.h" 00037 #include "lafnames.h" 00038 #include "arch.h" // needed for DLLIMPORT 00039 #include LA_VECTOR_DOUBLE_H 00040 #ifdef LA_COMPLEX_SUPPORT 00041 # include LA_VECTOR_COMPLEX_H 00042 #endif 00043 #include <cmath> 00044 00045 #ifdef LA_COMPLEX_SUPPORT 00046 00051 DLLIMPORT 00052 void Blas_Add_Mult(LaVectorComplex &dy, COMPLEX da, const LaVectorComplex &dx); 00053 00062 DLLIMPORT 00063 void Blas_Mult(LaVectorComplex &dy, COMPLEX da, const LaVectorComplex &dx); 00064 00077 DLLIMPORT 00078 COMPLEX Blas_U_Dot_Prod(const LaVectorComplex &cx, const LaVectorComplex &cy); 00079 00087 DLLIMPORT 00088 COMPLEX Blas_H_Dot_Prod(const LaVectorComplex &cx, const LaVectorComplex &cy); 00089 00091 DLLIMPORT 00092 void Blas_Copy(const LaVectorComplex &dx, LaVectorComplex &dy); 00093 00095 DLLIMPORT 00096 void Blas_Scale(COMPLEX da, LaVectorComplex &dx); 00097 00099 DLLIMPORT 00100 void Blas_Swap(LaVectorComplex &dx, LaVectorComplex &dy); 00102 #endif // LA_COMPLEX_SUPPORT 00103 00104 00105 00106 00107 00113 DLLIMPORT 00114 void Blas_Add_Mult(LaVectorDouble &dy, double da, const LaVectorDouble &dx); 00115 00124 DLLIMPORT 00125 void Blas_Mult(LaVectorDouble &dy, double da, const LaVectorDouble &dx); 00126 00131 DLLIMPORT 00132 double Blas_Dot_Prod(const LaVectorDouble &dx, const LaVectorDouble &dy); 00133 00138 DLLIMPORT 00139 void Blas_Apply_Plane_Rot(LaVectorDouble &dx, LaVectorDouble &dy, 00140 double &c, double &s); 00141 00146 DLLIMPORT 00147 void Blas_Gen_Plane_Rot(double &da, double &db, double &c, double &s); 00148 00150 DLLIMPORT 00151 void Blas_Copy(const LaVectorDouble &dx, LaVectorDouble &dy); 00152 00154 DLLIMPORT 00155 void Blas_Scale(double da, LaVectorDouble &dx); 00156 00158 DLLIMPORT 00159 void Blas_Swap(LaVectorDouble &dx, LaVectorDouble &dy); 00160 00162 00163 00164 00167 00168 #ifdef LA_COMPLEX_SUPPORT 00169 00175 DLLIMPORT 00176 double Blas_Norm1(const LaVectorComplex &dx); 00177 00189 DLLIMPORT 00190 double Blas_Norm2(const LaVectorComplex &dx); 00191 00194 DLLIMPORT 00195 int Blas_Index_Max(const LaVectorComplex &dx); 00196 00204 inline double Blas_Norm_Inf(const LaVectorComplex &x) 00205 { 00206 integer index = Blas_Index_Max(x); 00207 return la::abs(LaComplex(x(index))); 00208 } 00209 #endif // LA_COMPLEX_SUPPORT 00210 00217 DLLIMPORT 00218 double Blas_Norm1(const LaVectorDouble &dx); 00219 00231 DLLIMPORT 00232 double Blas_Norm2(const LaVectorDouble &dx); 00233 00236 DLLIMPORT 00237 int Blas_Index_Max(const LaVectorDouble &dx); 00238 00246 inline double Blas_Norm_Inf(const LaVectorDouble &x) 00247 { 00248 integer index = Blas_Index_Max(x); 00249 return std::fabs(x(index)); 00250 } 00251 00252 #ifndef DOXYGEN_IGNORE 00253 # ifdef LA_COMPLEX_SUPPORT 00254 00255 inline double Norm_Inf(const LaVectorComplex &A) 00256 { 00257 return Blas_Norm_Inf(A); 00258 } 00259 # endif // LA_COMPLEX_SUPPORT 00260 00261 inline double Norm_Inf(const LaVectorDouble &A) 00262 { 00263 return Blas_Norm_Inf(A); 00264 } 00265 #endif // DOXYGEN_IGNORE 00266 00268 00269 00270 #endif 00271 /* _BLAS1_PP_H_ */