typedef.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-2011 Conrad Sanderson
3 //
4 // This file is part of the Armadillo C++ library.
5 // It is provided without any warranty of fitness
6 // for any purpose. You can redistribute this file
7 // and/or modify it under the terms of the GNU
8 // Lesser General Public License (LGPL) as published
9 // by the Free Software Foundation, either version 3
10 // of the License or (at your option) any later version.
11 // (see http://www.opensource.org/licenses for more info)
12 
13 
16 
17 
18 #if UCHAR_MAX >= 0xff
19  typedef unsigned char u8;
21  typedef char s8;
22 #else
23  #error "don't know how to typedef 'u8' on this system"
24 #endif
25 
26 // NOTE:
27 // "signed char" is not the same as "char".
28 // http://www.embedded.com/columns/programmingpointers/206107018
29 // http://en.wikipedia.org/wiki/C_variable_types_and_declarations
30 
31 
32 #if USHRT_MAX >= 0xffff
33  typedef unsigned short u16;
35  typedef short s16;
36 #else
37  #error "don't know how to typedef 'u16' on this system"
38 #endif
39 
40 
41 #if UINT_MAX >= 0xffffffff
42  typedef unsigned int u32;
43  typedef int s32;
44 #elif ULONG_MAX >= 0xffffffff
45  typedef unsigned long u32;
46  typedef long s32;
47 #else
48  #error "don't know how to typedef 'u32' on this system"
49 #endif
50 
51 
52 #if defined(ARMA_64BIT_WORD)
53  #if ULONG_MAX >= 0xffffffffffffffff
54  typedef unsigned long u64;
55  typedef long s64;
56  #else
57  #if ULLONG_MAX >= 0xffffffffffffffff
58  typedef unsigned long long u64;
59  typedef long long s64;
60  #else
61  #error "don't know how to typedef 'u64' on this system"
62  #endif
63  #endif
64 #endif
65 
66 
67 
68 // // only supported by C++11, via #include <cstdint>, or by C99, via #include <stdint.h>
69 //
70 // typedef uint8_t u8;
71 // typedef int8_t s8;
72 //
73 // typedef uint16_t u16;
74 // typedef int16_t s16;
75 //
76 // typedef uint32_t u32;
77 // typedef int32_t s32;
78 //
79 // typedef uint64_t u64;
80 // typedef int64_t s64;
81 
82 
83 
84 #if !defined(ARMA_64BIT_WORD)
85  typedef u32 uword;
86  typedef s32 sword;
87 
88  typedef u16 uhword;
89  typedef s16 shword;
90 
91  #define ARMA_MAX_UWORD 0xffffffff
92  #define ARMA_MAX_UHWORD 0xffff
93 #else
94  typedef u64 uword;
95  typedef s64 sword;
96 
97  typedef u32 uhword;
98  typedef s32 shword;
99 
100  #define ARMA_MAX_UWORD 0xffffffffffffffff
101  #define ARMA_MAX_UHWORD 0xffffffff
102 #endif
103 
104 
105 
106 typedef std::complex<float> cx_float;
107 typedef std::complex<double> cx_double;
108 
114 
120 
126 
132 
138 
144 
150 
156 
162 
163 
164 
165 typedef void* void_ptr;
166 
167 
168 
169 namespace junk
170  {
172  {
173 
174  arma_static_check( (sizeof(u8) != 1), ERROR___TYPE_U8_HAS_UNSUPPORTED_SIZE );
175  arma_static_check( (sizeof(s8) != 1), ERROR___TYPE_S8_HAS_UNSUPPORTED_SIZE );
176 
177  arma_static_check( (sizeof(u16) != 2), ERROR___TYPE_U16_HAS_UNSUPPORTED_SIZE );
178  arma_static_check( (sizeof(s16) != 2), ERROR___TYPE_S16_HAS_UNSUPPORTED_SIZE );
179 
180  arma_static_check( (sizeof(u32) != 4), ERROR___TYPE_U32_HAS_UNSUPPORTED_SIZE );
181  arma_static_check( (sizeof(s32) != 4), ERROR___TYPE_S32_HAS_UNSUPPORTED_SIZE );
182 
183  #if defined(ARMA_64BIT_WORD)
184  arma_static_check( (sizeof(u64) != 8), ERROR___TYPE_U64_HAS_UNSUPPORTED_SIZE );
185  arma_static_check( (sizeof(s64) != 8), ERROR___TYPE_S64_HAS_UNSUPPORTED_SIZE );
186  #endif
187 
188  arma_static_check( (sizeof(float) != 4), ERROR___TYPE_FLOAT_HAS_UNSUPPORTED_SIZE );
189  arma_static_check( (sizeof(double) != 8), ERROR___TYPE_DOUBLE_HAS_UNSUPPORTED_SIZE );
190 
191  arma_static_check( (sizeof(std::complex<float>) != 8), ERROR___TYPE_COMPLEX_FLOAT_HAS_UNSUPPORTED_SIZE );
192  arma_static_check( (sizeof(std::complex<double>) != 16), ERROR___TYPE_COMPLEX_DOUBLE_HAS_UNSUPPORTED_SIZE );
193 
194  };
195  }
196 
197 
void * void_ptr
Definition: typedef.hpp:165
Col< u32 > u32_colvec
Definition: typedef.hpp:117
Col< cx_float > cx_fvec
Definition: typedef.hpp:152
Row< u32 > u32_rowvec
Definition: typedef.hpp:118
Col< uword > uvec
Definition: typedef.hpp:128
Cube< s32 > s32_cube
Definition: typedef.hpp:125
Col< cx_double > cx_vec
Definition: typedef.hpp:158
Mat< cx_double > cx_mat
Definition: typedef.hpp:157
Mat< uword > umat
Definition: typedef.hpp:127
Col< cx_float > cx_fcolvec
Definition: typedef.hpp:153
Mat< s32 > s32_mat
Definition: typedef.hpp:121
Mat< sword > imat
Definition: typedef.hpp:133
std::complex< float > cx_float
Definition: typedef.hpp:106
Mat< float > fmat
Definition: typedef.hpp:139
Row< unsigned char > uchar_rowvec
Definition: typedef.hpp:112
Mat< unsigned char > uchar_mat
Definition: typedef.hpp:109
s16 shword
Definition: typedef.hpp:89
Col< uword > ucolvec
Definition: typedef.hpp:129
u32 uword
Definition: typedef.hpp:85
Cube< uword > ucube
Definition: typedef.hpp:131
Mat< double > mat
Definition: typedef.hpp:145
Mat< u32 > u32_mat
Definition: typedef.hpp:115
Class for column vectors (matrices with only one column)
Definition: Col_bones.hpp:20
Cube< unsigned char > uchar_cube
Definition: typedef.hpp:113
Row< double > rowvec
Definition: typedef.hpp:148
Row< uword > urowvec
Definition: typedef.hpp:130
Col< float > fvec
Definition: typedef.hpp:140
Cube< float > fcube
Definition: typedef.hpp:143
Cube< u32 > u32_cube
Definition: typedef.hpp:119
Dense cube class.
Definition: Cube_bones.hpp:30
Col< unsigned char > uchar_vec
Definition: typedef.hpp:110
u16 uhword
Definition: typedef.hpp:88
Class for row vectors (matrices with only one row)
Cube< cx_double > cx_cube
Definition: typedef.hpp:161
Row< s32 > s32_rowvec
Definition: typedef.hpp:124
Col< float > fcolvec
Definition: typedef.hpp:141
Cube< sword > icube
Definition: typedef.hpp:137
Cube< double > cube
Definition: typedef.hpp:149
Col< unsigned char > uchar_colvec
Definition: typedef.hpp:111
Dense matrix class.
Row< cx_float > cx_frowvec
Definition: typedef.hpp:154
Row< float > frowvec
Definition: typedef.hpp:142
Col< double > vec
Definition: typedef.hpp:146
Col< sword > ivec
Definition: typedef.hpp:134
Col< s32 > s32_vec
Definition: typedef.hpp:122
Cube< cx_float > cx_fcube
Definition: typedef.hpp:155
s32 sword
Definition: typedef.hpp:86
Row< cx_double > cx_rowvec
Definition: typedef.hpp:160
Row< sword > irowvec
Definition: typedef.hpp:136
arma_static_check((sizeof(u8)!=1), ERROR___TYPE_U8_HAS_UNSUPPORTED_SIZE)
Col< cx_double > cx_colvec
Definition: typedef.hpp:159
Col< u32 > u32_vec
Definition: typedef.hpp:116
Col< s32 > s32_colvec
Definition: typedef.hpp:123
Col< sword > icolvec
Definition: typedef.hpp:135
std::complex< double > cx_double
Definition: typedef.hpp:107
Col< double > colvec
Definition: typedef.hpp:147
Mat< cx_float > cx_fmat
Definition: typedef.hpp:151


armadillo_matrix
Author(s):
autogenerated on Fri Apr 16 2021 02:31:59