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).
|
|
|
|
*
|
|
|
|
*
|
2023-04-03 14:58:07 +02:00
|
|
|
* Copyright © 2009-2023 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
|
2021-06-09 17:33:48 +02:00
|
|
|
* along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2009-10-01 16:17:02 +02:00
|
|
|
*/
|
|
|
|
|
2023-12-13 16:50:28 +01:00
|
|
|
#ifndef DYNBLAS_H
|
|
|
|
#define DYNBLAS_H
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2023-04-03 14:58:07 +02:00
|
|
|
#if defined(MATLAB_MEX_FILE) && __SIZEOF_POINTER__ == 8
|
2009-12-16 18:18:38 +01:00
|
|
|
# ifdef __cplusplus
|
2023-04-03 14:58:07 +02:00
|
|
|
# include <cstdint>
|
2009-10-01 16:17:02 +02:00
|
|
|
# else
|
2023-04-03 14:58:07 +02:00
|
|
|
# include <stdint.h>
|
2009-10-01 16:17:02 +02:00
|
|
|
# endif
|
2023-04-03 14:58:07 +02:00
|
|
|
typedef int64_t blas_int;
|
2009-12-16 18:18:38 +01:00
|
|
|
#else
|
|
|
|
typedef int blas_int;
|
|
|
|
#endif
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2023-04-03 14:59:27 +02:00
|
|
|
#if defined(MATLAB_MEX_FILE) && defined(_WIN32)
|
2009-12-16 18:18:38 +01:00
|
|
|
# define FORTRAN_WRAPPER(x) x
|
|
|
|
#else
|
2023-11-29 19:00:21 +01:00
|
|
|
# define FORTRAN_WRAPPER(x) x##_
|
2009-12-16 18:18:38 +01:00
|
|
|
#endif
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#ifdef __cplusplus
|
2023-11-29 19:00:21 +01:00
|
|
|
extern "C"
|
|
|
|
{
|
2009-12-16 18:18:38 +01:00
|
|
|
#endif
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2023-11-29 19:00:21 +01:00
|
|
|
typedef const char* BLCHAR;
|
|
|
|
typedef const blas_int* CONST_BLINT;
|
|
|
|
typedef const double* CONST_BLDOU;
|
|
|
|
typedef const float* CONST_BLFLT;
|
|
|
|
typedef double* BLDOU;
|
|
|
|
typedef float* BLFLT;
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dgemm FORTRAN_WRAPPER(dgemm)
|
2023-11-29 19:00:21 +01: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);
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2010-04-29 16:05:34 +02:00
|
|
|
#define sgemm FORTRAN_WRAPPER(sgemm)
|
2023-11-29 19:00:21 +01:00
|
|
|
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-04-29 16:05:34 +02:00
|
|
|
|
2010-02-09 19:15:59 +01:00
|
|
|
#define dsymm FORTRAN_WRAPPER(dsymm)
|
2023-11-29 19:00:21 +01:00
|
|
|
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,
|
2010-02-09 19:15:59 +01:00
|
|
|
BLDOU c, CONST_BLINT ldc);
|
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dgemv FORTRAN_WRAPPER(dgemv)
|
2023-11-29 19:00:21 +01: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);
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2010-09-02 18:40:52 +02:00
|
|
|
#define dsymv FORTRAN_WRAPPER(dsymv)
|
2023-11-29 19:00:21 +01:00
|
|
|
void dsymv(BLCHAR uplo, CONST_BLINT m, CONST_BLDOU alpha, CONST_BLDOU a, CONST_BLINT lda,
|
|
|
|
CONST_BLDOU b, CONST_BLINT ldb, CONST_BLDOU beta, BLDOU c, CONST_BLINT ldc);
|
2010-09-02 18:40:52 +02:00
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dtrsv FORTRAN_WRAPPER(dtrsv)
|
2023-11-29 19:00:21 +01:00
|
|
|
void dtrsv(BLCHAR uplo, BLCHAR trans, BLCHAR diag, CONST_BLINT n, CONST_BLDOU a, CONST_BLINT lda,
|
|
|
|
BLDOU x, CONST_BLINT incx);
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dtrmv FORTRAN_WRAPPER(dtrmv)
|
2023-11-29 19:00:21 +01:00
|
|
|
void dtrmv(BLCHAR uplo, BLCHAR trans, BLCHAR diag, CONST_BLINT n, CONST_BLDOU a, CONST_BLINT lda,
|
|
|
|
BLDOU x, CONST_BLINT incx);
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define daxpy FORTRAN_WRAPPER(daxpy)
|
2023-11-29 19:00:21 +01:00
|
|
|
void daxpy(CONST_BLINT n, CONST_BLDOU a, CONST_BLDOU x, CONST_BLINT incx, BLDOU y,
|
|
|
|
CONST_BLINT incy);
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2010-04-29 16:05:34 +02:00
|
|
|
#define saxpy FORTRAN_WRAPPER(saxpy)
|
2023-11-29 19:00:21 +01:00
|
|
|
void saxpy(CONST_BLINT n, CONST_BLFLT a, CONST_BLFLT x, CONST_BLINT incx, BLFLT y,
|
|
|
|
CONST_BLINT incy);
|
2010-04-29 16:05:34 +02:00
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define dcopy FORTRAN_WRAPPER(dcopy)
|
2023-11-29 19:00:21 +01:00
|
|
|
void dcopy(CONST_BLINT n, CONST_BLDOU x, CONST_BLINT incx, BLDOU y, CONST_BLINT incy);
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define zaxpy FORTRAN_WRAPPER(zaxpy)
|
2023-11-29 19:00:21 +01:00
|
|
|
void zaxpy(CONST_BLINT n, CONST_BLDOU a, CONST_BLDOU x, CONST_BLINT incx, BLDOU y,
|
|
|
|
CONST_BLINT incy);
|
2009-10-01 16:17:02 +02:00
|
|
|
|
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)
|
2023-11-29 19:00:21 +01: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-10-01 16:17:02 +02:00
|
|
|
|
2009-12-16 18:18:38 +01:00
|
|
|
#define ddot FORTRAN_WRAPPER(ddot)
|
2023-11-29 19:00:21 +01:00
|
|
|
double ddot(CONST_BLINT n, CONST_BLDOU x, CONST_BLINT incx, CONST_BLDOU y, CONST_BLINT incy);
|
2009-10-01 16:17:02 +02:00
|
|
|
|
2010-02-09 19:15:59 +01:00
|
|
|
#define dsyr FORTRAN_WRAPPER(dsyr)
|
2023-11-29 19:00:21 +01:00
|
|
|
void dsyr(BLCHAR uplo, CONST_BLINT n, CONST_BLDOU alpha, CONST_BLDOU x, CONST_BLINT incx, BLDOU a,
|
|
|
|
CONST_BLINT lda);
|
2010-02-09 19:15:59 +01:00
|
|
|
|
2011-02-22 11:09:06 +01:00
|
|
|
#define dtrmm FORTRAN_WRAPPER(dtrmm)
|
2023-11-29 19:00:21 +01:00
|
|
|
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);
|
2011-02-22 11:09:06 +01:00
|
|
|
|
|
|
|
#define strmm FORTRAN_WRAPPER(strmm)
|
2023-11-29 19:00:21 +01:00
|
|
|
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);
|
2011-02-22 11:09:06 +01: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
|
|
|
|
2023-12-13 16:50:28 +01:00
|
|
|
#endif
|