LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
lapacke_config.h
1/*****************************************************************************
2 Copyright (c) 2010, Intel Corp.
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7
8 * Redistributions of source code must retain the above copyright notice,
9 this list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in the
12 documentation and/or other materials provided with the distribution.
13 * Neither the name of Intel Corporation nor the names of its contributors
14 may be used to endorse or promote products derived from this software
15 without specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 THE POSSIBILITY OF SUCH DAMAGE.
28******************************************************************************
29* Contents: Native C interface to LAPACK
30* Author: Intel Corporation
31*****************************************************************************/
32
33#ifndef _LAPACKE_CONFIG_H_
34#define _LAPACKE_CONFIG_H_
35
36#ifdef __cplusplus
37#if defined(LAPACK_COMPLEX_CPP)
38#include <complex>
39#endif
40extern "C" {
41#endif /* __cplusplus */
42
43#include <stdlib.h>
44#include <stdint.h>
45#include <inttypes.h>
46
47#ifndef lapack_int
48#if defined(LAPACK_ILP64)
49#define lapack_int int64_t
50#else
51#define lapack_int int32_t
52#endif
53#endif
54
55/*
56 * Integer format string
57 */
58#ifndef LAPACK_IFMT
59#if defined(LAPACK_ILP64)
60#define LAPACK_IFMT PRId64
61#else
62#define LAPACK_IFMT PRId32
63#endif
64#endif
65
66#ifndef lapack_logical
67#define lapack_logical lapack_int
68#endif
69
70#ifndef LAPACK_COMPLEX_CUSTOM
71
72#if defined(LAPACK_COMPLEX_STRUCTURE)
73
74typedef struct { float real, imag; } _lapack_complex_float;
75typedef struct { double real, imag; } _lapack_complex_double;
76#define lapack_complex_float _lapack_complex_float
77#define lapack_complex_double _lapack_complex_double
78#define lapack_complex_float_real(z) ((z).real)
79#define lapack_complex_float_imag(z) ((z).imag)
80#define lapack_complex_double_real(z) ((z).real)
81#define lapack_complex_double_imag(z) ((z).imag)
82
83#elif defined(LAPACK_COMPLEX_C99)
84
85#include <complex.h>
86#define lapack_complex_float float _Complex
87#define lapack_complex_double double _Complex
88#define lapack_complex_float_real(z) (creal(z))
89#define lapack_complex_float_imag(z) (cimag(z))
90#define lapack_complex_double_real(z) (creal(z))
91#define lapack_complex_double_imag(z) (cimag(z))
92
93#elif defined(LAPACK_COMPLEX_CPP)
94
95#define lapack_complex_float std::complex<float>
96#define lapack_complex_double std::complex<double>
97#define lapack_complex_float_real(z) ((z).real())
98#define lapack_complex_float_imag(z) ((z).imag())
99#define lapack_complex_double_real(z) ((z).real())
100#define lapack_complex_double_imag(z) ((z).imag())
101
102#else
103
104#include <complex.h>
105#define lapack_complex_float float _Complex
106#define lapack_complex_double double _Complex
107#define lapack_complex_float_real(z) (creal(z))
108#define lapack_complex_float_imag(z) (cimag(z))
109#define lapack_complex_double_real(z) (creal(z))
110#define lapack_complex_double_imag(z) (cimag(z))
111
112#endif
113
114lapack_complex_float lapack_make_complex_float( float re, float im );
115lapack_complex_double lapack_make_complex_double( double re, double im );
116
117#endif
118
119#ifndef LAPACK_malloc
120#define LAPACK_malloc( size ) malloc( size )
121#endif
122
123#ifndef LAPACK_free
124#define LAPACK_free( p ) free( p )
125#endif
126
127#ifdef __cplusplus
128}
129#endif /* __cplusplus */
130
131#endif /* _LAPACKE_CONFIG_H_ */