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 (2008) Sandia Corporation
00006 // 
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00008 // the U.S. Government retains certain rights in this software.
00009 // 
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00038 // 
00039 // ************************************************************************
00040 //@HEADER
00041 
00042 #ifndef __TSQR_Tsqr_Lapack_hpp
00043 #define __TSQR_Tsqr_Lapack_hpp
00044 
00045 #include <Tsqr_ConfigDefs.hpp>
00046 #include <Teuchos_ScalarTraits.hpp>
00047 
00048 namespace TSQR {
00049 
00050   template<class Ordinal, class Scalar>
00051   class LAPACK {
00052   public:
00053     typedef Ordinal ordinal_type;
00054     typedef Scalar scalar_type;
00055     typedef Teuchos::ScalarTraits<Scalar> STS;
00058     typedef typename STS::magnitudeType magnitude_type;
00059 
00060     LAPACK () {}
00061 
00068     static bool QR_produces_R_factor_with_nonnegative_diagonal();
00069 
00074     void 
00075     LARFP (const Ordinal n, 
00076      Scalar& alpha, 
00077      Scalar x[], 
00078      const Ordinal incx, 
00079      Scalar& tau);
00080 
00085     void
00086     GEQRF  (const Ordinal m,
00087       const Ordinal n, 
00088       Scalar A[],
00089       const Ordinal lda,
00090       Scalar tau[],
00091       Scalar work[],
00092       const int lwork,
00093       int* const INFO);
00094 
00099     void 
00100     GEQR2 (const Ordinal m, 
00101      const Ordinal n, 
00102      Scalar A[],
00103      const Ordinal lda, 
00104      Scalar tau[],
00105      Scalar work[],
00106      int* const INFO);
00107 
00108     void
00109     ORM2R (const char* const side,
00110      const char* const trans,
00111      const Ordinal m,
00112      const Ordinal n,
00113      const Ordinal k,
00114      const Scalar A[],
00115      const Ordinal lda,
00116      const Scalar tau[],
00117      Scalar C[],
00118      const Ordinal ldc,
00119      Scalar work[],
00120      int* const info);
00121 
00122     void
00123     ORMQR (const char* const side,
00124      const char* const trans,
00125      const Ordinal m,
00126      const Ordinal n,
00127      const Ordinal k,
00128      const Scalar A[],
00129      const Ordinal lda,
00130      const Scalar tau[],
00131      Scalar C[],
00132      const Ordinal ldc,
00133      Scalar work[],
00134      const int lwork,
00135      int* const INFO);
00136 
00137     void
00138     ORGQR (const Ordinal m,
00139      const Ordinal n,
00140      const Ordinal k,
00141      Scalar A[],
00142      const Ordinal lda,
00143      Scalar tau[],
00144      Scalar work[],
00145      const int lwork,
00146      int* const INFO);
00147 
00148     void
00149     POTRF (const char* const uplo,
00150      const Ordinal n,
00151      Scalar A[],
00152      const Ordinal lda,
00153      int* const INFO);
00154 
00155     void
00156     POTRS (const char* const uplo,
00157      const Ordinal n,
00158      const Ordinal nrhs,
00159      const Scalar A[],
00160      const Ordinal lda,
00161      Scalar B[],
00162      const Ordinal ldb,
00163      int* const INFO);
00164 
00165     void
00166     POTRI (const char* const uplo, 
00167      const Ordinal n, 
00168      Scalar A[], 
00169      const Ordinal lda, 
00170      int* const INFO);
00171 
00172     void
00173     LARNV (const int idist, 
00174      int iseed[],
00175      const Ordinal n,
00176      Scalar x[]);
00177 
00178     void 
00179     GESVD (const char* const jobu,
00180      const char* const jobvt,
00181      const Ordinal m,
00182      const Ordinal n,
00183      Scalar A[],
00184      const Ordinal lda,
00185      magnitude_type s[],
00186      Scalar U[],
00187      const Ordinal ldu,
00188      Scalar VT[],
00189      const Ordinal ldvt,
00190      Scalar work[],
00191      const Ordinal lwork,
00192      magnitude_type rwork[],
00193      int* const INFO);
00194 
00195   private:
00196     LAPACK (const LAPACK&);
00197     LAPACK& operator= (const LAPACK&);
00198   };
00199 
00200 } // namespace TSQR
00201 
00202 #endif // __TSQR_Tsqr_Lapack_hpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends