Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-17 09:55:45

0001 /*****************************************************************************
0002   Copyright (c) 2010, Intel Corp.
0003   All rights reserved.
0004 
0005   Redistribution and use in source and binary forms, with or without
0006   modification, are permitted provided that the following conditions are met:
0007 
0008     * Redistributions of source code must retain the above copyright notice,
0009       this list of conditions and the following disclaimer.
0010     * Redistributions in binary form must reproduce the above copyright
0011       notice, this list of conditions and the following disclaimer in the
0012       documentation and/or other materials provided with the distribution.
0013     * Neither the name of Intel Corporation nor the names of its contributors
0014       may be used to endorse or promote products derived from this software
0015       without specific prior written permission.
0016 
0017   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0018   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0019   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0020   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0021   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0022   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0023   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0024   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0025   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0026   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
0027   THE POSSIBILITY OF SUCH DAMAGE.
0028 ******************************************************************************
0029 * Contents: Native C interface to LAPACK
0030 * Author: Intel Corporation
0031 *****************************************************************************/
0032 
0033 #ifndef _LAPACKE_CONFIG_H_
0034 #define _LAPACKE_CONFIG_H_
0035 
0036 #ifdef __cplusplus
0037 #if defined(LAPACK_COMPLEX_CPP)
0038 #include <complex>
0039 #endif
0040 extern "C" {
0041 #endif /* __cplusplus */
0042 
0043 #include <stdlib.h>
0044 #include <stdint.h>
0045 #include <inttypes.h>
0046 
0047 #ifndef lapack_int
0048 #if defined(LAPACK_ILP64)
0049 #define lapack_int        int64_t
0050 #else
0051 #define lapack_int        int32_t
0052 #endif
0053 #endif
0054 
0055 /*
0056  * Integer format string
0057  */
0058 #ifndef LAPACK_IFMT
0059 #if defined(LAPACK_ILP64)
0060 #define LAPACK_IFMT       PRId64
0061 #else
0062 #define LAPACK_IFMT       PRId32
0063 #endif
0064 #endif
0065 
0066 #ifndef lapack_logical
0067 #define lapack_logical    lapack_int
0068 #endif
0069 
0070 #ifndef LAPACK_COMPLEX_CUSTOM
0071 #if defined(_MSC_VER)
0072     #define _CRT_USE_C_COMPLEX_H
0073     #include <complex.h>
0074     #define LAPACK_COMPLEX_CUSTOM
0075     #define lapack_complex_float _Fcomplex
0076     #define lapack_complex_double _Dcomplex
0077     #define lapack_complex_float_real(z)       (creal(z))
0078     #define lapack_complex_float_imag(z)       (cimag(z))
0079     #define lapack_complex_double_real(z)       (creal(z))
0080     #define lapack_complex_double_imag(z)       (cimag(z))
0081 #else
0082 
0083 #if defined(LAPACK_COMPLEX_STRUCTURE)
0084 
0085 typedef struct { float real, imag; } _lapack_complex_float;
0086 typedef struct { double real, imag; } _lapack_complex_double;
0087 #define lapack_complex_float  _lapack_complex_float
0088 #define lapack_complex_double _lapack_complex_double
0089 #define lapack_complex_float_real(z)  ((z).real)
0090 #define lapack_complex_float_imag(z)  ((z).imag)
0091 #define lapack_complex_double_real(z)  ((z).real)
0092 #define lapack_complex_double_imag(z)  ((z).imag)
0093 
0094 #elif defined(LAPACK_COMPLEX_C99)
0095 
0096 #include <complex.h>
0097 #define lapack_complex_float    float _Complex
0098 #define lapack_complex_double   double _Complex
0099 #define lapack_complex_float_real(z)       (creal(z))
0100 #define lapack_complex_float_imag(z)       (cimag(z))
0101 #define lapack_complex_double_real(z)       (creal(z))
0102 #define lapack_complex_double_imag(z)       (cimag(z))
0103 
0104 #elif defined(LAPACK_COMPLEX_CPP)
0105 
0106 #define lapack_complex_float std::complex<float>
0107 #define lapack_complex_double std::complex<double>
0108 #define lapack_complex_float_real(z)       ((z).real())
0109 #define lapack_complex_float_imag(z)       ((z).imag())
0110 #define lapack_complex_double_real(z)       ((z).real())
0111 #define lapack_complex_double_imag(z)       ((z).imag())
0112 
0113 #else
0114 
0115 #include <complex.h>
0116 #define lapack_complex_float    float _Complex
0117 #define lapack_complex_double   double _Complex
0118 #define lapack_complex_float_real(z)       (creal(z))
0119 #define lapack_complex_float_imag(z)       (cimag(z))
0120 #define lapack_complex_double_real(z)       (creal(z))
0121 #define lapack_complex_double_imag(z)       (cimag(z))
0122 
0123 #endif
0124 #endif
0125 
0126 lapack_complex_float lapack_make_complex_float( float re, float im );
0127 lapack_complex_double lapack_make_complex_double( double re, double im );
0128 
0129 #endif
0130 
0131 #ifndef LAPACK_malloc
0132 #define LAPACK_malloc( size )   malloc( size )
0133 #endif
0134 
0135 #ifndef LAPACK_free
0136 #define LAPACK_free( p )        free( p )
0137 #endif
0138 
0139 #ifdef __cplusplus
0140 }
0141 #endif /* __cplusplus */
0142 
0143 #endif /* _LAPACKE_CONFIG_H_ */