toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Toon-members] TooN lapack.h


From: Tom Drummond
Subject: [Toon-members] TooN lapack.h
Date: Fri, 17 Apr 2009 03:51:29 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Tom Drummond <twd20>    09/04/17 03:51:29

Modified files:
        .              : lapack.h 

Log message:
        added both precisions for svd and overloaded c functions

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/lapack.h?cvsroot=toon&r1=1.12&r2=1.13

Patches:
Index: lapack.h
===================================================================
RCS file: /cvsroot/toon/TooN/lapack.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- lapack.h    14 Apr 2009 14:56:11 -0000      1.12
+++ lapack.h    17 Apr 2009 03:51:28 -0000      1.13
@@ -33,13 +33,11 @@
 // LAPACK and BLAS routines
 namespace TooN {
 
-extern "C" {
+       extern "C" {
   // LU decomoposition of a general matrix
   void dgetrf_(int* M, int *N, double* A, int* lda, int* IPIV, int* INFO);
   void sgetrf_(int* M, int *N, float* A, int* lda, int* IPIV, int* INFO);
 
-
-
   // generate inverse of a matrix given its LU decomposition
   void dgetri_(int* N, double* A, int* lda, int* IPIV, double* WORK, int* 
lwork, int* INFO);
   void sgetri_(int* N, float* A, int* lda, int* IPIV, float* WORK, int* lwork, 
int* INFO);
@@ -49,11 +47,15 @@
   void strsm_(char* SIDE, char* UPLO, char* TRANSA, char* DIAG, int* M, int* 
N, float* alpha, float* A, int* lda, float* B, int* ldb);
   
 
-  // SVD of a general matrix of doubles
+               // SVD of a general matrix
   void dgesvd_(const char* JOBU, const char* JOBVT, int* M, int *N, double* A, 
int* lda,
               double* S, double *U, int* ldu, double* VT, int* ldvt,
               double* WORK, int* lwork, int* INFO);
 
+               void sgesvd_(const char* JOBU, const char* JOBVT, int* M, int 
*N, float* A, int* lda,
+                                        float* S, float *U, int* ldu, float* 
VT, int* ldvt,
+                                        float* WORK, int* lwork, int* INFO);
+
     // Eigen decomposition of a symmetric matrix
     void dsyev_(const char* JOBZ, const char* UPLO, int* N, double* A, int* 
lda, double* W, double* WORK, int* LWORK, int* INFO);
     void ssyev_(const char* JOBZ, const char* UPLO, int* N, float* A, int* 
lda, float* W, float* WORK, int* LWORK, int* INFO);
@@ -69,63 +71,82 @@
     // Cholesky inverse given decomposition
     void dpotri_(const char* UPLO, const int* N, double* A, const int* LDA, 
int* INFO);
     void spotri_(const char* UPLO, const int* N, float* A, const int* LDA, 
int* INFO);
-}
+       }
 
-void getrf_(int* M, int *N, float* A, int* lda, int* IPIV, int* INFO){
+
+       
//////////////////////////////////////////////////////////////////////////////////
+       // C++ overloaded functions to access single and double precision 
automatically //
+       
//////////////////////////////////////////////////////////////////////////////////
+
+       void getrf_(int* M, int *N, float* A, int* lda, int* IPIV, int* INFO){
   sgetrf_(M, N, A, lda, IPIV, INFO);
-}
+       }
 
-void getrf_(int* M, int *N, double* A, int* lda, int* IPIV, int* INFO){
+       void getrf_(int* M, int *N, double* A, int* lda, int* IPIV, int* INFO){
   dgetrf_(M, N, A, lda, IPIV, INFO);
-}
+       }
 
-inline void trsm_(const char* SIDE, const char* UPLO, const char* TRANSA, 
const char* DIAG, int* M, int* N, float* alpha, float* A, int* lda, float* B, 
int* ldb) { 
+       inline void trsm_(const char* SIDE, const char* UPLO, const char* 
TRANSA, const char* DIAG, int* M, int* N, float* alpha, float* A, int* lda, 
float* B, int* ldb) { 
        strsm_(const_cast<char*>(SIDE), const_cast<char*>(UPLO), 
const_cast<char*>(TRANSA), const_cast<char*>(DIAG), M, N, alpha, A, lda, B, 
ldb);
-}
+       }
 
-inline void trsm_(const char* SIDE, const char* UPLO, const char* TRANSA, 
const char* DIAG, int* M, int* N, double* alpha, double* A, int* lda, double* 
B, int* ldb) {
+       inline void trsm_(const char* SIDE, const char* UPLO, const char* 
TRANSA, const char* DIAG, int* M, int* N, double* alpha, double* A, int* lda, 
double* B, int* ldb) {
        dtrsm_(const_cast<char*>(SIDE), const_cast<char*>(UPLO), 
const_cast<char*>(TRANSA), const_cast<char*>(DIAG), M, N, alpha, A, lda, B, 
ldb);
-}
+       }
 
-void getri_(int* N, double* A, int* lda, int* IPIV, double* WORK, int* lwork, 
int* INFO){
+       void getri_(int* N, double* A, int* lda, int* IPIV, double* WORK, int* 
lwork, int* INFO){
        dgetri_(N, A, lda, IPIV, WORK, lwork, INFO);
-}
+       }
 
-void getri_(int* N, float* A, int* lda, int* IPIV, float* WORK, int* lwork, 
int* INFO){
+       void getri_(int* N, float* A, int* lda, int* IPIV, float* WORK, int* 
lwork, int* INFO){
        sgetri_(N, A, lda, IPIV, WORK, lwork, INFO);
-}
+       }
 
-void potrf_(const char * UPLO, const int* N, double* A, const int* LDA, int* 
INFO){
+       void potrf_(const char * UPLO, const int* N, double* A, const int* LDA, 
int* INFO){
        dpotrf_(UPLO, N, A, LDA, INFO);
-}
+       }
 
-void potrf_(const char * UPLO, const int* N, float* A, const int* LDA, int* 
INFO){
+       void potrf_(const char * UPLO, const int* N, float* A, const int* LDA, 
int* INFO){
        spotrf_(UPLO, N, A, LDA, INFO);
-}
-// Cholesky solve AX=B given decomposition
-void potrs_(const char* UPLO, const int* N, const int* NRHS, const double* A, 
const int* LDA, double* B, const int* LDB, int* INFO){
+       }
+
+       // SVD
+       void gesvd_(const char* JOBU, const char* JOBVT, int* M, int *N, 
double* A, int* lda,
+                               double* S, double *U, int* ldu, double* VT, 
int* ldvt,
+                               double* WORK, int* lwork, int* INFO){
+               dgesvd_(JOBU, JOBVT, M, N, A, lda, S, U, ldu, VT, ldvt, WORK, 
lwork, INFO);
+       }
+
+       void gesvd_(const char* JOBU, const char* JOBVT, int* M, int *N, float* 
A, int* lda,
+                                        float* S, float *U, int* ldu, float* 
VT, int* ldvt,
+                                        float* WORK, int* lwork, int* INFO){
+               sgesvd_(JOBU, JOBVT, M, N, A, lda, S, U, ldu, VT, ldvt, WORK, 
lwork, INFO);
+       }
+
+       // Cholesky solve AX=B given decomposition
+       void potrs_(const char* UPLO, const int* N, const int* NRHS, const 
double* A, const int* LDA, double* B, const int* LDB, int* INFO){
        dpotrs_(UPLO, N, NRHS, A, LDA, B, LDB, INFO);
-}
+       }
 
-void potrs_(const char* UPLO, const int* N, const int* NRHS, const float* A, 
const int* LDA, float* B, const int* LDB, int* INFO){
+       void potrs_(const char* UPLO, const int* N, const int* NRHS, const 
float* A, const int* LDA, float* B, const int* LDB, int* INFO){
        spotrs_(UPLO, N, NRHS, A, LDA, B, LDB, INFO);
-}
+       }
 
-// Cholesky inverse given decomposition
-void potri_(const char* UPLO, const int* N, double* A, const int* LDA, int* 
INFO){
+       // Cholesky inverse given decomposition
+       void potri_(const char* UPLO, const int* N, double* A, const int* LDA, 
int* INFO){
        dpotri_(UPLO, N, A, LDA, INFO);
-}
+       }
 
-void potri_(const char* UPLO, const int* N, float* A, const int* LDA, int* 
INFO){
+       void potri_(const char* UPLO, const int* N, float* A, const int* LDA, 
int* INFO){
        spotri_(UPLO, N, A, LDA, INFO);
-}
+       }
 
-void syev_(const char* JOBZ, const char* UPLO, int* N, double* A, int* lda, 
double* W, double* WORK, int* LWORK, int* INFO){
+       void syev_(const char* JOBZ, const char* UPLO, int* N, double* A, int* 
lda, double* W, double* WORK, int* LWORK, int* INFO){
        dsyev_(JOBZ, UPLO, N, A, lda, W, WORK, LWORK, INFO);
-}
-void syev_(const char* JOBZ, const char* UPLO, int* N, float* A, int* lda, 
float* W, float* WORK, int* LWORK, int* INFO){
+       }
+       void syev_(const char* JOBZ, const char* UPLO, int* N, float* A, int* 
lda, float* W, float* WORK, int* LWORK, int* INFO){
        ssyev_(JOBZ, UPLO, N, A, lda, W, WORK, LWORK, INFO);
-}
+       }
 
 }
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]