SHOGUN  6.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
common.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 1999-2009 Soeren Sonnenburg
8  * Written (W) 1999-2008 Gunnar Raetsch
9  * Written (W) 2006 Fabio De Bona
10  * Written (W) 2006 Konrad Rieck
11  * Written (W) 2006-2008 Christian Gehl
12  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
13  */
14 
15 #ifndef __COMMON_H__
16 #define __COMMON_H__
17 
18 #include <stdlib.h>
19 #include <stdio.h>
20 #include <sys/types.h>
21 
22 #ifdef _MSC_VER
23 #define NOMINMAX
24 #include <windows.h>
25 
26 // Visual C++ accepts but does not implement when
27 // function is declared using exception specification
28 // this pragma is suppressing the compiler warning
29 #pragma warning( disable : 4290 )
30 #endif
31 
32 #include <shogun/lib/config.h>
33 
38 
39 #include <stdint.h>
40 
41 /* No feature test:
42  * ISO C99: 7.8 Format conversion of integer types <inttypes.h>
43  *
44  * If not supported make sure that your development environment is
45  * supporting ISO C99!
46  */
47 #ifdef __STDC_FORMAT_MACROS
48 #include <inttypes.h>
49 #else
50 #define __STDC_FORMAT_MACROS 1
51 #include <inttypes.h>
52 #undef __STDC_FORMAT_MACROS
53 #endif
54 
59 typedef float float32_t;
60 typedef double float64_t;
61 typedef long double floatmax_t;
62 
64 
65 #define STRING_LEN 256
66 #define STRING_LEN_STR "256"
67 typedef char string_t[STRING_LEN];
68 
69 typedef int machine_int_t;
70 
72 typedef int32_t index_t;
73 
75 #include <complex>
76 
77 typedef std::complex<float64_t> complex128_t;
78 
80 constexpr size_t CPU_CACHE_LINE_SIZE = 64;
82 
83 #ifdef _WIN32
84 #include <BaseTsd.h>
85 typedef SSIZE_T ssize_t;
86 #endif
87 
88 #ifdef _MSC_VER
89 #define SG_FORCED_INLINE __forceinline
90 #else
91 #define SG_FORCED_INLINE inline __attribute__((always_inline))
92 #endif
93 
94 #include <shogun/lib/memory.h>
95 #endif //__COMMON_H__
std::complex< float64_t > complex128_t
Definition: common.h:77
int32_t index_t
Definition: common.h:72
double float64_t
Definition: common.h:60
long double floatmax_t
Definition: common.h:61
#define STRING_LEN
Definition: common.h:65
float float32_t
Definition: common.h:59
int machine_int_t
Definition: common.h:69
constexpr size_t CPU_CACHE_LINE_SIZE
Definition: common.h:80
constexpr size_t CPU_CACHE_LINE_SIZE_BYTES
Definition: common.h:81
char string_t[STRING_LEN]
Definition: common.h:67

SHOGUN Machine Learning Toolbox - Documentation