![]() |
GURLS++
2.0.00
C++ Implementation of GURLS Matlab Toolbox
|
00001 /* 00002 * The GURLS Package in C++ 00003 * 00004 * Copyright (C) 2011-1013, IIT@MIT Lab 00005 * All rights reserved. 00006 * 00007 * author: M. Santoro 00008 * email: msantoro@mit.edu 00009 * website: http://cbcl.mit.edu/IIT@MIT/IIT@MIT.html 00010 * 00011 * Redistribution and use in source and binary forms, with or without 00012 * modification, are permitted provided that the following conditions 00013 * are met: 00014 * 00015 * * Redistributions of source code must retain the above 00016 * copyright notice, this list of conditions and the following 00017 * disclaimer. 00018 * * Redistributions in binary form must reproduce the above 00019 * copyright notice, this list of conditions and the following 00020 * disclaimer in the documentation and/or other materials 00021 * provided with the distribution. 00022 * * Neither the name(s) of the copyright holders nor the names 00023 * of its contributors or of the Massacusetts Institute of 00024 * Technology or of the Italian Institute of Technology may be 00025 * used to endorse or promote products derived from this software 00026 * without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00029 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00030 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00031 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00032 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00033 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00034 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00035 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00036 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00037 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00038 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00039 * POSSIBILITY OF SUCH DAMAGE. 00040 */ 00041 00042 00043 #ifndef BLAS_LAPACK_HPP 00044 #define BLAS_LAPACK_HPP 00045 00053 namespace gurls { 00054 00058 template<typename T> 00059 int gelss( int *m, int *n, int* nrhs, T *a, int *lda, T* b, int *ldb, T *s, T *rcond, int *rank, T *work, int *lwork, int *info); 00060 00064 template<typename T> 00065 void swap( int n, T *x, int incx, T *y, int incy); 00066 00070 template<typename T> 00071 int gesvd_(char *jobu, char *jobvt, int *m, int *n, T *a, int *lda, T *s, T *u, int *ldu, T *vt, int *ldvt, T *work, int *lwork, int *info); 00072 00076 template<typename T> 00077 void scal(const int N, const T alpha, T *X, const int incX); 00078 00082 template<typename T> 00083 int potrf_(char *UPLO, int *n, T *a, int *lda , int *info); 00084 00088 template <typename T> 00089 void axpy(const int N, const T alpha, const T *X, const int incX, T *Y, const int incY); 00090 00094 template <typename T> 00095 T dot(const int N, const T *X, const int incX, const T *Y, const int incY); 00096 00100 template <typename T> 00101 void trsm(const CBLAS_SIDE Side, const CBLAS_UPLO Uplo, const CBLAS_TRANSPOSE TransA, const CBLAS_DIAG Diag, 00102 const int M, const int N, const T alpha, const T *A, const int lda, T *B, const int ldb); 00103 00107 template<typename T> 00108 T nrm2(const int N, const T* X, const int incX); 00109 00113 template<typename T> 00114 void gemv(const CBLAS_TRANSPOSE TransA, 00115 const int M, const int N, const T alpha, const T *A, const int lda, 00116 const T *X, const int incX, 00117 const T beta, T *Y, const int incY); 00118 00122 template<typename T> 00123 void syev( char* jobz, char* uplo, int* n, T* a, int* lda, T* w, T* work, int* lwork, int* info); 00124 00125 00129 template<typename T> 00130 void gemm(const CBLAS_TRANSPOSE TransA, const CBLAS_TRANSPOSE TransB, 00131 const int M, const int N, const int K, const T alpha, const T *A, const int lda, 00132 const T *B, const int ldb, 00133 const T beta, T *C, const int ldc); 00134 00138 template<typename T> 00139 void geqp3( int *m, int *n, T *A, int *lda, int *jpvt, T *tau, T *work, int *lwork, int *info); 00140 00144 template<typename T> 00145 void orgqr(int *m, int *n, int *k, T *a, int *lda, T *tau, T *work, int *lwork, int *info); 00146 00147 } 00148 00149 #endif