mkl_vsl_defines.h 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114
  1. /* file: mkl_vsl_defines.h */
  2. /*******************************************************************************
  3. * Copyright 2006-2022 Intel Corporation.
  4. *
  5. * This software and the related documents are Intel copyrighted materials, and
  6. * your use of them is governed by the express license under which they were
  7. * provided to you (License). Unless the License provides otherwise, you may not
  8. * use, modify, copy, publish, distribute, disclose or transmit this software or
  9. * the related documents without Intel's prior written permission.
  10. *
  11. * This software and the related documents are provided as is, with no express
  12. * or implied warranties, other than those that are expressly stated in the
  13. * License.
  14. *******************************************************************************/
  15. /*
  16. //++
  17. // User-level macro definitions
  18. //--
  19. */
  20. #ifndef __MKL_VSL_DEFINES_H__
  21. #define __MKL_VSL_DEFINES_H__
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif /* __cplusplus */
  25. /*
  26. // "No error" status
  27. */
  28. #define VSL_STATUS_OK 0
  29. #define VSL_ERROR_OK 0
  30. /*
  31. // Common errors (-1..-999)
  32. */
  33. #define VSL_ERROR_FEATURE_NOT_IMPLEMENTED -1
  34. #define VSL_ERROR_UNKNOWN -2
  35. #define VSL_ERROR_BADARGS -3
  36. #define VSL_ERROR_MEM_FAILURE -4
  37. #define VSL_ERROR_NULL_PTR -5
  38. #define VSL_ERROR_CPU_NOT_SUPPORTED -6
  39. /*
  40. // RNG errors (-1000..-1999)
  41. */
  42. /* brng errors */
  43. #define VSL_RNG_ERROR_INVALID_BRNG_INDEX -1000
  44. #define VSL_RNG_ERROR_LEAPFROG_UNSUPPORTED -1002
  45. #define VSL_RNG_ERROR_SKIPAHEAD_UNSUPPORTED -1003
  46. #define VSL_RNG_ERROR_SKIPAHEADEX_UNSUPPORTED -1004
  47. #define VSL_RNG_ERROR_BRNGS_INCOMPATIBLE -1005
  48. #define VSL_RNG_ERROR_BAD_STREAM -1006
  49. #define VSL_RNG_ERROR_BRNG_TABLE_FULL -1007
  50. #define VSL_RNG_ERROR_BAD_STREAM_STATE_SIZE -1008
  51. #define VSL_RNG_ERROR_BAD_WORD_SIZE -1009
  52. #define VSL_RNG_ERROR_BAD_NSEEDS -1010
  53. #define VSL_RNG_ERROR_BAD_NBITS -1011
  54. #define VSL_RNG_ERROR_QRNG_PERIOD_ELAPSED -1012
  55. #define VSL_RNG_ERROR_LEAPFROG_NSTREAMS_TOO_BIG -1013
  56. #define VSL_RNG_ERROR_BRNG_NOT_SUPPORTED -1014
  57. /* abstract stream related errors */
  58. #define VSL_RNG_ERROR_BAD_UPDATE -1120
  59. #define VSL_RNG_ERROR_NO_NUMBERS -1121
  60. #define VSL_RNG_ERROR_INVALID_ABSTRACT_STREAM -1122
  61. /* non deterministic stream related errors */
  62. #define VSL_RNG_ERROR_NONDETERM_NOT_SUPPORTED -1130
  63. #define VSL_RNG_ERROR_NONDETERM_NRETRIES_EXCEEDED -1131
  64. /* ARS5 stream related errors */
  65. #define VSL_RNG_ERROR_ARS5_NOT_SUPPORTED -1140
  66. /* Multinomial distribution probability array related errors */
  67. #define VSL_DISTR_MULTINOMIAL_BAD_PROBABILITY_ARRAY -1150
  68. /* read/write stream to file errors */
  69. #define VSL_RNG_ERROR_FILE_CLOSE -1100
  70. #define VSL_RNG_ERROR_FILE_OPEN -1101
  71. #define VSL_RNG_ERROR_FILE_WRITE -1102
  72. #define VSL_RNG_ERROR_FILE_READ -1103
  73. #define VSL_RNG_ERROR_BAD_FILE_FORMAT -1110
  74. #define VSL_RNG_ERROR_UNSUPPORTED_FILE_VER -1111
  75. #define VSL_RNG_ERROR_BAD_MEM_FORMAT -1200
  76. /* Convolution/correlation errors */
  77. #define VSL_CC_ERROR_NOT_IMPLEMENTED (-2000)
  78. #define VSL_CC_ERROR_ALLOCATION_FAILURE (-2001)
  79. #define VSL_CC_ERROR_BAD_DESCRIPTOR (-2200)
  80. #define VSL_CC_ERROR_SERVICE_FAILURE (-2210)
  81. #define VSL_CC_ERROR_EDIT_FAILURE (-2211)
  82. #define VSL_CC_ERROR_EDIT_PROHIBITED (-2212)
  83. #define VSL_CC_ERROR_COMMIT_FAILURE (-2220)
  84. #define VSL_CC_ERROR_COPY_FAILURE (-2230)
  85. #define VSL_CC_ERROR_DELETE_FAILURE (-2240)
  86. #define VSL_CC_ERROR_BAD_ARGUMENT (-2300)
  87. #define VSL_CC_ERROR_DIMS (-2301)
  88. #define VSL_CC_ERROR_START (-2302)
  89. #define VSL_CC_ERROR_DECIMATION (-2303)
  90. #define VSL_CC_ERROR_XSHAPE (-2311)
  91. #define VSL_CC_ERROR_YSHAPE (-2312)
  92. #define VSL_CC_ERROR_ZSHAPE (-2313)
  93. #define VSL_CC_ERROR_XSTRIDE (-2321)
  94. #define VSL_CC_ERROR_YSTRIDE (-2322)
  95. #define VSL_CC_ERROR_ZSTRIDE (-2323)
  96. #define VSL_CC_ERROR_X (-2331)
  97. #define VSL_CC_ERROR_Y (-2332)
  98. #define VSL_CC_ERROR_Z (-2333)
  99. #define VSL_CC_ERROR_JOB (-2100)
  100. #define VSL_CC_ERROR_KIND (-2110)
  101. #define VSL_CC_ERROR_MODE (-2120)
  102. #define VSL_CC_ERROR_TYPE (-2130)
  103. #define VSL_CC_ERROR_PRECISION (-2140)
  104. #define VSL_CC_ERROR_EXTERNAL_PRECISION (-2141)
  105. #define VSL_CC_ERROR_INTERNAL_PRECISION (-2142)
  106. #define VSL_CC_ERROR_METHOD (-2400)
  107. #define VSL_CC_ERROR_OTHER (-2800)
  108. /*
  109. //++
  110. // SUMMARY STATTISTICS ERROR/WARNING CODES
  111. //--
  112. */
  113. /*
  114. // Warnings
  115. */
  116. #define VSL_SS_NOT_FULL_RANK_MATRIX 4028
  117. #define VSL_SS_SEMIDEFINITE_COR 4029
  118. /*
  119. // Errors (-4000..-4999)
  120. */
  121. #define VSL_SS_ERROR_ALLOCATION_FAILURE -4000
  122. #define VSL_SS_ERROR_BAD_DIMEN -4001
  123. #define VSL_SS_ERROR_BAD_OBSERV_N -4002
  124. #define VSL_SS_ERROR_STORAGE_NOT_SUPPORTED -4003
  125. #define VSL_SS_ERROR_BAD_INDC_ADDR -4004
  126. #define VSL_SS_ERROR_BAD_WEIGHTS -4005
  127. #define VSL_SS_ERROR_BAD_MEAN_ADDR -4006
  128. #define VSL_SS_ERROR_BAD_2R_MOM_ADDR -4007
  129. #define VSL_SS_ERROR_BAD_3R_MOM_ADDR -4008
  130. #define VSL_SS_ERROR_BAD_4R_MOM_ADDR -4009
  131. #define VSL_SS_ERROR_BAD_2C_MOM_ADDR -4010
  132. #define VSL_SS_ERROR_BAD_3C_MOM_ADDR -4011
  133. #define VSL_SS_ERROR_BAD_4C_MOM_ADDR -4012
  134. #define VSL_SS_ERROR_BAD_KURTOSIS_ADDR -4013
  135. #define VSL_SS_ERROR_BAD_SKEWNESS_ADDR -4014
  136. #define VSL_SS_ERROR_BAD_MIN_ADDR -4015
  137. #define VSL_SS_ERROR_BAD_MAX_ADDR -4016
  138. #define VSL_SS_ERROR_BAD_VARIATION_ADDR -4017
  139. #define VSL_SS_ERROR_BAD_COV_ADDR -4018
  140. #define VSL_SS_ERROR_BAD_COR_ADDR -4019
  141. #define VSL_SS_ERROR_BAD_ACCUM_WEIGHT_ADDR -4020
  142. #define VSL_SS_ERROR_BAD_QUANT_ORDER_ADDR -4021
  143. #define VSL_SS_ERROR_BAD_QUANT_ORDER -4022
  144. #define VSL_SS_ERROR_BAD_QUANT_ADDR -4023
  145. #define VSL_SS_ERROR_BAD_ORDER_STATS_ADDR -4024
  146. #define VSL_SS_ERROR_MOMORDER_NOT_SUPPORTED -4025
  147. #define VSL_SS_ERROR_ALL_OBSERVS_OUTLIERS -4026
  148. #define VSL_SS_ERROR_BAD_ROBUST_COV_ADDR -4027
  149. #define VSL_SS_ERROR_BAD_ROBUST_MEAN_ADDR -4028
  150. #define VSL_SS_ERROR_METHOD_NOT_SUPPORTED -4029
  151. #define VSL_SS_ERROR_BAD_GROUP_INDC_ADDR -4030
  152. #define VSL_SS_ERROR_NULL_TASK_DESCRIPTOR -4031
  153. #define VSL_SS_ERROR_BAD_OBSERV_ADDR -4032
  154. #define VSL_SS_ERROR_SINGULAR_COV -4033
  155. #define VSL_SS_ERROR_BAD_POOLED_COV_ADDR -4034
  156. #define VSL_SS_ERROR_BAD_POOLED_MEAN_ADDR -4035
  157. #define VSL_SS_ERROR_BAD_GROUP_COV_ADDR -4036
  158. #define VSL_SS_ERROR_BAD_GROUP_MEAN_ADDR -4037
  159. #define VSL_SS_ERROR_BAD_GROUP_INDC -4038
  160. #define VSL_SS_ERROR_BAD_OUTLIERS_PARAMS_ADDR -4039
  161. #define VSL_SS_ERROR_BAD_OUTLIERS_PARAMS_N_ADDR -4040
  162. #define VSL_SS_ERROR_BAD_OUTLIERS_WEIGHTS_ADDR -4041
  163. #define VSL_SS_ERROR_BAD_ROBUST_COV_PARAMS_ADDR -4042
  164. #define VSL_SS_ERROR_BAD_ROBUST_COV_PARAMS_N_ADDR -4043
  165. #define VSL_SS_ERROR_BAD_STORAGE_ADDR -4044
  166. #define VSL_SS_ERROR_BAD_PARTIAL_COV_IDX_ADDR -4045
  167. #define VSL_SS_ERROR_BAD_PARTIAL_COV_ADDR -4046
  168. #define VSL_SS_ERROR_BAD_PARTIAL_COR_ADDR -4047
  169. #define VSL_SS_ERROR_BAD_MI_PARAMS_ADDR -4048
  170. #define VSL_SS_ERROR_BAD_MI_PARAMS_N_ADDR -4049
  171. #define VSL_SS_ERROR_BAD_MI_BAD_PARAMS_N -4050
  172. #define VSL_SS_ERROR_BAD_MI_PARAMS -4051
  173. #define VSL_SS_ERROR_BAD_MI_INIT_ESTIMATES_N_ADDR -4052
  174. #define VSL_SS_ERROR_BAD_MI_INIT_ESTIMATES_ADDR -4053
  175. #define VSL_SS_ERROR_BAD_MI_SIMUL_VALS_ADDR -4054
  176. #define VSL_SS_ERROR_BAD_MI_SIMUL_VALS_N_ADDR -4055
  177. #define VSL_SS_ERROR_BAD_MI_ESTIMATES_N_ADDR -4056
  178. #define VSL_SS_ERROR_BAD_MI_ESTIMATES_ADDR -4057
  179. #define VSL_SS_ERROR_BAD_MI_SIMUL_VALS_N -4058
  180. #define VSL_SS_ERROR_BAD_MI_ESTIMATES_N -4059
  181. #define VSL_SS_ERROR_BAD_MI_OUTPUT_PARAMS -4060
  182. #define VSL_SS_ERROR_BAD_MI_PRIOR_N_ADDR -4061
  183. #define VSL_SS_ERROR_BAD_MI_PRIOR_ADDR -4062
  184. #define VSL_SS_ERROR_BAD_MI_MISSING_VALS_N -4063
  185. #define VSL_SS_ERROR_BAD_STREAM_QUANT_PARAMS_N_ADDR -4064
  186. #define VSL_SS_ERROR_BAD_STREAM_QUANT_PARAMS_ADDR -4065
  187. #define VSL_SS_ERROR_BAD_STREAM_QUANT_PARAMS_N -4066
  188. #define VSL_SS_ERROR_BAD_STREAM_QUANT_PARAMS -4067
  189. #define VSL_SS_ERROR_BAD_STREAM_QUANT_ORDER_ADDR -4068
  190. #define VSL_SS_ERROR_BAD_STREAM_QUANT_ORDER -4069
  191. #define VSL_SS_ERROR_BAD_STREAM_QUANT_ADDR -4070
  192. #define VSL_SS_ERROR_BAD_PARAMTR_COR_ADDR -4071
  193. #define VSL_SS_ERROR_BAD_COR -4072
  194. #define VSL_SS_ERROR_BAD_PARTIAL_COV_IDX -4073
  195. #define VSL_SS_ERROR_BAD_SUM_ADDR -4074
  196. #define VSL_SS_ERROR_BAD_2R_SUM_ADDR -4075
  197. #define VSL_SS_ERROR_BAD_3R_SUM_ADDR -4076
  198. #define VSL_SS_ERROR_BAD_4R_SUM_ADDR -4077
  199. #define VSL_SS_ERROR_BAD_2C_SUM_ADDR -4078
  200. #define VSL_SS_ERROR_BAD_3C_SUM_ADDR -4079
  201. #define VSL_SS_ERROR_BAD_4C_SUM_ADDR -4080
  202. #define VSL_SS_ERROR_BAD_CP_ADDR -4081
  203. #define VSL_SS_ERROR_BAD_MDAD_ADDR -4082
  204. #define VSL_SS_ERROR_BAD_MNAD_ADDR -4083
  205. #define VSL_SS_ERROR_BAD_SORTED_OBSERV_ADDR -4084
  206. #define VSL_SS_ERROR_INDICES_NOT_SUPPORTED -4085
  207. /*
  208. // Internal errors caused by internal routines of the functions
  209. */
  210. #define VSL_SS_ERROR_ROBCOV_INTERN_C1 -5000
  211. #define VSL_SS_ERROR_PARTIALCOV_INTERN_C1 -5010
  212. #define VSL_SS_ERROR_PARTIALCOV_INTERN_C2 -5011
  213. #define VSL_SS_ERROR_MISSINGVALS_INTERN_C1 -5021
  214. #define VSL_SS_ERROR_MISSINGVALS_INTERN_C2 -5022
  215. #define VSL_SS_ERROR_MISSINGVALS_INTERN_C3 -5023
  216. #define VSL_SS_ERROR_MISSINGVALS_INTERN_C4 -5024
  217. #define VSL_SS_ERROR_MISSINGVALS_INTERN_C5 -5025
  218. #define VSL_SS_ERROR_PARAMTRCOR_INTERN_C1 -5030
  219. #define VSL_SS_ERROR_COVRANK_INTERNAL_ERROR_C1 -5040
  220. #define VSL_SS_ERROR_INVCOV_INTERNAL_ERROR_C1 -5041
  221. #define VSL_SS_ERROR_INVCOV_INTERNAL_ERROR_C2 -5042
  222. /*
  223. // CONV/CORR RELATED MACRO DEFINITIONS
  224. */
  225. #define VSL_CONV_MODE_AUTO 0
  226. #define VSL_CORR_MODE_AUTO 0
  227. #define VSL_CONV_MODE_DIRECT 1
  228. #define VSL_CORR_MODE_DIRECT 1
  229. #define VSL_CONV_MODE_FFT 2
  230. #define VSL_CORR_MODE_FFT 2
  231. #define VSL_CONV_PRECISION_SINGLE 1
  232. #define VSL_CORR_PRECISION_SINGLE 1
  233. #define VSL_CONV_PRECISION_DOUBLE 2
  234. #define VSL_CORR_PRECISION_DOUBLE 2
  235. /*
  236. //++
  237. // BASIC RANDOM NUMBER GENERATOR (BRNG) RELATED MACRO DEFINITIONS
  238. //--
  239. */
  240. /*
  241. // MAX NUMBER OF BRNGS CAN BE REGISTERED IN VSL
  242. // No more than VSL_MAX_REG_BRNGS basic generators can be registered in VSL
  243. // (including predefined basic generators).
  244. //
  245. // Change this number to increase/decrease number of BRNGs can be registered.
  246. */
  247. #define VSL_MAX_REG_BRNGS 512
  248. /*
  249. // PREDEFINED BRNG NAMES
  250. */
  251. #define VSL_BRNG_SHIFT 20
  252. #define VSL_BRNG_INC (1<<VSL_BRNG_SHIFT)
  253. #define VSL_BRNG_MCG31 (VSL_BRNG_INC)
  254. #define VSL_BRNG_R250 (VSL_BRNG_MCG31 +VSL_BRNG_INC)
  255. #define VSL_BRNG_MRG32K3A (VSL_BRNG_R250 +VSL_BRNG_INC)
  256. #define VSL_BRNG_MCG59 (VSL_BRNG_MRG32K3A +VSL_BRNG_INC)
  257. #define VSL_BRNG_WH (VSL_BRNG_MCG59 +VSL_BRNG_INC)
  258. #define VSL_BRNG_SOBOL (VSL_BRNG_WH +VSL_BRNG_INC)
  259. #define VSL_BRNG_NIEDERR (VSL_BRNG_SOBOL +VSL_BRNG_INC)
  260. #define VSL_BRNG_MT19937 (VSL_BRNG_NIEDERR +VSL_BRNG_INC)
  261. #define VSL_BRNG_MT2203 (VSL_BRNG_MT19937 +VSL_BRNG_INC)
  262. #define VSL_BRNG_IABSTRACT (VSL_BRNG_MT2203 +VSL_BRNG_INC)
  263. #define VSL_BRNG_DABSTRACT (VSL_BRNG_IABSTRACT+VSL_BRNG_INC)
  264. #define VSL_BRNG_SABSTRACT (VSL_BRNG_DABSTRACT+VSL_BRNG_INC)
  265. #define VSL_BRNG_SFMT19937 (VSL_BRNG_SABSTRACT+VSL_BRNG_INC)
  266. #define VSL_BRNG_NONDETERM (VSL_BRNG_SFMT19937+VSL_BRNG_INC)
  267. #define VSL_BRNG_ARS5 (VSL_BRNG_NONDETERM+VSL_BRNG_INC)
  268. #define VSL_BRNG_PHILOX4X32X10 (VSL_BRNG_ARS5 +VSL_BRNG_INC)
  269. /*
  270. // PREDEFINED PARAMETERS FOR NON-DETERMNINISTIC RANDOM NUMBER
  271. // GENERATOR
  272. // The library provides an abstraction to the source of non-deterministic
  273. // random numbers supported in HW. Current version of the library provides
  274. // interface to RDRAND-based only, available in latest Intel CPU.
  275. */
  276. #define VSL_BRNG_RDRAND 0x0
  277. #define VSL_BRNG_NONDETERM_NRETRIES 10
  278. /*
  279. // LEAPFROG METHOD FOR GRAY-CODE BASED QUASI-RANDOM NUMBER BASIC GENERATORS
  280. // VSL_BRNG_SOBOL and VSL_BRNG_NIEDERR are Gray-code based quasi-random number
  281. // basic generators. In contrast to pseudorandom number basic generators,
  282. // quasi-random ones take the dimension as initialization parameter.
  283. //
  284. // Suppose that quasi-random number generator (QRNG) dimension is S. QRNG
  285. // sequence is a sequence of S-dimensional vectors:
  286. //
  287. // x0=(x0[0],x0[1],...,x0[S-1]),x1=(x1[0],x1[1],...,x1[S-1]),...
  288. //
  289. // VSL treats the output of any basic generator as 1-dimensional, however:
  290. //
  291. // x0[0],x0[1],...,x0[S-1],x1[0],x1[1],...,x1[S-1],...
  292. //
  293. // Because of nature of VSL_BRNG_SOBOL and VSL_BRNG_NIEDERR QRNGs,
  294. // the only S-stride Leapfrog method is supported for them. In other words,
  295. // user can generate subsequences, which consist of fixed elements of
  296. // vectors x0,x1,... For example, if 0 element is fixed, the following
  297. // subsequence is generated:
  298. //
  299. // x0[1],x1[1],x2[1],...
  300. //
  301. // To use the s-stride Leapfrog method with given QRNG, user should call
  302. // vslLeapfrogStream function with parameter k equal to element to be fixed
  303. // (0<=k<S) and parameter nstreams equal to VSL_QRNG_LEAPFROG_COMPONENTS.
  304. */
  305. #define VSL_QRNG_LEAPFROG_COMPONENTS 0x7fffffff
  306. /*
  307. // USER-DEFINED PARAMETERS FOR QUASI-RANDOM NUMBER BASIC GENERATORS
  308. // VSL_BRNG_SOBOL and VSL_BRNG_NIEDERR are Gray-code based quasi-random
  309. // number basic generators. Default parameters of the generators
  310. // support generation of quasi-random number vectors of dimensions
  311. // S<=40 for SOBOL and S<=318 for NIEDERRITER. The library provides
  312. // opportunity to register user-defined initial values for the
  313. // generators and generate quasi-random vectors of desirable dimension.
  314. // There is also opportunity to register user-defined parameters for
  315. // default dimensions and obtain another sequence of quasi-random vectors.
  316. // Service function vslNewStreamEx is used to pass the parameters to
  317. // the library. Data are packed into array params, parameter of the routine.
  318. // First element of the array is used for dimension S, second element
  319. // contains indicator, VSL_USER_QRNG_INITIAL_VALUES, of user-defined
  320. // parameters for quasi-random number generators.
  321. // Macros VSL_USER_PRIMITIVE_POLYMS and VSL_USER_INIT_DIRECTION_NUMBERS
  322. // are used to describe which data are passed to SOBOL QRNG and
  323. // VSL_USER_IRRED_POLYMS - which data are passed to NIEDERRITER QRNG.
  324. // For example, to demonstrate that both primitive polynomials and initial
  325. // direction numbers are passed in SOBOL one should set third element of the
  326. // array params to VSL_USER_PRIMITIVE_POLYMS | VSL_USER_DIRECTION_NUMBERS.
  327. // Macro VSL_QRNG_OVERRIDE_1ST_DIM_INIT is used to override default
  328. // initialization for the first dimension. Macro VSL_USER_DIRECTION_NUMBERS
  329. // is used when direction numbers calculated on the user side are passed
  330. // into the generators. More detailed description of interface for
  331. // registration of user-defined QRNG initial parameters can be found
  332. // in VslNotes.pdf.
  333. */
  334. #define VSL_USER_QRNG_INITIAL_VALUES 0x1
  335. #define VSL_USER_PRIMITIVE_POLYMS 0x1
  336. #define VSL_USER_INIT_DIRECTION_NUMBERS 0x2
  337. #define VSL_USER_IRRED_POLYMS 0x1
  338. #define VSL_USER_DIRECTION_NUMBERS 0x4
  339. #define VSL_QRNG_OVERRIDE_1ST_DIM_INIT 0x8
  340. /*
  341. // INITIALIZATION METHODS FOR USER-DESIGNED BASIC RANDOM NUMBER GENERATORS.
  342. // Each BRNG must support at least VSL_INIT_METHOD_STANDARD initialization
  343. // method. In addition, VSL_INIT_METHOD_LEAPFROG, VSL_INIT_METHOD_SKIPAHEAD and
  344. // VSL_INIT_METHOD_SKIPAHEADEX initialization methods can be supported.
  345. //
  346. // If VSL_INIT_METHOD_LEAPFROG is not supported then initialization routine
  347. // must return VSL_RNG_ERROR_LEAPFROG_UNSUPPORTED error code.
  348. //
  349. // If VSL_INIT_METHOD_SKIPAHEAD is not supported then initialization routine
  350. // must return VSL_RNG_ERROR_SKIPAHEAD_UNSUPPORTED error code.
  351. //
  352. // If VSL_INIT_METHOD_SKIPAHEADEX is not supported then initialization routine
  353. // must return VSL_RNG_ERROR_SKIPAHEADEX_UNSUPPORTED error code.
  354. //
  355. // If there is no error during initialization, the initialization routine must
  356. // return VSL_ERROR_OK code.
  357. */
  358. #define VSL_INIT_METHOD_STANDARD 0
  359. #define VSL_INIT_METHOD_LEAPFROG 1
  360. #define VSL_INIT_METHOD_SKIPAHEAD 2
  361. #define VSL_INIT_METHOD_SKIPAHEADEX 3
  362. /*
  363. //++
  364. // ACCURACY FLAG FOR DISTRIBUTION GENERATORS
  365. // This flag defines mode of random number generation.
  366. // If accuracy mode is set distribution generators will produce
  367. // numbers lying exactly within definitional domain for all values
  368. // of distribution parameters. In this case slight performance
  369. // degradation is expected. By default accuracy mode is switched off
  370. // admitting random numbers to be out of the definitional domain for
  371. // specific values of distribution parameters.
  372. // This macro is used to form names for accuracy versions of
  373. // distribution number generators
  374. //--
  375. */
  376. #define VSL_RNG_METHOD_ACCURACY_FLAG (1<<30)
  377. /*
  378. //++
  379. // TRANSFORMATION METHOD NAMES FOR DISTRIBUTION RANDOM NUMBER GENERATORS
  380. // VSL interface allows more than one generation method in a distribution
  381. // transformation subroutine. Following macro definitions are used to
  382. // specify generation method for given distribution generator.
  383. //
  384. // Method name macro is constructed as
  385. //
  386. // VSL_RNG_METHOD_<Distribution>_<Method>
  387. //
  388. // where
  389. //
  390. // <Distribution> - probability distribution
  391. // <Method> - method name
  392. //
  393. // VSL_RNG_METHOD_<Distribution>_<Method> should be used with
  394. // vsl<precision>Rng<Distribution> function only, where
  395. //
  396. // <precision> - s (single) or d (double)
  397. // <Distribution> - probability distribution
  398. //--
  399. */
  400. /*
  401. // Uniform
  402. //
  403. // <Method> <Short Description>
  404. // STD standard method. Currently there is only one method for this
  405. // distribution generator
  406. */
  407. #define VSL_RNG_METHOD_UNIFORM_STD 0 /* vsl{s,d,i}RngUniform */
  408. #define VSL_RNG_METHOD_UNIFORM_STD_ACCURATE \
  409. VSL_RNG_METHOD_UNIFORM_STD | VSL_RNG_METHOD_ACCURACY_FLAG
  410. /* accurate mode of vsl{d,s}RngUniform */
  411. /*
  412. // Uniform Bits
  413. //
  414. // <Method> <Short Description>
  415. // STD standard method. Currently there is only one method for this
  416. // distribution generator
  417. */
  418. #define VSL_RNG_METHOD_UNIFORMBITS_STD 0 /* vsliRngUniformBits */
  419. /*
  420. // Uniform Bits 32
  421. //
  422. // <Method> <Short Description>
  423. // STD standard method. Currently there is only one method for this
  424. // distribution generator
  425. */
  426. #define VSL_RNG_METHOD_UNIFORMBITS32_STD 0 /* vsliRngUniformBits32 */
  427. /*
  428. // Uniform Bits 64
  429. //
  430. // <Method> <Short Description>
  431. // STD standard method. Currently there is only one method for this
  432. // distribution generator
  433. */
  434. #define VSL_RNG_METHOD_UNIFORMBITS64_STD 0 /* vsliRngUniformBits64 */
  435. /*
  436. // Gaussian
  437. //
  438. // <Method> <Short Description>
  439. // BOXMULLER generates normally distributed random number x thru the pair of
  440. // uniformly distributed numbers u1 and u2 according to the formula:
  441. //
  442. // x=sqrt(-ln(u1))*sin(2*Pi*u2)
  443. //
  444. // BOXMULLER2 generates pair of normally distributed random numbers x1 and x2
  445. // thru the pair of uniformly dustributed numbers u1 and u2
  446. // according to the formula
  447. //
  448. // x1=sqrt(-ln(u1))*sin(2*Pi*u2)
  449. // x2=sqrt(-ln(u1))*cos(2*Pi*u2)
  450. //
  451. // NOTE: implementation correctly works with odd vector lengths
  452. //
  453. // ICDF inverse cumulative distribution function method
  454. */
  455. #define VSL_RNG_METHOD_GAUSSIAN_BOXMULLER 0 /* vsl{d,s}RngGaussian */
  456. #define VSL_RNG_METHOD_GAUSSIAN_BOXMULLER2 1 /* vsl{d,s}RngGaussian */
  457. #define VSL_RNG_METHOD_GAUSSIAN_ICDF 2 /* vsl{d,s}RngGaussian */
  458. /*
  459. // GaussianMV - multivariate (correlated) normal
  460. // Multivariate (correlated) normal random number generator is based on
  461. // uncorrelated Gaussian random number generator (see vslsRngGaussian and
  462. // vsldRngGaussian functions):
  463. //
  464. // <Method> <Short Description>
  465. // BOXMULLER generates normally distributed random number x thru the pair of
  466. // uniformly distributed numbers u1 and u2 according to the formula:
  467. //
  468. // x=sqrt(-ln(u1))*sin(2*Pi*u2)
  469. //
  470. // BOXMULLER2 generates pair of normally distributed random numbers x1 and x2
  471. // thru the pair of uniformly dustributed numbers u1 and u2
  472. // according to the formula
  473. //
  474. // x1=sqrt(-ln(u1))*sin(2*Pi*u2)
  475. // x2=sqrt(-ln(u1))*cos(2*Pi*u2)
  476. //
  477. // NOTE: implementation correctly works with odd vector lengths
  478. //
  479. // ICDF inverse cumulative distribution function method
  480. */
  481. #define VSL_RNG_METHOD_GAUSSIANMV_BOXMULLER 0 /* vsl{d,s}RngGaussianMV */
  482. #define VSL_RNG_METHOD_GAUSSIANMV_BOXMULLER2 1 /* vsl{d,s}RngGaussianMV */
  483. #define VSL_RNG_METHOD_GAUSSIANMV_ICDF 2 /* vsl{d,s}RngGaussianMV */
  484. /*
  485. // Exponential
  486. //
  487. // <Method> <Short Description>
  488. // ICDF inverse cumulative distribution function method
  489. */
  490. #define VSL_RNG_METHOD_EXPONENTIAL_ICDF 0 /* vsl{d,s}RngExponential */
  491. #define VSL_RNG_METHOD_EXPONENTIAL_ICDF_ACCURATE \
  492. VSL_RNG_METHOD_EXPONENTIAL_ICDF | VSL_RNG_METHOD_ACCURACY_FLAG
  493. /* accurate mode of vsl{d,s}RngExponential */
  494. /*
  495. // Laplace
  496. //
  497. // <Method> <Short Description>
  498. // ICDF inverse cumulative distribution function method
  499. //
  500. // ICDF - inverse cumulative distribution function method:
  501. //
  502. // x=+/-ln(u) with probability 1/2,
  503. //
  504. // where
  505. //
  506. // x - random number with Laplace distribution,
  507. // u - uniformly distributed random number
  508. */
  509. #define VSL_RNG_METHOD_LAPLACE_ICDF 0 /* vsl{d,s}RngLaplace */
  510. /*
  511. // Weibull
  512. //
  513. // <Method> <Short Description>
  514. // ICDF inverse cumulative distribution function method
  515. */
  516. #define VSL_RNG_METHOD_WEIBULL_ICDF 0 /* vsl{d,s}RngWeibull */
  517. #define VSL_RNG_METHOD_WEIBULL_ICDF_ACCURATE \
  518. VSL_RNG_METHOD_WEIBULL_ICDF | VSL_RNG_METHOD_ACCURACY_FLAG
  519. /* accurate mode of vsl{d,s}RngWeibull */
  520. /*
  521. // Cauchy
  522. //
  523. // <Method> <Short Description>
  524. // ICDF inverse cumulative distribution function method
  525. */
  526. #define VSL_RNG_METHOD_CAUCHY_ICDF 0 /* vsl{d,s}RngCauchy */
  527. /*
  528. // Rayleigh
  529. //
  530. // <Method> <Short Description>
  531. // ICDF inverse cumulative distribution function method
  532. */
  533. #define VSL_RNG_METHOD_RAYLEIGH_ICDF 0 /* vsl{d,s}RngRayleigh */
  534. #define VSL_RNG_METHOD_RAYLEIGH_ICDF_ACCURATE \
  535. VSL_RNG_METHOD_RAYLEIGH_ICDF | VSL_RNG_METHOD_ACCURACY_FLAG
  536. /* accurate mode of vsl{d,s}RngRayleigh */
  537. /*
  538. // Lognormal
  539. //
  540. // <Method> <Short Description>
  541. // BOXMULLER2 Box-Muller 2 algorithm based method
  542. */
  543. #define VSL_RNG_METHOD_LOGNORMAL_BOXMULLER2 0 /* vsl{d,s}RngLognormal */
  544. #define VSL_RNG_METHOD_LOGNORMAL_ICDF 1 /* vsl{d,s}RngLognormal */
  545. #define VSL_RNG_METHOD_LOGNORMAL_BOXMULLER2_ACCURATE \
  546. VSL_RNG_METHOD_LOGNORMAL_BOXMULLER2 | VSL_RNG_METHOD_ACCURACY_FLAG
  547. /* accurate mode of vsl{d,s}RngLognormal */
  548. #define VSL_RNG_METHOD_LOGNORMAL_ICDF_ACCURATE \
  549. VSL_RNG_METHOD_LOGNORMAL_ICDF | VSL_RNG_METHOD_ACCURACY_FLAG
  550. /* accurate mode of vsl{d,s}RngLognormal */
  551. /*
  552. // Gumbel
  553. //
  554. // <Method> <Short Description>
  555. // ICDF inverse cumulative distribution function method
  556. */
  557. #define VSL_RNG_METHOD_GUMBEL_ICDF 0 /* vsl{d,s}RngGumbel */
  558. /*
  559. // Gamma
  560. //
  561. // Comments:
  562. // alpha>1 - algorithm of Marsaglia is used, nonlinear
  563. // transformation of gaussian numbers based on
  564. // acceptance/rejection method with squeezes;
  565. // alpha>=0.6, alpha<1 - rejection from the Weibull distribution is used;
  566. // alpha<0.6 - transformation of exponential power distribution
  567. // (EPD) is used, EPD random numbers are generated
  568. // by means of acceptance/rejection technique;
  569. // alpha=1 - gamma distribution reduces to exponential
  570. // distribution
  571. */
  572. #define VSL_RNG_METHOD_GAMMA_GNORM 0 /* vsl{d,s}RngGamma */
  573. #define VSL_RNG_METHOD_GAMMA_GNORM_ACCURATE \
  574. VSL_RNG_METHOD_GAMMA_GNORM | VSL_RNG_METHOD_ACCURACY_FLAG
  575. /* accurate mode of vsl{d,s}RngGamma */
  576. /*
  577. // Beta
  578. //
  579. // Comments:
  580. // CJA - stands for first letters of Cheng, Johnk, and Atkinson.
  581. // Cheng - for min(p,q) > 1 method of Cheng,
  582. // generation of beta random numbers of the second kind
  583. // based on acceptance/rejection technique and its
  584. // transformation to beta random numbers of the first kind;
  585. // Johnk - for max(p,q) < 1 methods of Johnk and Atkinson:
  586. // if q + K*p^2+C<=0, K=0.852..., C=-0.956...
  587. // algorithm of Johnk:
  588. // beta distributed random number is generated as
  589. // u1^(1/p) / (u1^(1/p)+u2^(1/q)), if u1^(1/p)+u2^(1/q)<=1;
  590. // otherwise switching algorithm of Atkinson: interval (0,1)
  591. // is divided into two domains (0,t) and (t,1), on each interval
  592. // acceptance/rejection technique with convenient majorizing
  593. // function is used;
  594. // Atkinson - for min(p,q)<1, max(p,q)>1 switching algorithm of Atkinson
  595. // is used (with another point t, see short description above);
  596. // ICDF - inverse cumulative distribution function method according
  597. // to formulas x=1-u^(1/q) for p = 1, and x = u^(1/p) for q=1,
  598. // where x is beta distributed random number,
  599. // u - uniformly distributed random number.
  600. // for p=q=1 beta distribution reduces to uniform distribution.
  601. //
  602. */
  603. #define VSL_RNG_METHOD_BETA_CJA 0 /* vsl{d,s}RngBeta */
  604. #define VSL_RNG_METHOD_BETA_CJA_ACCURATE \
  605. VSL_RNG_METHOD_BETA_CJA | VSL_RNG_METHOD_ACCURACY_FLAG
  606. /* accurate mode of vsl{d,s}RngBeta */
  607. /*
  608. // ChiSquare
  609. //
  610. // Comments:
  611. // v = 1, v = 3 - chi-square distributed random number is
  612. // generated as a sum of squares of v independent
  613. // normal random numbers;
  614. // v is even and v = 16 - chi-square distributed random number is
  615. // generated using the following formula:
  616. // x = -2*ln(u[0]*...*u[v/2-1]),
  617. // where u[i] - random numbers uniformly
  618. // distributed over the interval (0,1);
  619. // v > 16, v is odd and v > 3 - chi-square distribution reduces to gamma
  620. // distribution;
  621. */
  622. #define VSL_RNG_METHOD_CHISQUARE_CHI2GAMMA 0 /* vsl{d,s}RngChiSquare */
  623. /*
  624. // Bernoulli
  625. //
  626. // <Method> <Short Description>
  627. // ICDF inverse cumulative distribution function method
  628. */
  629. #define VSL_RNG_METHOD_BERNOULLI_ICDF 0 /* vsliRngBernoulli */
  630. /*
  631. // Geometric
  632. //
  633. // <Method> <Short Description>
  634. // ICDF inverse cumulative distribution function method
  635. */
  636. #define VSL_RNG_METHOD_GEOMETRIC_ICDF 0 /* vsliRngGeometric */
  637. /*
  638. // Binomial
  639. //
  640. // <Method> <Short Description>
  641. // BTPE for ntrial*min(p,1-p)>30 acceptance/rejection method with
  642. // decomposition onto 4 regions:
  643. //
  644. // * 2 parallelograms;
  645. // * triangle;
  646. // * left exponential tail;
  647. // * right exponential tail.
  648. //
  649. // otherwise table lookup method is used
  650. */
  651. #define VSL_RNG_METHOD_BINOMIAL_BTPE 0 /* vsliRngBinomial */
  652. /*
  653. // Multinomial
  654. //
  655. // <Method> <Short Description>
  656. // MULTPOISSON Poisson Approximation of Multinomial Distribution method
  657. */
  658. #define VSL_RNG_METHOD_MULTINOMIAL_MULTPOISSON 0 /* vsliRngMultinomial */
  659. /*
  660. // Hypergeometric
  661. //
  662. // <Method> <Short Description>
  663. // H2PE if mode of distribution is large, acceptance/rejection method is
  664. // used with decomposition onto 3 regions:
  665. //
  666. // * rectangular;
  667. // * left exponential tail;
  668. // * right exponential tail.
  669. //
  670. // otherwise table lookup method is used
  671. */
  672. #define VSL_RNG_METHOD_HYPERGEOMETRIC_H2PE 0 /* vsliRngHypergeometric */
  673. /*
  674. // Poisson
  675. //
  676. // <Method> <Short Description>
  677. // PTPE if lambda>=27, acceptance/rejection method is used with
  678. // decomposition onto 4 regions:
  679. //
  680. // * 2 parallelograms;
  681. // * triangle;
  682. // * left exponential tail;
  683. // * right exponential tail.
  684. //
  685. // otherwise table lookup method is used
  686. //
  687. // POISNORM for lambda>=1 method is based on Poisson inverse CDF
  688. // approximation by Gaussian inverse CDF; for lambda<1
  689. // table lookup method is used.
  690. */
  691. #define VSL_RNG_METHOD_POISSON_PTPE 0 /* vsliRngPoisson */
  692. #define VSL_RNG_METHOD_POISSON_POISNORM 1 /* vsliRngPoisson */
  693. /*
  694. // Poisson
  695. //
  696. // <Method> <Short Description>
  697. // POISNORM for lambda>=1 method is based on Poisson inverse CDF
  698. // approximation by Gaussian inverse CDF; for lambda<1
  699. // ICDF method is used.
  700. */
  701. #define VSL_RNG_METHOD_POISSONV_POISNORM 0 /* vsliRngPoissonV */
  702. /*
  703. // Negbinomial
  704. //
  705. // <Method> <Short Description>
  706. // NBAR if (a-1)*(1-p)/p>=100, acceptance/rejection method is used with
  707. // decomposition onto 5 regions:
  708. //
  709. // * rectangular;
  710. // * 2 trapezoid;
  711. // * left exponential tail;
  712. // * right exponential tail.
  713. //
  714. // otherwise table lookup method is used.
  715. */
  716. #define VSL_RNG_METHOD_NEGBINOMIAL_NBAR 0 /* vsliRngNegbinomial */
  717. /*
  718. //++
  719. // MATRIX STORAGE SCHEMES
  720. //--
  721. */
  722. /*
  723. // Some multivariate random number generators, e.g. GaussianMV, operate
  724. // with matrix parameters. To optimize matrix parameters usage VSL offers
  725. // following matrix storage schemes. (See VSL documentation for more details).
  726. //
  727. // FULL - whole matrix is stored
  728. // PACKED - lower/higher triangular matrix is packed in 1-dimensional array
  729. // DIAGONAL - diagonal elements are packed in 1-dimensional array
  730. */
  731. #define VSL_MATRIX_STORAGE_FULL 0
  732. #define VSL_MATRIX_STORAGE_PACKED 1
  733. #define VSL_MATRIX_STORAGE_DIAGONAL 2
  734. /*
  735. // SUMMARY STATISTICS (SS) RELATED MACRO DEFINITIONS
  736. */
  737. /*
  738. //++
  739. // MATRIX STORAGE SCHEMES
  740. //--
  741. */
  742. /*
  743. // SS routines work with matrix parameters, e.g. matrix of observations,
  744. // variance-covariance matrix. To optimize work with matrices the library
  745. // provides the following storage matrix schemes.
  746. */
  747. /*
  748. // Matrix of observations:
  749. // ROWS - observations of the random vector are stored in raws, that
  750. // is, i-th row of the matrix of observations contains values
  751. // of i-th component of the random vector
  752. // COLS - observations of the random vector are stored in columns that
  753. // is, i-th column of the matrix of observations contains values
  754. // of i-th component of the random vector
  755. */
  756. #define VSL_SS_MATRIX_STORAGE_ROWS 0x00010000
  757. #define VSL_SS_MATRIX_STORAGE_COLS 0x00020000
  758. /*
  759. // Variance-covariance/correlation matrix:
  760. // FULL - whole matrix is stored
  761. // L_PACKED - lower triangular matrix is stored as 1-dimensional array
  762. // U_PACKED - upper triangular matrix is stored as 1-dimensional array
  763. */
  764. #define VSL_SS_MATRIX_STORAGE_FULL 0x00000000
  765. #define VSL_SS_MATRIX_STORAGE_L_PACKED 0x00000001
  766. #define VSL_SS_MATRIX_STORAGE_U_PACKED 0x00000002
  767. /*
  768. //++
  769. // Summary Statistics METHODS
  770. //--
  771. */
  772. /*
  773. // SS routines provide computation of basic statistical estimates
  774. // (central/raw moments up to 4th order, variance-covariance,
  775. // minimum, maximum, skewness/kurtosis) using the following methods
  776. // - FAST - estimates are computed for price of one or two passes over
  777. // observations using highly optimized oneMKL routines
  778. // - 1PASS - estimate is computed for price of one pass of the observations
  779. // - FAST_USER_MEAN - estimates are computed for price of one or two passes
  780. // over observations given user defined mean for central moments,
  781. // covariance and correlation
  782. // - CP_TO_COVCOR - convert cross-product matrix to variance-covariance/
  783. // correlation matrix
  784. // - SUM_TO_MOM - convert raw/central sums to raw/central moments
  785. //
  786. */
  787. #define VSL_SS_METHOD_FAST 0x00000001
  788. #define VSL_SS_METHOD_1PASS 0x00000002
  789. #define VSL_SS_METHOD_FAST_USER_MEAN 0x00000100
  790. #define VSL_SS_METHOD_CP_TO_COVCOR 0x00000200
  791. #define VSL_SS_METHOD_SUM_TO_MOM 0x00000400
  792. /*
  793. // SS provides routine for parametrization of correlation matrix using
  794. // SPECTRAL DECOMPOSITION (SD) method
  795. */
  796. #define VSL_SS_METHOD_SD 0x00000004
  797. /*
  798. // SS routine for robust estimation of variance-covariance matrix
  799. // and mean supports Rocke algorithm, TBS-estimator
  800. */
  801. #define VSL_SS_METHOD_TBS 0x00000008
  802. /*
  803. // SS routine for estimation of missing values
  804. // supports Multiple Imputation (MI) method
  805. */
  806. #define VSL_SS_METHOD_MI 0x00000010
  807. /*
  808. // SS provides routine for detection of outliers, BACON method
  809. */
  810. #define VSL_SS_METHOD_BACON 0x00000020
  811. /*
  812. // SS supports routine for estimation of quantiles for streaming data
  813. // using the following methods:
  814. // - ZW - intermediate estimates of quantiles during processing
  815. // the next block are computed
  816. // - ZW_FAST - intermediate estimates of quantiles during processing
  817. // the next block are not computed
  818. */
  819. #define VSL_SS_METHOD_SQUANTS_ZW 0x00000040
  820. #define VSL_SS_METHOD_SQUANTS_ZW_FAST 0x00000080
  821. /*
  822. // Input of BACON algorithm is set of 3 parameters:
  823. // - Initialization method of the algorithm
  824. // - Parameter alfa such that 1-alfa is percentile of Chi2 distribution
  825. // - Stopping criterion
  826. */
  827. /*
  828. // Number of BACON algorithm parameters
  829. */
  830. #define VSL_SS_BACON_PARAMS_N 3
  831. /*
  832. // SS implementation of BACON algorithm supports two initialization methods:
  833. // - Mahalanobis distance based method
  834. // - Median based method
  835. */
  836. #define VSL_SS_METHOD_BACON_MAHALANOBIS_INIT 0x00000001
  837. #define VSL_SS_METHOD_BACON_MEDIAN_INIT 0x00000002
  838. /*
  839. // SS routine for sorting data, RADIX method
  840. */
  841. #define VSL_SS_METHOD_RADIX 0x00100000
  842. /*
  843. // Input of TBS algorithm is set of 4 parameters:
  844. // - Breakdown point
  845. // - Asymptotic rejection probability
  846. // - Stopping criterion
  847. // - Maximum number of iterations
  848. */
  849. /*
  850. // Number of TBS algorithm parameters
  851. */
  852. #define VSL_SS_TBS_PARAMS_N 4
  853. /*
  854. // Input of MI algorithm is set of 5 parameters:
  855. // - Maximal number of iterations for EM algorithm
  856. // - Maximal number of iterations for DA algorithm
  857. // - Stopping criterion
  858. // - Number of sets to impute
  859. // - Total number of missing values in dataset
  860. */
  861. /*
  862. // Number of MI algorithm parameters
  863. */
  864. #define VSL_SS_MI_PARAMS_SIZE 5
  865. /*
  866. // SS MI algorithm expects that missing values are
  867. // marked with NANs
  868. */
  869. #define VSL_SS_DNAN 0xFFF8000000000000
  870. #define VSL_SS_SNAN 0xFFC00000
  871. /*
  872. // Input of ZW algorithm is 1 parameter:
  873. // - accuracy of quantile estimation
  874. */
  875. /*
  876. // Number of ZW algorithm parameters
  877. */
  878. #define VSL_SS_SQUANTS_ZW_PARAMS_N 1
  879. /*
  880. //++
  881. // MACROS USED SS EDIT AND COMPUTE ROUTINES
  882. //--
  883. */
  884. /*
  885. // SS EditTask routine is way to edit input and output parameters of the task,
  886. // e.g., pointers to arrays which hold observations, weights of observations,
  887. // arrays of mean estimates or covariance estimates.
  888. // Macros below define parameters available for modification
  889. */
  890. #define VSL_SS_ED_DIMEN 1
  891. #define VSL_SS_ED_OBSERV_N 2
  892. #define VSL_SS_ED_OBSERV 3
  893. #define VSL_SS_ED_OBSERV_STORAGE 4
  894. #define VSL_SS_ED_INDC 5
  895. #define VSL_SS_ED_WEIGHTS 6
  896. #define VSL_SS_ED_MEAN 7
  897. #define VSL_SS_ED_2R_MOM 8
  898. #define VSL_SS_ED_3R_MOM 9
  899. #define VSL_SS_ED_4R_MOM 10
  900. #define VSL_SS_ED_2C_MOM 11
  901. #define VSL_SS_ED_3C_MOM 12
  902. #define VSL_SS_ED_4C_MOM 13
  903. #define VSL_SS_ED_SUM 67
  904. #define VSL_SS_ED_2R_SUM 68
  905. #define VSL_SS_ED_3R_SUM 69
  906. #define VSL_SS_ED_4R_SUM 70
  907. #define VSL_SS_ED_2C_SUM 71
  908. #define VSL_SS_ED_3C_SUM 72
  909. #define VSL_SS_ED_4C_SUM 73
  910. #define VSL_SS_ED_KURTOSIS 14
  911. #define VSL_SS_ED_SKEWNESS 15
  912. #define VSL_SS_ED_MIN 16
  913. #define VSL_SS_ED_MAX 17
  914. #define VSL_SS_ED_VARIATION 18
  915. #define VSL_SS_ED_COV 19
  916. #define VSL_SS_ED_COV_STORAGE 20
  917. #define VSL_SS_ED_COR 21
  918. #define VSL_SS_ED_COR_STORAGE 22
  919. #define VSL_SS_ED_CP 74
  920. #define VSL_SS_ED_CP_STORAGE 75
  921. #define VSL_SS_ED_ACCUM_WEIGHT 23
  922. #define VSL_SS_ED_QUANT_ORDER_N 24
  923. #define VSL_SS_ED_QUANT_ORDER 25
  924. #define VSL_SS_ED_QUANT_QUANTILES 26
  925. #define VSL_SS_ED_ORDER_STATS 27
  926. #define VSL_SS_ED_GROUP_INDC 28
  927. #define VSL_SS_ED_POOLED_COV_STORAGE 29
  928. #define VSL_SS_ED_POOLED_MEAN 30
  929. #define VSL_SS_ED_POOLED_COV 31
  930. #define VSL_SS_ED_GROUP_COV_INDC 32
  931. #define VSL_SS_ED_REQ_GROUP_INDC 32
  932. #define VSL_SS_ED_GROUP_MEAN 33
  933. #define VSL_SS_ED_GROUP_COV_STORAGE 34
  934. #define VSL_SS_ED_GROUP_COV 35
  935. #define VSL_SS_ED_ROBUST_COV_STORAGE 36
  936. #define VSL_SS_ED_ROBUST_COV_PARAMS_N 37
  937. #define VSL_SS_ED_ROBUST_COV_PARAMS 38
  938. #define VSL_SS_ED_ROBUST_MEAN 39
  939. #define VSL_SS_ED_ROBUST_COV 40
  940. #define VSL_SS_ED_OUTLIERS_PARAMS_N 41
  941. #define VSL_SS_ED_OUTLIERS_PARAMS 42
  942. #define VSL_SS_ED_OUTLIERS_WEIGHT 43
  943. #define VSL_SS_ED_ORDER_STATS_STORAGE 44
  944. #define VSL_SS_ED_PARTIAL_COV_IDX 45
  945. #define VSL_SS_ED_PARTIAL_COV 46
  946. #define VSL_SS_ED_PARTIAL_COV_STORAGE 47
  947. #define VSL_SS_ED_PARTIAL_COR 48
  948. #define VSL_SS_ED_PARTIAL_COR_STORAGE 49
  949. #define VSL_SS_ED_MI_PARAMS_N 50
  950. #define VSL_SS_ED_MI_PARAMS 51
  951. #define VSL_SS_ED_MI_INIT_ESTIMATES_N 52
  952. #define VSL_SS_ED_MI_INIT_ESTIMATES 53
  953. #define VSL_SS_ED_MI_SIMUL_VALS_N 54
  954. #define VSL_SS_ED_MI_SIMUL_VALS 55
  955. #define VSL_SS_ED_MI_ESTIMATES_N 56
  956. #define VSL_SS_ED_MI_ESTIMATES 57
  957. #define VSL_SS_ED_MI_PRIOR_N 58
  958. #define VSL_SS_ED_MI_PRIOR 59
  959. #define VSL_SS_ED_PARAMTR_COR 60
  960. #define VSL_SS_ED_PARAMTR_COR_STORAGE 61
  961. #define VSL_SS_ED_STREAM_QUANT_PARAMS_N 62
  962. #define VSL_SS_ED_STREAM_QUANT_PARAMS 63
  963. #define VSL_SS_ED_STREAM_QUANT_ORDER_N 64
  964. #define VSL_SS_ED_STREAM_QUANT_ORDER 65
  965. #define VSL_SS_ED_STREAM_QUANT_QUANTILES 66
  966. #define VSL_SS_ED_MDAD 76
  967. #define VSL_SS_ED_MNAD 77
  968. #define VSL_SS_ED_SORTED_OBSERV 78
  969. #define VSL_SS_ED_SORTED_OBSERV_STORAGE 79
  970. /*
  971. // SS Compute routine calculates estimates supported by the library
  972. // Macros below define estimates to compute
  973. */
  974. #define VSL_SS_MEAN 0x0000000000000001
  975. #define VSL_SS_2R_MOM 0x0000000000000002
  976. #define VSL_SS_3R_MOM 0x0000000000000004
  977. #define VSL_SS_4R_MOM 0x0000000000000008
  978. #define VSL_SS_2C_MOM 0x0000000000000010
  979. #define VSL_SS_3C_MOM 0x0000000000000020
  980. #define VSL_SS_4C_MOM 0x0000000000000040
  981. #define VSL_SS_SUM 0x0000000002000000
  982. #define VSL_SS_2R_SUM 0x0000000004000000
  983. #define VSL_SS_3R_SUM 0x0000000008000000
  984. #define VSL_SS_4R_SUM 0x0000000010000000
  985. #define VSL_SS_2C_SUM 0x0000000020000000
  986. #define VSL_SS_3C_SUM 0x0000000040000000
  987. #define VSL_SS_4C_SUM 0x0000000080000000
  988. #define VSL_SS_KURTOSIS 0x0000000000000080
  989. #define VSL_SS_SKEWNESS 0x0000000000000100
  990. #define VSL_SS_VARIATION 0x0000000000000200
  991. #define VSL_SS_MIN 0x0000000000000400
  992. #define VSL_SS_MAX 0x0000000000000800
  993. #define VSL_SS_COV 0x0000000000001000
  994. #define VSL_SS_COR 0x0000000000002000
  995. #define VSL_SS_CP 0x0000000100000000
  996. #define VSL_SS_POOLED_COV 0x0000000000004000
  997. #define VSL_SS_GROUP_COV 0x0000000000008000
  998. #define VSL_SS_POOLED_MEAN 0x0000000800000000
  999. #define VSL_SS_GROUP_MEAN 0x0000001000000000
  1000. #define VSL_SS_QUANTS 0x0000000000010000
  1001. #define VSL_SS_ORDER_STATS 0x0000000000020000
  1002. #define VSL_SS_SORTED_OBSERV 0x0000008000000000
  1003. #define VSL_SS_ROBUST_COV 0x0000000000040000
  1004. #define VSL_SS_OUTLIERS 0x0000000000080000
  1005. #define VSL_SS_PARTIAL_COV 0x0000000000100000
  1006. #define VSL_SS_PARTIAL_COR 0x0000000000200000
  1007. #define VSL_SS_MISSING_VALS 0x0000000000400000
  1008. #define VSL_SS_PARAMTR_COR 0x0000000000800000
  1009. #define VSL_SS_STREAM_QUANTS 0x0000000001000000
  1010. #define VSL_SS_MDAD 0x0000000200000000
  1011. #define VSL_SS_MNAD 0x0000000400000000
  1012. #ifdef __cplusplus
  1013. }
  1014. #endif /* __cplusplus */
  1015. #endif /* __MKL_VSL_DEFINES_H__ */