2009-10-01 16:17:02 +02:00
|
|
|
/*
|
|
|
|
* Defines the prototypes for BLAS Fortran functions.
|
|
|
|
*
|
|
|
|
* Also defines a typedef blas_int to be used for all integers passed to BLAS
|
|
|
|
* functions.
|
|
|
|
*
|
|
|
|
* When used in the context of a MATLAB MEX file, you must define MATLAB_MEX_FILE
|
|
|
|
* and MATLAB_VERSION (for version 7.4, define it to 0x0704).
|
|
|
|
*
|
|
|
|
*
|
2019-04-16 11:40:38 +02:00
|
|
|
* Copyright © 2009-2013 Dynare Team
|
2009-10-01 16:17:02 +02:00
|
|
|
*
|
|
|
|
* This file is part of Dynare.
|
|
|
|
*
|
|
|
|
* Dynare is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Dynare is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _DYNBLAS_H
|
|
|
|
#define _DYNBLAS_H
|
|
|
|
|
|
|
|
/* Starting from version 7.8, MATLAB BLAS expects ptrdiff_t arguments for integers */
|
2009-12-16 18:18:38 +01:00
|
|
|
#if defined(MATLAB_MEX_FILE) && MATLAB_VERSION >= 0x0708
|
|
|
|
# ifdef __cplusplus
|
2011-06-13 11:38:09 +02:00
|
|
|
# include <cstddef>
|
2009-10-01 16:17:02 +02:00
|
|
|
# else
|
2011-06-13 11:38:09 +02:00
|
|
|
# include <stddef.h>
|
2009-10-01 16:17:02 +02:00
|
|
|
# endif
|
2009-12-16 18:18:38 +01:00
|
|
|
typedef ptrdiff_t blas_int;
|
|
|
|
#else
|
|
|
|
typedef int blas_int;
|
|
|
|
#endif
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2013-03-22 15:44:34 +01:00
|
|
|
#if defined(MATLAB_MEX_FILE) && defined(_WIN32) && !defined(_MSC_VER)
|
2009-12-16 18:18:38 +01:00
|
|
|
# define FORTRAN_WRAPPER(x) x
|
|
|
|
#else
|
|
|
|
# define FORTRAN_WRAPPER(x) x ## _
|
|
|
|
#endif
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#ifdef __cplusplus
|
2009-10-01 16:17:02 +02:00
|
|
|
extern "C" {
|
2009-12-16 18:18:38 +01:00
|
|
|
#endif
|
2009-10-01 16:17:02 +02:00
|
|
|
|
|
|
|
typedef const char *BLCHAR;
|
|
|
|
typedef const blas_int *CONST_BLINT;
|
|
|
|
typedef const double *CONST_BLDOU;
|
2010-04-29 16:05:34 +02:00
|
|
|
typedef const float *CONST_BLFLT;
|
2009-10-01 16:17:02 +02:00
|
|
|
typedef double *BLDOU;
|
2010-04-29 16:05:34 +02:00
|
|
|
typedef float *BLFLT;
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dgemm FORTRAN_WRAPPER(dgemm)
|
2009-10-01 16:17:02 +02:00
|
|
|
void dgemm(BLCHAR transa, BLCHAR transb, CONST_BLINT m, CONST_BLINT n,
|
|
|
|
CONST_BLINT k, CONST_BLDOU alpha, CONST_BLDOU a, CONST_BLINT lda,
|
|
|
|
CONST_BLDOU b, CONST_BLINT ldb, CONST_BLDOU beta,
|
|
|
|
BLDOU c, CONST_BLINT ldc);
|
|
|
|
|
2010-04-29 16:05:34 +02:00
|
|
|
#define sgemm FORTRAN_WRAPPER(sgemm)
|
|
|
|
void sgemm(BLCHAR transa, BLCHAR transb, CONST_BLINT m, CONST_BLINT n,
|
|
|
|
CONST_BLINT k, CONST_BLFLT alpha, CONST_BLFLT a, CONST_BLINT lda,
|
|
|
|
CONST_BLFLT b, CONST_BLINT ldb, CONST_BLFLT beta,
|
|
|
|
BLFLT c, CONST_BLINT ldc);
|
|
|
|
|
2010-02-09 19:15:59 +01:00
|
|
|
#define dsymm FORTRAN_WRAPPER(dsymm)
|
|
|
|
void dsymm(BLCHAR side, BLCHAR uplo, CONST_BLINT m, CONST_BLINT n,
|
|
|
|
CONST_BLDOU alpha, CONST_BLDOU a, CONST_BLINT lda,
|
|
|
|
CONST_BLDOU b, CONST_BLINT ldb, CONST_BLDOU beta,
|
|
|
|
BLDOU c, CONST_BLINT ldc);
|
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dgemv FORTRAN_WRAPPER(dgemv)
|
2009-10-01 16:17:02 +02:00
|
|
|
void dgemv(BLCHAR trans, CONST_BLINT m, CONST_BLINT n, CONST_BLDOU alpha,
|
|
|
|
CONST_BLDOU a, CONST_BLINT lda, CONST_BLDOU x, CONST_BLINT incx,
|
|
|
|
CONST_BLDOU beta, BLDOU y, CONST_BLINT incy);
|
|
|
|
|
2010-09-02 18:40:52 +02:00
|
|
|
#define dsymv FORTRAN_WRAPPER(dsymv)
|
2011-02-04 16:53:12 +01:00
|
|
|
void dsymv(BLCHAR uplo, CONST_BLINT m, CONST_BLDOU alpha, CONST_BLDOU a,
|
2010-09-02 18:40:52 +02:00
|
|
|
CONST_BLINT lda, CONST_BLDOU b, CONST_BLINT ldb, CONST_BLDOU beta,
|
|
|
|
BLDOU c, CONST_BLINT ldc);
|
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dtrsv FORTRAN_WRAPPER(dtrsv)
|
2009-10-01 16:17:02 +02:00
|
|
|
void dtrsv(BLCHAR uplo, BLCHAR trans, BLCHAR diag, CONST_BLINT n,
|
|
|
|
CONST_BLDOU a, CONST_BLINT lda, BLDOU x, CONST_BLINT incx);
|
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dtrmv FORTRAN_WRAPPER(dtrmv)
|
2009-10-01 16:17:02 +02:00
|
|
|
void dtrmv(BLCHAR uplo, BLCHAR trans, BLCHAR diag, CONST_BLINT n,
|
|
|
|
CONST_BLDOU a, CONST_BLINT lda, BLDOU x, CONST_BLINT incx);
|
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define daxpy FORTRAN_WRAPPER(daxpy)
|
2009-10-01 16:17:02 +02:00
|
|
|
void daxpy(CONST_BLINT n, CONST_BLDOU a, CONST_BLDOU x, CONST_BLINT incx,
|
|
|
|
BLDOU y, CONST_BLINT incy);
|
|
|
|
|
2010-04-29 16:05:34 +02:00
|
|
|
#define saxpy FORTRAN_WRAPPER(saxpy)
|
|
|
|
void saxpy(CONST_BLINT n, CONST_BLFLT a, CONST_BLFLT x, CONST_BLINT incx,
|
|
|
|
BLFLT y, CONST_BLINT incy);
|
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dcopy FORTRAN_WRAPPER(dcopy)
|
2009-10-01 16:17:02 +02:00
|
|
|
void dcopy(CONST_BLINT n, CONST_BLDOU x, CONST_BLINT incx,
|
|
|
|
BLDOU y, CONST_BLINT incy);
|
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define zaxpy FORTRAN_WRAPPER(zaxpy)
|
2009-10-01 16:17:02 +02:00
|
|
|
void zaxpy(CONST_BLINT n, CONST_BLDOU a, CONST_BLDOU x, CONST_BLINT incx,
|
|
|
|
BLDOU y, CONST_BLINT incy);
|
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dscal FORTRAN_WRAPPER(dscal)
|
2009-10-01 16:17:02 +02:00
|
|
|
void dscal(CONST_BLINT n, CONST_BLDOU a, BLDOU x, CONST_BLINT incx);
|
|
|
|
|
2010-04-29 16:05:34 +02:00
|
|
|
#define sscal FORTRAN_WRAPPER(sscal)
|
|
|
|
void sscal(CONST_BLINT n, CONST_BLDOU a, BLFLT x, CONST_BLINT incx);
|
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dtrsm FORTRAN_WRAPPER(dtrsm)
|
2009-10-01 16:17:02 +02:00
|
|
|
void dtrsm(BLCHAR side, BLCHAR uplo, BLCHAR transa, BLCHAR diag, CONST_BLINT m,
|
|
|
|
CONST_BLINT n, CONST_BLDOU alpha, CONST_BLDOU a, CONST_BLINT lda,
|
|
|
|
BLDOU b, CONST_BLINT ldb);
|
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define ddot FORTRAN_WRAPPER(ddot)
|
2009-10-01 16:17:02 +02:00
|
|
|
double ddot(CONST_BLINT n, CONST_BLDOU x, CONST_BLINT incx, CONST_BLDOU y,
|
|
|
|
CONST_BLINT incy);
|
|
|
|
|
2010-02-09 19:15:59 +01:00
|
|
|
#define dsyr FORTRAN_WRAPPER(dsyr)
|
|
|
|
void dsyr(BLCHAR uplo, CONST_BLINT n, CONST_BLDOU alpha, CONST_BLDOU x,
|
|
|
|
CONST_BLINT incx, BLDOU a, CONST_BLINT lda);
|
|
|
|
|
2011-02-22 11:09:06 +01:00
|
|
|
#define dtrmm FORTRAN_WRAPPER(dtrmm)
|
|
|
|
void dtrmm(BLCHAR side, BLCHAR uplo, BLCHAR transa, BLCHAR diag, CONST_BLINT m,
|
|
|
|
CONST_BLINT n, CONST_BLDOU alpha, CONST_BLDOU a, CONST_BLINT lda,
|
|
|
|
BLDOU b, CONST_BLINT ldb);
|
|
|
|
|
|
|
|
#define strmm FORTRAN_WRAPPER(strmm)
|
|
|
|
void strmm(BLCHAR side, BLCHAR uplo, BLCHAR transa, BLCHAR diag, CONST_BLINT m,
|
|
|
|
CONST_BLINT n, CONST_BLFLT alpha, CONST_BLFLT a, CONST_BLINT lda,
|
|
|
|
BLFLT b, CONST_BLINT ldb);
|
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#ifdef __cplusplus
|
2009-10-01 16:17:02 +02:00
|
|
|
} /* extern "C" */
|
2009-12-16 18:18:38 +01:00
|
|
|
#endif
|
2009-10-01 16:17:02 +02:00
|
|
|
|
|
|
|
#endif /* _DYNBLAS_H */
|