Lapack.h

Go to the documentation of this file.
00001 //Copyright (c) 2004-2005, Baris Sumengen
00002 //All rights reserved.
00003 //
00004 // CIMPL Matrix Performance Library
00005 //
00006 //Redistribution and use in source and binary
00007 //forms, with or without modification, are
00008 //permitted provided that the following
00009 //conditions are met:
00010 //
00011 //    * No commercial use is allowed. 
00012 //    This software can only be used
00013 //    for non-commercial purposes. This 
00014 //    distribution is mainly intended for
00015 //    academic research and teaching.
00016 //    * Redistributions of source code must
00017 //    retain the above copyright notice, this
00018 //    list of conditions and the following
00019 //    disclaimer.
00020 //    * Redistributions of binary form must
00021 //    mention the above copyright notice, this
00022 //    list of conditions and the following
00023 //    disclaimer in a clearly visible part 
00024 //    in associated product manual, 
00025 //    readme, and web site of the redistributed 
00026 //    software.
00027 //    * Redistributions in binary form must
00028 //    reproduce the above copyright notice,
00029 //    this list of conditions and the
00030 //    following disclaimer in the
00031 //    documentation and/or other materials
00032 //    provided with the distribution.
00033 //    * The name of Baris Sumengen may not be
00034 //    used to endorse or promote products
00035 //    derived from this software without
00036 //    specific prior written permission.
00037 //
00038 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
00039 //HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
00040 //EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
00041 //NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00042 //MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00043 //PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00044 //CONTRIBUTORS BE LIABLE FOR ANY
00045 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00046 //EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00047 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
00048 //OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00049 //DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00050 //HOWEVER CAUSED AND ON ANY THEORY OF
00051 //LIABILITY, WHETHER IN CONTRACT, STRICT
00052 //LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00053 //OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00054 //OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00055 //POSSIBILITY OF SUCH DAMAGE.
00056 
00057 
00058 
00059 #pragma once
00060 #ifndef LAPACK_H
00061 #define LAPACK_H
00062 
00063 
00064 #include "./cimpl.h"
00065 using namespace CIMPL;
00066 
00067 #include <math.h>
00068 #include <string>
00069 
00070 #include <limits>
00071 using std::numeric_limits;
00072 
00073 
00074 
00076 namespace Lapack
00077 {
00078 
00079 //=========================================================
00080 // Linear equations solver
00081 //=========================================================
00082         
00083         // Gesv
00084          Matrix<float> Gesv(Matrix<float>& A, Matrix<float>& B);
00085          Matrix<double> Gesv(Matrix<double>& A, Matrix<double>& B);
00086          Matrix<ComplexFloat> Gesv(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B);
00087          Matrix<ComplexDouble> Gesv(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B);
00088 
00089         //Gesvx
00090         
00091         
00092         //Posv
00093          Matrix<float> Posv(Matrix<float>& A, Matrix<float>& B);
00094          Matrix<double> Posv(Matrix<double>& A, Matrix<double>& B);
00095          Matrix<ComplexFloat> Posv(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B);
00096          Matrix<ComplexDouble> Posv(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B);
00097 
00098         //Posvx
00099 
00100         //Sysv
00101          Matrix<float> Sysv(Matrix<float>& A, Matrix<float>& B);
00102          Matrix<double> Sysv(Matrix<double>& A, Matrix<double>& B);
00103          Matrix<ComplexFloat> Sysv(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B);
00104          Matrix<ComplexDouble> Sysv(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B);
00105 
00106         //Sysvx
00107 
00108 
00109         //Hesv
00110          Matrix<ComplexFloat> Hesv(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B);
00111          Matrix<ComplexDouble> Hesv(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B);
00112 
00113         //Hesvx
00114         
00115 
00116 //=========================================================
00117 // Linear Least Squares problems
00118 //=========================================================
00119 
00120 
00121         // Gels
00122          Matrix<float> Gels(Matrix<float>& A, Matrix<float>& B);
00123          Matrix<double> Gels(Matrix<double>& A, Matrix<double>& B);
00124          Matrix<ComplexFloat> Gels(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B);
00125          Matrix<ComplexDouble> Gels(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B);
00126         
00127         // Gelsy
00128          Matrix<float> Gelsy(Matrix<float>& A, Matrix<float>& B);
00129          Matrix<double> Gelsy(Matrix<double>& A, Matrix<double>& B);
00130          Matrix<ComplexFloat> Gelsy(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B);
00131          Matrix<ComplexDouble> Gelsy(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B);
00132         
00133         // Gelss
00134          Matrix<float> Gelss(Matrix<float>& A, Matrix<float>& B);
00135          Matrix<double> Gelss(Matrix<double>& A, Matrix<double>& B);
00136          Matrix<ComplexFloat> Gelss(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B);
00137          Matrix<ComplexDouble> Gelss(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B);
00138         
00139         // Gelsd
00140          Matrix<float> Gelsd(Matrix<float>& A, Matrix<float>& B);
00141          Matrix<double> Gelsd(Matrix<double>& A, Matrix<double>& B);
00142          Matrix<ComplexFloat> Gelsd(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B);
00143          Matrix<ComplexDouble> Gelsd(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B);
00144 
00145 
00146 
00147 //=========================================================
00148 // Generalized Linear Least Squares problems
00149 //=========================================================
00150 
00151 
00152         // Gglse
00153          Vector<float> Gglse(Matrix<float>& A, Matrix<float>& B, Vector<float>& c, Vector<float>& d);
00154          Vector<double> Gglse(Matrix<double>& A, Matrix<double>& B, Vector<double>& c, Vector<double>& d);
00155          Vector<ComplexFloat> Gglse(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B, Vector<ComplexFloat>& c, Vector<ComplexFloat>& d);
00156          Vector<ComplexDouble> Gglse(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B, Vector<ComplexDouble>& c, Vector<ComplexDouble>& d);
00157 
00158 
00159         // Ggglm
00160          void Ggglm(Matrix<float>& A, Matrix<float>& B, Vector<float>& d, Vector<float>& x, Vector<float>& y);
00161          void Ggglm(Matrix<double>& A, Matrix<double>& B, Vector<double>& d, Vector<double>& x, Vector<double>& y);
00162          void Ggglm(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B, Vector<ComplexFloat>& d, Vector<ComplexFloat>& x, Vector<ComplexFloat>& y);
00163          void Ggglm(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B, Vector<ComplexDouble>& d, Vector<ComplexDouble>& x, Vector<ComplexDouble>& y);
00164 
00165 
00166 
00167 //=========================================================
00168 // Symmetric eigenproblem
00169 //=========================================================
00170 
00171 
00172 
00173         // Syevd
00174          Vector<float> Syevd(Matrix<float>& A);
00175          Vector<float> Syevd(Matrix<float>& A, Matrix<float>& EV);
00176          Vector<double> Syevd(Matrix<double>& A);
00177          Vector<double> Syevd(Matrix<double>& A, Matrix<double>& EV);
00178         // Heevd
00179          Vector<float> Heevd(Matrix<ComplexFloat>& A);
00180          Vector<float> Heevd(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& EV);
00181          Vector<double> Heevd(Matrix<ComplexDouble>& A);
00182          Vector<double> Heevd(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& EV);
00183 
00184 
00185 
00186         // Syevr
00187          Vector<float> Syevr(Matrix<float>& A);
00188          Vector<float> Syevr(Matrix<float>& A, int il, int iu);
00189          Vector<float> Syevr(Matrix<float>& A, Matrix<float>& EV);
00190          Vector<float> Syevr(Matrix<float>& A, Matrix<float>& EV, int il, int iu);
00191          Vector<double> Syevr(Matrix<double>& A);
00192          Vector<double> Syevr(Matrix<double>& A, int il, int iu);
00193          Vector<double> Syevr(Matrix<double>& A, Matrix<double>& EV);
00194          Vector<double> Syevr(Matrix<double>& A, Matrix<double>& EV, int il, int iu);
00195 
00196         // Heevr
00197          Vector<float> Heevr(Matrix<ComplexFloat>& A);
00198          Vector<float> Heevr(Matrix<ComplexFloat>& A, int il, int iu);
00199          Vector<float> Heevr(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& EV);
00200          Vector<float> Heevr(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& EV, int il, int iu);
00201          Vector<double> Heevr(Matrix<ComplexDouble>& A);
00202          Vector<double> Heevr(Matrix<ComplexDouble>& A, int il, int iu);
00203          Vector<double> Heevr(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& EV);
00204          Vector<double> Heevr(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& EV, int il, int iu);
00205 
00206         
00207         
00208         
00209 
00210 
00211 //=========================================================
00212 // Non-Symmetric eigenvalue problem
00213 //=========================================================
00214 
00215 
00216         // Gees
00217          Vector<ComplexFloat> Gees(Matrix<float>& A, Matrix<float>& T);
00218          Vector<ComplexFloat> Gees(Matrix<float>& A, Matrix<float>& T, Matrix<float>& Z);
00219          Vector<ComplexDouble> Gees(Matrix<double>& A, Matrix<double>& T);
00220          Vector<ComplexDouble> Gees(Matrix<double>& A, Matrix<double>& T, Matrix<double>& Z);
00221          Vector<ComplexFloat> Gees(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& T);
00222          Vector<ComplexFloat> Gees(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& T, Matrix<ComplexFloat>& Z);
00223          Vector<ComplexDouble> Gees(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& T);
00224          Vector<ComplexDouble> Gees(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& T, Matrix<ComplexDouble>& Z);
00225         
00226         
00227         
00228         
00229         // Geesx
00230         
00231         
00232         
00233         
00234         
00235         // Geev
00236          Vector<ComplexFloat> Geev(Matrix<float>& A);
00237          Vector<ComplexFloat> Geev(Matrix<float>& A, Matrix<ComplexFloat>& Vl, Matrix<ComplexFloat>& Vr);
00238          Vector<ComplexDouble> Geev(Matrix<double>& A);
00239          Vector<ComplexDouble> Geev(Matrix<double>& A, Matrix<ComplexDouble>& Vl, Matrix<ComplexDouble>& Vr);
00240          Vector<ComplexFloat> Geev(Matrix<ComplexFloat>& A);
00241          Vector<ComplexFloat> Geev(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& Vl, Matrix<ComplexFloat>& Vr);
00242          Vector<ComplexDouble> Geev(Matrix<ComplexDouble>& A);
00243          Vector<ComplexDouble> Geev(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& Vl, Matrix<ComplexDouble>& Vr);
00244         
00245         
00246         
00247         
00248         // Geevx
00249 
00250 
00251 
00252 
00253 
00254 
00255 
00256 
00257 
00258 
00259 //=========================================================
00260 // Singular Value Decomposition (SVD)
00261 //=========================================================
00262 
00263 
00264         // Gesvd
00265         
00266         
00267         
00268         
00269         
00270         // Gesdd
00271          Vector<float> Gesdd(Matrix<float>& A);
00272          Vector<float> Gesdd(Matrix<float>& A, Matrix<float>& U, Matrix<float>& V);
00273          Vector<double> Gesdd(Matrix<double>& A);
00274          Vector<double> Gesdd(Matrix<double>& A, Matrix<double>& U, Matrix<double>& V);
00275          Vector<float> Gesdd(Matrix<ComplexFloat>& A);
00276          Vector<float> Gesdd(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& U, Matrix<ComplexFloat>& V);
00277          Vector<double> Gesdd(Matrix<ComplexDouble>& A);
00278          Vector<double> Gesdd(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& U, Matrix<ComplexDouble>& V);
00279 
00280 
00281 
00282 
00283 
00284 
00285 //=========================================================
00286 // Generalized Symmetric Definite eigenproblem
00287 //=========================================================
00288 
00289 
00290         // Sygv
00291         
00292         
00293         
00294         
00295         // Sygvx
00296         
00297         
00298         
00299         
00300         
00301         // Sygvd,Hegvd
00302          Vector<float> Sygvd(Matrix<float>& A, Matrix<float>& B, int ptype);
00303          Vector<float> Sygvd(Matrix<float>& A, Matrix<float>& B, Matrix<float>& EV, int ptype);
00304          Vector<double> Sygvd(Matrix<double>& A, Matrix<double>& B, int ptype);
00305          Vector<double> Sygvd(Matrix<double>& A, Matrix<double>& B, Matrix<double>& EV, int ptype);
00306          
00307          Vector<float> Hegvd(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B, int ptype);
00308          Vector<float> Hegvd(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B, Matrix<ComplexFloat>& EV, int ptype);
00309          Vector<double> Hegvd(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B, int ptype);
00310          Vector<double> Hegvd(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B, Matrix<ComplexDouble>& EV, int ptype);
00311 
00312 
00313 
00314 
00315 
00316 
00317 
00318 
00319 
00320 //=========================================================
00321 // Generalized Non-Symmetric eigenvalue problem
00322 //=========================================================
00323 
00324 
00325         // Gges
00326          void Gges(Matrix<float>& A, Matrix<float>& B, Vector<ComplexFloat>& alpha, Vector<float>& beta, Matrix<float>& S, Matrix<float>& T);
00327          void Gges(Matrix<float>& A, Matrix<float>& B, Vector<ComplexFloat>& alpha, Vector<float>& beta, Matrix<float>& S, Matrix<float>& T, Matrix<float>& Vl, Matrix<float>& Vr);
00328          void Gges(Matrix<double>& A, Matrix<double>& B, Vector<ComplexDouble>& alpha, Vector<double>& beta, Matrix<double>& S, Matrix<double>& T);
00329          void Gges(Matrix<double>& A, Matrix<double>& B, Vector<ComplexDouble>& alpha, Vector<double>& beta, Matrix<double>& S, Matrix<double>& T, Matrix<double>& Vl, Matrix<double>& Vr);
00330          void Gges(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B, Vector<ComplexFloat>& alpha, Vector<ComplexFloat>& beta, Matrix<ComplexFloat>& S, Matrix<ComplexFloat>& T);
00331          void Gges(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B, Vector<ComplexFloat>& alpha, Vector<ComplexFloat>& beta, Matrix<ComplexFloat>& S, Matrix<ComplexFloat>& T, Matrix<ComplexFloat>& Vl, Matrix<ComplexFloat>& Vr);
00332          void Gges(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B, Vector<ComplexDouble>& alpha, Vector<ComplexDouble>& beta, Matrix<ComplexDouble>& S, Matrix<ComplexDouble>& T);
00333          void Gges(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B, Vector<ComplexDouble>& alpha, Vector<ComplexDouble>& beta, Matrix<ComplexDouble>& S, Matrix<ComplexDouble>& T, Matrix<ComplexDouble>& Vl, Matrix<ComplexDouble>& Vr);
00334         
00335         
00336 
00337         // Ggesx
00338         
00339         
00340         
00341         
00342 
00343         // Ggev
00344         
00345          void Ggev(Matrix<float>& A, Matrix<float>& B, Vector<ComplexFloat>& alpha, Vector<float>& beta);
00346          void Ggev(Matrix<float>& A, Matrix<float>& B, Vector<ComplexFloat>& alpha, Vector<float>& beta, Matrix<ComplexFloat>& Vl, Matrix<ComplexFloat>& Vr);
00347          void Ggev(Matrix<double>& A, Matrix<double>& B, Vector<ComplexDouble>& alpha, Vector<double>& beta);
00348          void Ggev(Matrix<double>& A, Matrix<double>& B, Vector<ComplexDouble>& alpha, Vector<double>& beta, Matrix<ComplexDouble>& Vl, Matrix<ComplexDouble>& Vr);
00349          void Ggev(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B, Vector<ComplexFloat>& alpha, Vector<ComplexFloat>& beta);
00350          void Ggev(Matrix<ComplexFloat>& A, Matrix<ComplexFloat>& B, Vector<ComplexFloat>& alpha, Vector<ComplexFloat>& beta, Matrix<ComplexFloat>& Vl, Matrix<ComplexFloat>& Vr);
00351          void Ggev(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B, Vector<ComplexDouble>& alpha, Vector<ComplexDouble>& beta);
00352          void Ggev(Matrix<ComplexDouble>& A, Matrix<ComplexDouble>& B, Vector<ComplexDouble>& alpha, Vector<ComplexDouble>& beta, Matrix<ComplexDouble>& Vl, Matrix<ComplexDouble>& Vr);
00353         
00354         
00355         
00356 
00357         // Ggevx
00358 
00359 
00360 
00361 
00362 
00363 
00364 //=========================================================
00365 // Generalized Singular Value Decomposition (SVD)
00366 //=========================================================
00367 
00368 
00369 
00370 
00371         // Ggsvd
00372 
00373                 // Later......
00374 
00375 
00376 
00377 
00378 
00379 
00380 
00381 
00382 
00383 
00384 };
00385 
00386 
00387 
00388 
00389 
00390 
00391 #endif
00392 
00393 
00394 
00395 
00396 

Generated on Thu Jan 20 08:43:42 2005 for CIMPL by  doxygen 1.3.9.1