1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #pragma once19 20 #include "../../MathBuildConfig.h"21 #include "../../Math/MathNamespace.h"22 23 #include "../../Math/MathTypes.h"24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 [MATH_BEGIN_NAMESPACE]62 63 class [LCG]64 {65 public:66 67 [LCG]();68 69 [LCG](u32 seed, u32 [multiplier] = 69621,70 u32 [increment] = 0, u32 [modulus] = 0x7FFFFFFF )71 {72 [Seed](seed, [multiplier], [increment], [modulus]);73 }74 75 76 void [Seed](u32 seed, u32 [multiplier] = 69621, u32 [increment] = 0, u32 [modulus] = 0x7FFFFFFF);77 78 79 u32 [Int]();80 81 82 u32 [MaxInt]() const { return [modulus] - 1; }83 84 85 86 u32 [IntFast]();87 88 89 90 91 92 int [Int](int a, int b);93 94 95 float [Float]();96 97 98 99 float [Float01Incl]();100 101 102 103 104 float [FloatNeg1_1]();105 106 107 108 109 110 111 112 float [Float](float a, float b);113 114 115 116 117 118 float [FloatIncl](float a, float b);119 120 u32 [multiplier];121 u32 [increment];122 u32 [modulus];123 124 u32 [lastNumber];125 };126 127 #ifdef MATH_QT_INTEROP128 Q_DECLARE_METATYPE([LCG])129 Q_DECLARE_METATYPE([LCG]*)130 #endif131 132 [MATH_END_NAMESPACE] Go back to previous page