sundials_lapack.h

Go to the documentation of this file.
00001 /*
00002  * -----------------------------------------------------------------
00003  * $Revision: 1.4 $
00004  * $Date: 2006/11/29 00:05:07 $
00005  * -----------------------------------------------------------------
00006  * Programmer: Radu Serban @ LLNL
00007  * -----------------------------------------------------------------
00008  * Copyright (c) 2006, The Regents of the University of California.
00009  * Produced at the Lawrence Livermore National Laboratory.
00010  * All rights reserved.
00011  * For details, see the LICENSE file.
00012  * -----------------------------------------------------------------
00013  * This is the header file for a generic package of direct matrix
00014  * operations for use with BLAS/LAPACK.
00015  * -----------------------------------------------------------------
00016  */
00017 
00018 #ifndef _SUNDIALS_LAPACK_H
00019 #define _SUNDIALS_LAPACK_H
00020 
00021 #ifdef __cplusplus  /* wrapper to enable C++ usage */
00022 extern "C" {
00023 #endif
00024 
00025 #include <sundials/sundials_direct.h>
00026 
00027 /*
00028  * ==================================================================
00029  * Exported functions
00030  * ==================================================================
00031  */
00032 
00033 /*
00034  * -----------------------------------------------------------------
00035  * Functions: LapackDenseZero and LapackBandZero
00036  * -----------------------------------------------------------------
00037  * These functions set all the elements of the M-by-N matrix A to 0.0.
00038  * -----------------------------------------------------------------
00039  */
00040 
00041 SUNDIALS_EXPORT void LapackDenseZero(DlsMat A);
00042 SUNDIALS_EXPORT void LapackBandZero(DlsMat A);
00043   
00044 /*
00045  * -----------------------------------------------------------------
00046  * Functions: LapackDenseAddI and LapackBandAddI
00047  * -----------------------------------------------------------------
00048  * These functions add 1.0 to the main diagonal (A_ii, i=1,2,...,N-1)
00049  * of the M-by-N matrix A (M>= N) and stores the result back in A.
00050  * They are typically used with square matrices.
00051  * -----------------------------------------------------------------
00052  */
00053   
00054 SUNDIALS_EXPORT void LapackDenseAddI(DlsMat A);
00055 SUNDIALS_EXPORT void LapackBandAddI(DlsMat A);
00056 
00057 /*
00058  * ==================================================================
00059  * Blas and Lapack functions
00060  * ==================================================================
00061  */
00062 
00063 #if defined(F77_FUNC)
00064 
00065 #define dcopy_f77       F77_FUNC(dcopy, DCOPY)
00066 #define dscal_f77       F77_FUNC(dscal, DSCAL)
00067 #define dgemv_f77       F77_FUNC(dgemv, DGEMV)
00068 #define dtrsv_f77       F77_FUNC(dtrsv, DTRSV)
00069 #define dsyrk_f77       F77_FUNC(dsyrk, DSKYR)
00070 
00071 #define dgbtrf_f77      F77_FUNC(dgbtrf, DGBTRF)
00072 #define dgbtrs_f77      F77_FUNC(dgbtrs, DGBTRS)
00073 #define dgetrf_f77      F77_FUNC(dgetrf, DGETRF)
00074 #define dgetrs_f77      F77_FUNC(dgetrs, DGETRS)
00075 #define dgeqp3_f77      F77_FUNC(dgeqp3, DGEQP3)
00076 #define dgeqrf_f77      F77_FUNC(dgeqrf, DGEQRF)
00077 #define dormqr_f77      F77_FUNC(dormqr, DORMQR)
00078 #define dpotrf_f77      F77_FUNC(dpotrf, DPOTRF)
00079 #define dpotrs_f77      F77_FUNC(dpotrs, DPOTRS)
00080 
00081 #else
00082 
00083 #define dcopy_f77       dcopy_
00084 #define dscal_f77       dscal_
00085 #define dgemv_f77       dgemv_
00086 #define dtrsv_f77       dtrsv_
00087 #define dsyrk_f77       dsyrk_
00088 
00089 #define dgbtrf_f77      dgbtrf_
00090 #define dgbtrs_f77      dgbtrs_
00091 #define dgeqp3_f77      dgeqp3_
00092 #define dgeqrf_f77      dgeqrf_
00093 #define dgetrf_f77      dgetrf_
00094 #define dgetrs_f77      dgetrs_
00095 #define dormqr_f77      dormqr_
00096 #define dpotrf_f77      dpotrf_
00097 #define dpotrs_f77      dpotrs_
00098 
00099 #endif
00100 
00101 /* Level-1 BLAS */
00102   
00103 extern void dcopy_f77(int *n, const double *x, const int *inc_x, double *y, const int *inc_y);
00104 extern void dscal_f77(int *n, const double *alpha, double *x, const int *inc_x);
00105 
00106 /* Level-2 BLAS */
00107 
00108 extern void dgemv_f77(const char *trans, int *m, int *n, const double *alpha, const double *a, 
00109               int *lda, const double *x, int *inc_x, const double *beta, double *y, int *inc_y, 
00110               int len_trans);
00111 
00112 extern void dtrsv_f77(const char *uplo, const char *trans, const char *diag, const int *n, 
00113               const double *a, const int *lda, double *x, const int *inc_x, 
00114               int len_uplo, int len_trans, int len_diag);
00115 
00116 /* Level-3 BLAS */
00117 
00118 extern void dsyrk_f77(const char *uplo, const char *trans, const int *n, const int *k, 
00119               const double *alpha, const double *a, const int *lda, const double *beta, 
00120               const double *c, const int *ldc, int len_uplo, int len_trans);
00121   
00122 /* LAPACK */
00123 
00124 extern void dgbtrf_f77(const int *m, const int *n, const int *kl, const int *ku, 
00125                double *ab, int *ldab, int *ipiv, int *info);
00126 
00127 extern void dgbtrs_f77(const char *trans, const int *n, const int *kl, const int *ku, const int *nrhs, 
00128                double *ab, const int *ldab, int *ipiv, double *b, const int *ldb, 
00129                int *info, int len_trans);
00130 
00131 
00132 extern void dgeqp3_f77(const int *m, const int *n, double *a, const int *lda, int *jpvt, double *tau, 
00133                double *work, const int *lwork, int *info);
00134 
00135 extern void dgeqrf_f77(const int *m, const int *n, double *a, const int *lda, double *tau, double *work, 
00136                const int *lwork, int *info);
00137 
00138 extern void dgetrf_f77(const int *m, const int *n, double *a, int *lda, int *ipiv, int *info);
00139 
00140 extern void dgetrs_f77(const char *trans, const int *n, const int *nrhs, double *a, const int *lda, 
00141                int *ipiv, double *b, const int *ldb, int *info, int len_trans);
00142 
00143 
00144 extern void dormqr_f77(const char *side, const char *trans, const int *m, const int *n, const int *k, 
00145                double *a, const int *lda, double *tau, double *c, const int *ldc, 
00146                double *work, const int *lwork, int *info, int len_side, int len_trans);
00147 
00148 extern void dpotrf_f77(const char *uplo, const int *n, double *a, int *lda, int *info, int len_uplo);
00149 
00150 extern void dpotrs_f77(const char *uplo, const int *n, const int *nrhs, double *a, const int *lda, 
00151                double *b, const int *ldb, int * info, int len_uplo);
00152 
00153 
00154 #ifdef __cplusplus
00155 }
00156 #endif
00157 
00158 #endif

Generated on Fri Sep 26 07:44:17 2008 for SimTKcore by  doxygen 1.5.6