blas_classic.hpp
1 /*
2  * This file is part of CasADi.
3  *
4  * CasADi -- A symbolic framework for dynamic optimization.
5  * Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl,
6  * KU Leuven. All rights reserved.
7  *
8  * CasADi is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 3 of the License, or (at your option) any later version.
12  *
13  * CasADi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with CasADi; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23 
24 
25 #ifndef CASADI_BLAS_CLASSIC_HPP
26 #define CASADI_BLAS_CLASSIC_HPP
27 
28 #include "casadi/core/blas_impl.hpp"
29 #include <casadi/interfaces/blas_classic/casadi_blas_classic_export.h>
30 
31 // Flang's wasm ABI includes trailing lengths for the two CHARACTER arguments.
32 #ifdef __EMSCRIPTEN__
33 #define CASADI_BLAS_CLASSIC_CHARLEN_DECL , size_t, size_t
34 #define CASADI_BLAS_CLASSIC_CHARLEN_ARGS , 1, 1
35 #else
36 #define CASADI_BLAS_CLASSIC_CHARLEN_DECL
37 #define CASADI_BLAS_CLASSIC_CHARLEN_ARGS
38 #endif
39 
40 extern "C" {
44  void dgemm_(const char* transa, const char* transb,
45  const int* m, const int* n, const int* k,
46  const double* alpha,
47  const double* a, const int* lda,
48  const double* b, const int* ldb,
49  const double* beta,
50  double* c, const int* ldc CASADI_BLAS_CLASSIC_CHARLEN_DECL);
51 
53  void daxpy_(const int* n, const double* alpha,
54  const double* x, const int* incx,
55  double* y, const int* incy);
56  double ddot_(const int* n,
57  const double* x, const int* incx,
58  const double* y, const int* incy);
59  void dscal_(const int* n, const double* alpha,
60  double* x, const int* incx);
61  double dnrm2_(const int* n, const double* x, const int* incx);
62  double dasum_(const int* n, const double* x, const int* incx);
63 }
64 
73 
74 namespace casadi {
75 
87  class BlasClassic : public Blas {
88  public:
90  static const std::string meta_doc;
91  };
92 
93 } // namespace casadi
94 
96 #endif // CASADI_BLAS_CLASSIC_HPP
The casadi namespace.
Definition: archiver.hpp:32