Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Tsqr_Lapack.hpp
00001 //@HEADER
00002 // ************************************************************************
00003 // 
00004 //          Kokkos: Node API and Parallel Node Kernels
00005 //              Copyright (2009) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ************************************************************************
00027 //@HEADER
00028 
00029 #ifndef __TSQR_Tsqr_Lapack_hpp
00030 #define __TSQR_Tsqr_Lapack_hpp
00031 
00032 #include <Tsqr_ConfigDefs.hpp>
00033 #include <Teuchos_ScalarTraits.hpp>
00034 
00035 namespace TSQR {
00036 
00037   template<class Ordinal, class Scalar>
00038   class LAPACK {
00039   public:
00040     typedef Ordinal ordinal_type;
00041     typedef Scalar scalar_type;
00042     typedef Teuchos::ScalarTraits<Scalar> STS;
00045     typedef typename STS::magnitudeType magnitude_type;
00046 
00047     LAPACK () {}
00048 
00055     static bool QR_produces_R_factor_with_nonnegative_diagonal();
00056 
00061     void 
00062     LARFP (const Ordinal n, 
00063      Scalar& alpha, 
00064      Scalar x[], 
00065      const Ordinal incx, 
00066      Scalar& tau);
00067 
00072     void
00073     GEQRF  (const Ordinal m,
00074       const Ordinal n, 
00075       Scalar A[],
00076       const Ordinal lda,
00077       Scalar tau[],
00078       Scalar work[],
00079       const int lwork,
00080       int* const INFO);
00081 
00086     void 
00087     GEQR2 (const Ordinal m, 
00088      const Ordinal n, 
00089      Scalar A[],
00090      const Ordinal lda, 
00091      Scalar tau[],
00092      Scalar work[],
00093      int* const INFO);
00094 
00095     void
00096     ORM2R (const char* const side,
00097      const char* const trans,
00098      const Ordinal m,
00099      const Ordinal n,
00100      const Ordinal k,
00101      const Scalar A[],
00102      const Ordinal lda,
00103      const Scalar tau[],
00104      Scalar C[],
00105      const Ordinal ldc,
00106      Scalar work[],
00107      int* const info);
00108 
00109     void
00110     ORMQR (const char* const side,
00111      const char* const trans,
00112      const Ordinal m,
00113      const Ordinal n,
00114      const Ordinal k,
00115      const Scalar A[],
00116      const Ordinal lda,
00117      const Scalar tau[],
00118      Scalar C[],
00119      const Ordinal ldc,
00120      Scalar work[],
00121      const int lwork,
00122      int* const INFO);
00123 
00124     void
00125     ORGQR (const Ordinal m,
00126      const Ordinal n,
00127      const Ordinal k,
00128      Scalar A[],
00129      const Ordinal lda,
00130      Scalar tau[],
00131      Scalar work[],
00132      const int lwork,
00133      int* const INFO);
00134 
00135     void
00136     POTRF (const char* const uplo,
00137      const Ordinal n,
00138      Scalar A[],
00139      const Ordinal lda,
00140      int* const INFO);
00141 
00142     void
00143     POTRS (const char* const uplo,
00144      const Ordinal n,
00145      const Ordinal nrhs,
00146      const Scalar A[],
00147      const Ordinal lda,
00148      Scalar B[],
00149      const Ordinal ldb,
00150      int* const INFO);
00151 
00152     void
00153     POTRI (const char* const uplo, 
00154      const Ordinal n, 
00155      Scalar A[], 
00156      const Ordinal lda, 
00157      int* const INFO);
00158 
00159     void
00160     LARNV (const int idist, 
00161      int iseed[],
00162      const Ordinal n,
00163      Scalar x[]);
00164 
00165     void 
00166     GESVD (const char* const jobu,
00167      const char* const jobvt,
00168      const Ordinal m,
00169      const Ordinal n,
00170      Scalar A[],
00171      const Ordinal lda,
00172      magnitude_type s[],
00173      Scalar U[],
00174      const Ordinal ldu,
00175      Scalar VT[],
00176      const Ordinal ldvt,
00177      Scalar work[],
00178      const Ordinal lwork,
00179      magnitude_type rwork[],
00180      int* const INFO);
00181 
00182   private:
00183     LAPACK (const LAPACK&);
00184     LAPACK& operator= (const LAPACK&);
00185   };
00186 
00187 } // namespace TSQR
00188 
00189 #endif // __TSQR_Tsqr_Lapack_hpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends