cmake introduction
A short example project for the CMake build system
lapack_wrapper.h
Go to the documentation of this file.
1 #ifndef __cxx_test_project_lapack_wrapper_h__
2 #define __cxx_test_project_lapack_wrapper_h__
3 
4 #include "config.h"
5 
6 extern "C"
7 {
8  /// @brief Function provided by LAPACK to solve a (dense) linear system
9  /// @see http://www.netlib.org/lapack/explore-html/d8/d72/dgesv_8f.html
10  void dgesv_(int* N, int* NRHS, double* A, int* LDA, int* IPIV, double* B, int* LDB, int* INFO );
11 }
12 
13 namespace core
14 {
15 
16 // if the variable cxx_test_project_WITH_LAPACK is defined in the generated header file config.h
17 // the following code will be used in the compilation.
18 #ifdef CXX_TEST_PROJECT_WITH_LAPACK
19 
20 /// @brief Wrapper function around around dgesv_
21 void dgesv_wrap(int* N, int* NRHS, double* A, int* LDA, int* IPIV, double* B, int* LDB, int* INFO )
22 {
23  dgesv_(N, NRHS, A, LDA, IPIV, B, LDB, INFO);
24 }
25 
26 // if the variable is not set, the subsequent lines of code will be used.
27 #else
28 
29 /// @brief Wrapper function around around dgesv_
30 void dgesv_wrap(int* N, int* NRHS, double* A, int* LDA, int* IPIV, double* B, int* LDB, int* INFO )
31 {
32  std::cerr << "Project 'cxx_test_project was not configured with LAPACK support.'" << std::endl;
33 }
34 
35 #endif
36 }
37 #endif
Namespace for core components.
Definition: core.h:11
void dgesv_wrap(int *N, int *NRHS, double *A, int *LDA, int *IPIV, double *B, int *LDB, int *INFO)
Wrapper function around around dgesv_.
void dgesv_(int *N, int *NRHS, double *A, int *LDA, int *IPIV, double *B, int *LDB, int *INFO)
Function provided by LAPACK to solve a (dense) linear system.