vSMC  v3.0.0
Scalable Monte Carlo
defines.h
Go to the documentation of this file.
1 //============================================================================
2 // vSMC/include/vsmc/internal/defines.h
3 //----------------------------------------------------------------------------
4 // vSMC: Scalable Monte Carlo
5 //----------------------------------------------------------------------------
6 // Copyright (c) 2013-2016, Yan Zhou
7 // All rights reserved.
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are met:
11 //
12 // Redistributions of source code must retain the above copyright notice,
13 // this list of conditions and the following disclaimer.
14 //
15 // Redistributions in binary form must reproduce the above copyright notice,
16 // this list of conditions and the following disclaimer in the documentation
17 // and/or other materials provided with the distribution.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
20 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 // POSSIBILITY OF SUCH DAMAGE.
30 //============================================================================
31 
32 #ifndef VSMC_INTERNAL_DEFINES_H
33 #define VSMC_INTERNAL_DEFINES_H
34 
35 #include <stddef.h>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
43 
45 typedef enum {
46  vSMCRowMajor = 101,
47  vSMCColMajor = 102
49 
51 typedef enum {
59 
61 typedef enum {
66 
68 typedef enum {
69  vSMCSamplerInit = 1 << 0,
70  vSMCSamplerMove = 1 << 1,
71  vSMCSamplerMCMC = 1 << 2
73 
75 typedef enum {
78 
81 
84 
87 
90 
93 
96 
99 
108 
121 
130 
139 
148 
157 
161 } vSMCRNGType;
162 
164 typedef enum {
170 
172 typedef struct {
173  void *ptr;
174  vSMCRNGType type;
175 } vsmc_rng;
176 
178 typedef struct {
179  void *ptr;
181 
183 typedef struct {
184  void *ptr;
185 } vsmc_weight;
186 
188 typedef struct {
189  double *state;
190  size_t id;
192 
194 typedef struct {
195  void *ptr;
196 } vsmc_particle;
197 
199 typedef struct {
200  void *ptr;
201 } vsmc_sampler;
202 
204 typedef struct {
205  void *ptr;
206 } vsmc_monitor;
207 
209 typedef struct {
210  void *ptr;
212 
214 typedef struct {
215  void *ptr;
217 
219 typedef size_t (*vsmc_sampler_eval_type)(size_t, vsmc_particle);
220 
222 typedef void (*vsmc_monitor_eval_type)(
223  size_t, size_t, vsmc_particle, double *);
224 
226 typedef struct {
227  size_t (*eval_sp)(size_t, vsmc_single_particle);
228  void (*eval_pre)(size_t, vsmc_particle);
229  void (*eval_post)(size_t, vsmc_particle);
231 
233 typedef struct {
234  void (*eval_sp)(size_t, size_t, vsmc_single_particle, double *);
235  void (*eval_pre)(size_t, vsmc_particle);
236  void (*eval_post)(size_t, vsmc_particle);
238 
240 
241 #ifdef __cplusplus
242 } // extern "C"
243 #endif
244 
245 #endif // VSMC_INTERNAL_DEFINES_H
vsmc::BackendSTD
Definition: defines.h:166
vsmc::Philox4x32
Definition: defines.h:101
vsmc::RDRAND16
Definition: defines.h:158
vsmc::SamplerMove
Definition: defines.h:70
vsmc::AES128x8
Definition: defines.h:125
vsmc::ARSx1
Definition: defines.h:149
void(* vsmc_monitor_eval_type)(size_t, size_t, vsmc_particle, double *)
vsmc::Monitor::eval_type
Definition: defines.h:222
vsmc::SingleParticle
Definition: defines.h:188
vsmc::AES192x8_64
Definition: defines.h:138
vsmc::RNGMini
Definition: defines.h:79
vsmc::AES128_64
Definition: defines.h:89
vsmc::RNG_64
Definition: defines.h:77
vsmc::BackendOMP
Definition: defines.h:167
size_t(* vsmc_sampler_eval_type)(size_t, vsmc_particle)
vsmc::Sampler::eval_type
Definition: defines.h:219
vsmc::AES256x8
Definition: defines.h:143
vsmc::MonitorMove
Definition: defines.h:62
vsmc::Threefry2x32
Definition: defines.h:109
vsmc::Philox2x64
Definition: defines.h:102
vsmc::ARSx8
Definition: defines.h:152
vsmc::Threefry16x64
Definition: defines.h:114
vsmc::AES192x4_64
Definition: defines.h:137
vsmc::Particle
Definition: defines.h:194
vsmc::Threefry2x64_64
Definition: defines.h:117
vsmc::Threefry8x64
Definition: defines.h:113
vsmc::AES128x1
Definition: defines.h:122
vsmc::RNG
Definition: defines.h:76
vsmc::AES256_64
Definition: defines.h:95
vsmc::Threefry16x64_64
Definition: defines.h:120
vsmc::ARS
Definition: defines.h:97
vsmc::Threefry
Definition: defines.h:85
vsmc::Threefry4x32
Definition: defines.h:110
vSMCRNGType type
Definition: defines.h:174
vSMCMonitorStage
vsmc::MonitorStage
Definition: defines.h:61
vsmc::AES128x8_64
Definition: defines.h:129
vsmc::Philox2x32_64
Definition: defines.h:104
vsmc::AES192
Definition: defines.h:91
vsmc::Threefry2x64
Definition: defines.h:111
vsmc::Philox_64
Definition: defines.h:83
vsmc::RDRAND64
Definition: defines.h:160
void * ptr
Definition: defines.h:205
vsmc::AES256x1
Definition: defines.h:140
vsmc::ARSx2
Definition: defines.h:150
vsmc::Threefry2x32_64
Definition: defines.h:115
vsmc::ResidualSystematic
Definition: defines.h:57
vsmc::ARSx8_64
Definition: defines.h:156
vsmc::Monitor
Definition: defines.h:204
void * ptr
Definition: defines.h:184
vsmc::ARSx1_64
Definition: defines.h:153
vsmc::Threefry4x64
Definition: defines.h:112
vsmc::Philox4x32_64
Definition: defines.h:105
vsmc::AES192x2_64
Definition: defines.h:136
vsmc::AES192x4
Definition: defines.h:133
vsmc::AES256x2_64
Definition: defines.h:145
vsmc::SamplerMCMC
Definition: defines.h:71
vsmc::MonitorMCMC
Definition: defines.h:64
vsmc::ColMajor
Definition: defines.h:47
vSMCBackendSMP
SMP backends.
Definition: defines.h:164
vsmc::AES192x2
Definition: defines.h:132
void * ptr
Definition: defines.h:200
vsmc::AES256
Definition: defines.h:94
vSMCSamplerStage
vsmc::SamplerStage
Definition: defines.h:68
vsmc::Philox4x64
Definition: defines.h:103
vsmc::AES192_64
Definition: defines.h:92
vsmc::AES192x1
Definition: defines.h:131
void * ptr
Definition: defines.h:173
vsmc::AES128x1_64
Definition: defines.h:126
vsmc::AES128x4
Definition: defines.h:124
vsmc::MonitorResample
Definition: defines.h:63
vsmc::RNGMini_64
Definition: defines.h:80
vsmc::Covariance<double>
Definition: defines.h:209
vsmc::Threefry4x32_64
Definition: defines.h:116
vsmc::Threefry8x64_64
Definition: defines.h:119
vsmc::Systematic
Definition: defines.h:54
vsmc::ARSx2_64
Definition: defines.h:154
vsmc::BackendSEQ
Definition: defines.h:165
vsmc::Philox2x32
Definition: defines.h:100
vSMCMatrixLayout
vsmc::MatrixLayout
Definition: defines.h:45
vsmc::ARSx4
Definition: defines.h:151
void * ptr
Definition: defines.h:210
vsmc::MonitorEvalSMP
Definition: defines.h:233
vsmc::Weight
Definition: defines.h:183
vsmc::Philox
Definition: defines.h:82
vsmc::SamplerEvalSMP
Definition: defines.h:226
vsmc::Threefry_64
Definition: defines.h:86
vsmc::AES256x1_64
Definition: defines.h:144
vsmc::AES128x4_64
Definition: defines.h:128
vsmc::ARSx4_64
Definition: defines.h:155
vSMCRNGType
RNG types.
Definition: defines.h:75
vsmc::AES256x2
Definition: defines.h:141
vsmc::SamplerInit
Definition: defines.h:69
vsmc::RDRAND32
Definition: defines.h:159
vsmc::RowMajor
Definition: defines.h:46
vsmc::Philox2x64_64
Definition: defines.h:106
vsmc::AES128x2
Definition: defines.h:123
vsmc::AES256x4_64
Definition: defines.h:146
vsmc::AES256x8_64
Definition: defines.h:147
vsmc::Sampler
Definition: defines.h:199
void * ptr
Definition: defines.h:195
void * ptr
Definition: defines.h:215
`vsmc::StateMatrix<vsmc::RowMajor, vsmc::Dynamic, double>
Definition: defines.h:178
vsmc::ARS_64
Definition: defines.h:98
vsmc::Residual
Definition: defines.h:55
vsmc::Stratified
Definition: defines.h:53
vsmc::StopWatch
Definition: defines.h:214
vsmc::AES128
Definition: defines.h:88
vSMC RNG types
Definition: defines.h:172
vsmc::Philox4x64_64
Definition: defines.h:107
vsmc::Threefry4x64_64
Definition: defines.h:118
vsmc::AES256x4
Definition: defines.h:142
vSMCResampleScheme
vsmc::ResampleScheme
Definition: defines.h:51
vsmc::AES192x8
Definition: defines.h:134
vsmc::BackendTBB
Definition: defines.h:168
vsmc::Multinomial
Definition: defines.h:52
vsmc::ResidualStratified
Definition: defines.h:56
vsmc::AES128x2_64
Definition: defines.h:127
vsmc::AES192x1_64
Definition: defines.h:135