SuperSCS  1.3.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
scs_blas.h
Go to the documentation of this file.
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2017 Pantelis Sopasakis (https://alphaville.github.io),
5  * Krina Menounou (https://www.linkedin.com/in/krinamenounou),
6  * Panagiotis Patrinos (http://homes.esat.kuleuven.be/~ppatrino)
7  * Copyright (c) 2012 Brendan O'Donoghue (bodonoghue85@gmail.com)
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a copy
10  * of this software and associated documentation files (the "Software"), to deal
11  * in the Software without restriction, including without limitation the rights
12  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13  * copies of the Software, and to permit persons to whom the Software is
14  * furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included in all
17  * copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  * SOFTWARE.
26  *
27  */
28 #ifndef SCS_BLAS_H_GUARD
29 #define SCS_BLAS_H_GUARD
30 
31 #ifdef LAPACK_LIB_FOUND
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /* Default to underscore for blas / lapack */
38 #ifndef BLASSUFFIX
39 #define BLASSUFFIX _
40 #endif
41 
42 /* annoying hack because some preprocessors can't handle empty macros */
43 #if defined(NOBLASSUFFIX) && NOBLASSUFFIX > 0
44 /* single or double precision */
45 #ifndef FLOAT
46 #define BLAS(x) d##x
47 #else
48 #define BLAS(x) s##x
49 #endif
50 #else
51 /* this extra indirection is needed for BLASSUFFIX to work correctly as a
52  * variable */
53 #define stitch_(pre, x, post) pre##x##post
54 #define stitch__(pre, x, post) stitch_(pre, x, post)
55 /* single or double precision */
56 #ifndef FLOAT
57 #define BLAS(x) stitch__(d, x, BLASSUFFIX)
58 #else
59 #define BLAS(x) stitch__(s, x, BLASSUFFIX)
60 #endif
61 #define LPCK BLAS
62 #endif
63 
64 #ifdef MATLAB_MEX_FILE
65 typedef ptrdiff_t blasint;
66 #elif defined BLAS64
67 #include <stdint.h>
68 typedef int64_t blasint;
69 #else
70 typedef int blasint;
71 #endif
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif /* LAPACK_LIB_FOUND */
78 
79 #endif /* SCS_BLAS_H_GUARD */