@kitware/vtk.js 20.1.2 → 20.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/Core/Base64.d.ts +14 -2
- package/Common/Core/Base64.js +31 -2
- package/Common/Core/Math/index.js +3 -3
- package/Common/Core/Math.d.ts +128 -128
- package/Common/Core/Math.js +1 -1
- package/Common/Core/MatrixBuilder.js +39 -41
- package/Common/DataModel/ImageData.js +12 -14
- package/Common/Transform/LandmarkTransform.js +6 -7
- package/Filters/General/PaintFilter/PaintFilter.worker.js +8 -8
- package/Filters/General/PaintFilter.js +11 -11
- package/Filters/Sources/PlaneSource.js +12 -13
- package/IO/Core/BinaryHelper.js +2 -4
- package/IO/Core/DataAccessHelper/HtmlDataAccessHelper.js +1 -1
- package/IO/Core/DataAccessHelper/HttpDataAccessHelper.js +1 -1
- package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.js +2 -2
- package/IO/Core/ZipMultiDataSetReader.js +1 -1
- package/IO/Core/ZipMultiDataSetWriter.js +1 -1
- package/IO/Geometry/STLWriter.js +4 -4
- package/IO/Misc/SkyboxReader.js +1 -1
- package/IO/XML/XMLReader.js +3 -4
- package/IO/XML/XMLWriter.js +5 -6
- package/Imaging/Core/ImageReslice.js +18 -19
- package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +27 -28
- package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +8 -9
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +14 -15
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +12 -13
- package/Interaction/Widgets/ImageCroppingRegionsWidget.js +5 -6
- package/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js +1 -1
- package/Interaction/Widgets/PiecewiseGaussianWidget.js +2 -2
- package/Interaction/Widgets/ResliceCursor/ResliceCursorRepresentation.js +8 -9
- package/Rendering/Core/Actor.js +3 -4
- package/Rendering/Core/Camera.js +81 -84
- package/Rendering/Core/CellPicker.js +2 -2
- package/Rendering/Core/CubeAxesActor.js +32 -33
- package/Rendering/Core/Follower.js +20 -21
- package/Rendering/Core/Glyph3DMapper.js +30 -32
- package/Rendering/Core/ImageMapper.js +2 -2
- package/Rendering/Core/ImageSlice.js +5 -6
- package/Rendering/Core/Picker.js +5 -6
- package/Rendering/Core/PixelSpaceCallbackMapper.js +3 -4
- package/Rendering/Core/Prop3D.js +24 -25
- package/Rendering/Core/Renderer.js +11 -12
- package/Rendering/Core/ScalarBarActor.js +32 -33
- package/Rendering/Core/Volume.js +3 -4
- package/Rendering/OpenGL/Actor.js +9 -10
- package/Rendering/OpenGL/Camera.js +8 -9
- package/Rendering/OpenGL/CellArrayBufferObject.js +6 -8
- package/Rendering/OpenGL/Glyph3DMapper.js +8 -9
- package/Rendering/OpenGL/ImageMapper.js +7 -7
- package/Rendering/OpenGL/ImageSlice.js +4 -4
- package/Rendering/OpenGL/PolyDataMapper.js +11 -13
- package/Rendering/OpenGL/RenderWindow.d.ts +37 -1
- package/Rendering/OpenGL/ShaderCache.js +1 -1
- package/Rendering/OpenGL/Skybox.js +4 -5
- package/Rendering/OpenGL/SphereMapper.js +2 -2
- package/Rendering/OpenGL/StickMapper.js +3 -4
- package/Rendering/OpenGL/SurfaceLIC/SurfaceLICInterface.js +1 -1
- package/Rendering/OpenGL/Volume.js +6 -7
- package/Rendering/OpenGL/VolumeMapper.js +47 -49
- package/Rendering/OpenGL/glsl/vtkPolyDataFS.glsl.js +1 -1
- package/Rendering/WebGPU/Actor.js +8 -8
- package/Rendering/WebGPU/Camera.js +8 -8
- package/Rendering/WebGPU/ImageMapper.js +18 -19
- package/Rendering/WebGPU/ImageSlice.js +9 -9
- package/Rendering/WebGPU/PolyDataMapper.js +3 -4
- package/Rendering/WebGPU/Renderer.js +6 -7
- package/Rendering/WebGPU/Texture.js +10 -9
- package/Rendering/WebGPU/Volume.js +3 -3
- package/Rendering/WebGPU/VolumePassFSQ.js +10 -10
- package/ThirdParty/index.js +2 -2
- package/Widgets/Manipulators/TrackballManipulator.js +5 -6
- package/Widgets/Representations/ArrowHandleRepresentation.js +10 -12
- package/Widgets/Representations/CircleContextRepresentation.js +4 -5
- package/Widgets/Representations/RectangleContextRepresentation.js +3 -3
- package/Widgets/Widgets3D/EllipseWidget/behavior.js +5 -5
- package/Widgets/Widgets3D/ImageCroppingWidget/helpers.js +6 -8
- package/Widgets/Widgets3D/PaintWidget/behavior.js +2 -2
- package/Widgets/Widgets3D/ResliceCursorWidget.js +6 -7
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +10 -10
- package/Widgets/Widgets3D/SplineWidget/behavior.js +5 -5
- package/_virtual/rollup-plugin-worker-loader__module_Sources/Filters/General/PaintFilter/PaintFilter.worker.js +1 -1
- package/_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js +1 -1
- package/package.json +2 -2
- package/vtk.js +2 -2
- package/_vendor/base64-js/index.js_commonjs-exports.js +0 -1
- package/_vendor/blueimp-md5/js/md5.js_commonjs-module.js +0 -3
- package/_vendor/define-properties/index.js_commonjs-proxy.js +0 -1
- package/_vendor/globalthis/implementation.browser.js_commonjs-module.js +0 -3
- package/_vendor/globalthis/implementation.browser.js_commonjs-proxy.js +0 -1
- package/_vendor/globalthis/polyfill.js_commonjs-proxy.js +0 -1
- package/_vendor/globalthis/shim.js_commonjs-proxy.js +0 -2
- package/_vendor/jszip/dist/jszip.min.js_commonjs-module.js +0 -3
- package/_vendor/object-keys/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/isArguments.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/alea.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/alea.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/tychei.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/tychei.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/xor128.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/xor128.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/xor4096.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/xor4096.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/xorshift7.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/xorshift7.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/lib/xorwow.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/lib/xorwow.js_commonjs-proxy.js +0 -1
- package/_vendor/seedrandom/seedrandom.js_commonjs-module.js +0 -3
- package/_vendor/seedrandom/seedrandom.js_commonjs-proxy.js +0 -1
- package/_vendor/webworker-promise/lib/register.js_commonjs-module.js +0 -3
- package/_vendor/webworker-promise/lib/tiny-emitter.js_commonjs-proxy.js +0 -1
- package/_vendor/webworker-promise/src/tiny-emitter.js_commonjs-proxy.js +0 -1
- package/_vendor/xmlbuilder2/lib/xmlbuilder2.min.js_commonjs-module.js +0 -3
- package/_virtual/_rollup_plugin_ignore_empty_module_placeholder_commonjs-proxy.js +0 -6
- package/_virtual/commonjsHelpers.js +0 -22
- package/_virtual/polyfill-node.buffer.js +0 -1971
- package/_virtual/polyfill-node.global.js +0 -5
- package/_virtual/rollup_plugin_ignore_empty_module_placeholder.js +0 -8
- package/vendor/base64-js/index.js +0 -72
- package/vendor/blueimp-md5/js/md5.js +0 -402
- package/vendor/d3-array/src/array.js +0 -1
- package/vendor/d3-array/src/ascending.js +0 -5
- package/vendor/d3-array/src/bin.js +0 -1
- package/vendor/d3-array/src/bisect.js +0 -10
- package/vendor/d3-array/src/bisector.js +0 -46
- package/vendor/d3-array/src/constant.js +0 -1
- package/vendor/d3-array/src/count.js +0 -1
- package/vendor/d3-array/src/cross.js +0 -1
- package/vendor/d3-array/src/cumsum.js +0 -1
- package/vendor/d3-array/src/descending.js +0 -1
- package/vendor/d3-array/src/deviation.js +0 -1
- package/vendor/d3-array/src/difference.js +0 -1
- package/vendor/d3-array/src/disjoint.js +0 -1
- package/vendor/d3-array/src/every.js +0 -1
- package/vendor/d3-array/src/extent.js +0 -1
- package/vendor/d3-array/src/filter.js +0 -1
- package/vendor/d3-array/src/fsum.js +0 -1
- package/vendor/d3-array/src/greatest.js +0 -1
- package/vendor/d3-array/src/greatestIndex.js +0 -1
- package/vendor/d3-array/src/group.js +0 -1
- package/vendor/d3-array/src/groupSort.js +0 -1
- package/vendor/d3-array/src/identity.js +0 -1
- package/vendor/d3-array/src/index.js +0 -1
- package/vendor/d3-array/src/intersection.js +0 -1
- package/vendor/d3-array/src/least.js +0 -1
- package/vendor/d3-array/src/leastIndex.js +0 -1
- package/vendor/d3-array/src/map.js +0 -1
- package/vendor/d3-array/src/max.js +0 -1
- package/vendor/d3-array/src/maxIndex.js +0 -1
- package/vendor/d3-array/src/mean.js +0 -1
- package/vendor/d3-array/src/median.js +0 -1
- package/vendor/d3-array/src/merge.js +0 -1
- package/vendor/d3-array/src/min.js +0 -1
- package/vendor/d3-array/src/minIndex.js +0 -1
- package/vendor/d3-array/src/mode.js +0 -1
- package/vendor/d3-array/src/nice.js +0 -1
- package/vendor/d3-array/src/number.js +0 -5
- package/vendor/d3-array/src/pairs.js +0 -1
- package/vendor/d3-array/src/permute.js +0 -1
- package/vendor/d3-array/src/quantile.js +0 -1
- package/vendor/d3-array/src/quickselect.js +0 -1
- package/vendor/d3-array/src/range.js +0 -1
- package/vendor/d3-array/src/reduce.js +0 -1
- package/vendor/d3-array/src/reverse.js +0 -1
- package/vendor/d3-array/src/scan.js +0 -1
- package/vendor/d3-array/src/set.js +0 -1
- package/vendor/d3-array/src/shuffle.js +0 -1
- package/vendor/d3-array/src/some.js +0 -1
- package/vendor/d3-array/src/sort.js +0 -1
- package/vendor/d3-array/src/subset.js +0 -1
- package/vendor/d3-array/src/sum.js +0 -1
- package/vendor/d3-array/src/superset.js +0 -1
- package/vendor/d3-array/src/threshold/freedmanDiaconis.js +0 -1
- package/vendor/d3-array/src/threshold/scott.js +0 -1
- package/vendor/d3-array/src/threshold/sturges.js +0 -1
- package/vendor/d3-array/src/ticks.js +0 -56
- package/vendor/d3-array/src/transpose.js +0 -1
- package/vendor/d3-array/src/union.js +0 -1
- package/vendor/d3-array/src/variance.js +0 -1
- package/vendor/d3-array/src/zip.js +0 -1
- package/vendor/d3-color/src/color.js +0 -373
- package/vendor/d3-color/src/cubehelix.js +0 -1
- package/vendor/d3-color/src/define.js +0 -12
- package/vendor/d3-color/src/index.js +0 -1
- package/vendor/d3-color/src/lab.js +0 -1
- package/vendor/d3-color/src/math.js +0 -1
- package/vendor/d3-format/src/defaultLocale.js +0 -20
- package/vendor/d3-format/src/exponent.js +0 -7
- package/vendor/d3-format/src/formatDecimal.js +0 -22
- package/vendor/d3-format/src/formatGroup.js +0 -20
- package/vendor/d3-format/src/formatNumerals.js +0 -9
- package/vendor/d3-format/src/formatPrefixAuto.js +0 -18
- package/vendor/d3-format/src/formatRounded.js +0 -13
- package/vendor/d3-format/src/formatSpecifier.js +0 -49
- package/vendor/d3-format/src/formatTrim.js +0 -13
- package/vendor/d3-format/src/formatTypes.js +0 -21
- package/vendor/d3-format/src/identity.js +0 -5
- package/vendor/d3-format/src/index.js +0 -1
- package/vendor/d3-format/src/locale.js +0 -150
- package/vendor/d3-format/src/precisionFixed.js +0 -7
- package/vendor/d3-format/src/precisionPrefix.js +0 -7
- package/vendor/d3-format/src/precisionRound.js +0 -8
- package/vendor/d3-interpolate/src/array.js +0 -19
- package/vendor/d3-interpolate/src/basis.js +0 -1
- package/vendor/d3-interpolate/src/basisClosed.js +0 -1
- package/vendor/d3-interpolate/src/color.js +0 -26
- package/vendor/d3-interpolate/src/constant.js +0 -3
- package/vendor/d3-interpolate/src/cubehelix.js +0 -1
- package/vendor/d3-interpolate/src/date.js +0 -8
- package/vendor/d3-interpolate/src/discrete.js +0 -1
- package/vendor/d3-interpolate/src/hcl.js +0 -1
- package/vendor/d3-interpolate/src/hsl.js +0 -1
- package/vendor/d3-interpolate/src/hue.js +0 -1
- package/vendor/d3-interpolate/src/index.js +0 -1
- package/vendor/d3-interpolate/src/lab.js +0 -1
- package/vendor/d3-interpolate/src/number.js +0 -7
- package/vendor/d3-interpolate/src/numberArray.js +0 -16
- package/vendor/d3-interpolate/src/object.js +0 -25
- package/vendor/d3-interpolate/src/piecewise.js +0 -1
- package/vendor/d3-interpolate/src/quantize.js +0 -1
- package/vendor/d3-interpolate/src/rgb.js +0 -26
- package/vendor/d3-interpolate/src/round.js +0 -7
- package/vendor/d3-interpolate/src/string.js +0 -66
- package/vendor/d3-interpolate/src/transform/decompose.js +0 -1
- package/vendor/d3-interpolate/src/transform/index.js +0 -1
- package/vendor/d3-interpolate/src/transform/parse.js +0 -1
- package/vendor/d3-interpolate/src/value.js +0 -24
- package/vendor/d3-interpolate/src/zoom.js +0 -1
- package/vendor/d3-scale/src/band.js +0 -1
- package/vendor/d3-scale/src/constant.js +0 -7
- package/vendor/d3-scale/src/continuous.js +0 -129
- package/vendor/d3-scale/src/diverging.js +0 -1
- package/vendor/d3-scale/src/identity.js +0 -1
- package/vendor/d3-scale/src/index.js +0 -1
- package/vendor/d3-scale/src/init.js +0 -10
- package/vendor/d3-scale/src/linear.js +0 -72
- package/vendor/d3-scale/src/log.js +0 -1
- package/vendor/d3-scale/src/nice.js +0 -1
- package/vendor/d3-scale/src/number.js +0 -5
- package/vendor/d3-scale/src/ordinal.js +0 -1
- package/vendor/d3-scale/src/pow.js +0 -1
- package/vendor/d3-scale/src/quantile.js +0 -1
- package/vendor/d3-scale/src/quantize.js +0 -1
- package/vendor/d3-scale/src/radial.js +0 -1
- package/vendor/d3-scale/src/sequential.js +0 -1
- package/vendor/d3-scale/src/sequentialQuantile.js +0 -1
- package/vendor/d3-scale/src/symlog.js +0 -1
- package/vendor/d3-scale/src/threshold.js +0 -1
- package/vendor/d3-scale/src/tickFormat.js +0 -35
- package/vendor/d3-scale/src/time.js +0 -1
- package/vendor/d3-scale/src/utcTime.js +0 -1
- package/vendor/d3-time/src/day.js +0 -1
- package/vendor/d3-time/src/duration.js +0 -1
- package/vendor/d3-time/src/hour.js +0 -1
- package/vendor/d3-time/src/index.js +0 -1
- package/vendor/d3-time/src/interval.js +0 -1
- package/vendor/d3-time/src/millisecond.js +0 -1
- package/vendor/d3-time/src/minute.js +0 -1
- package/vendor/d3-time/src/month.js +0 -1
- package/vendor/d3-time/src/second.js +0 -1
- package/vendor/d3-time/src/ticks.js +0 -1
- package/vendor/d3-time/src/utcDay.js +0 -1
- package/vendor/d3-time/src/utcHour.js +0 -1
- package/vendor/d3-time/src/utcMinute.js +0 -1
- package/vendor/d3-time/src/utcMonth.js +0 -1
- package/vendor/d3-time/src/utcWeek.js +0 -1
- package/vendor/d3-time/src/utcYear.js +0 -1
- package/vendor/d3-time/src/week.js +0 -1
- package/vendor/d3-time/src/year.js +0 -1
- package/vendor/d3-time-format/src/defaultLocale.js +0 -1
- package/vendor/d3-time-format/src/index.js +0 -1
- package/vendor/d3-time-format/src/isoFormat.js +0 -1
- package/vendor/d3-time-format/src/isoParse.js +0 -1
- package/vendor/d3-time-format/src/locale.js +0 -1
- package/vendor/define-properties/index.js +0 -60
- package/vendor/gl-matrix/esm/common.js +0 -30
- package/vendor/gl-matrix/esm/index.js +0 -1
- package/vendor/gl-matrix/esm/mat2.js +0 -1
- package/vendor/gl-matrix/esm/mat2d.js +0 -1
- package/vendor/gl-matrix/esm/mat3.js +0 -817
- package/vendor/gl-matrix/esm/mat4.js +0 -1868
- package/vendor/gl-matrix/esm/quat.js +0 -330
- package/vendor/gl-matrix/esm/quat2.js +0 -1
- package/vendor/gl-matrix/esm/vec2.js +0 -1
- package/vendor/gl-matrix/esm/vec3.js +0 -842
- package/vendor/gl-matrix/esm/vec4.js +0 -153
- package/vendor/globalthis/implementation.browser.js +0 -11
- package/vendor/globalthis/index.js +0 -25
- package/vendor/globalthis/polyfill.js +0 -14
- package/vendor/globalthis/shim.js +0 -25
- package/vendor/internmap/src/index.js +0 -1
- package/vendor/jszip/dist/jszip.min.js +0 -11
- package/vendor/object-keys/implementation.js +0 -124
- package/vendor/object-keys/index.js +0 -35
- package/vendor/object-keys/isArguments.js +0 -17
- package/vendor/pako/dist/pako.esm.mjs.js +0 -6707
- package/vendor/seedrandom/index.js +0 -77
- package/vendor/seedrandom/lib/alea.js +0 -117
- package/vendor/seedrandom/lib/tychei.js +0 -105
- package/vendor/seedrandom/lib/xor128.js +0 -84
- package/vendor/seedrandom/lib/xor4096.js +0 -150
- package/vendor/seedrandom/lib/xorshift7.js +0 -101
- package/vendor/seedrandom/lib/xorwow.js +0 -89
- package/vendor/seedrandom/seedrandom.js +0 -256
- package/vendor/webworker-promise/lib/register.js +0 -158
- package/vendor/webworker-promise/lib/tiny-emitter.js +0 -89
- package/vendor/webworker-promise/src/index.js +0 -110
- package/vendor/webworker-promise/src/tiny-emitter.js +0 -51
- package/vendor/xmlbuilder2/lib/xmlbuilder2.min.js +0 -13
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import './lib/alea.js';
|
|
2
|
-
import './lib/xor128.js';
|
|
3
|
-
import './lib/xorwow.js';
|
|
4
|
-
import './lib/xorshift7.js';
|
|
5
|
-
import './lib/xor4096.js';
|
|
6
|
-
import './lib/tychei.js';
|
|
7
|
-
import './seedrandom.js';
|
|
8
|
-
import { a as alea$1 } from '../../_vendor/seedrandom/lib/alea.js_commonjs-module.js';
|
|
9
|
-
import { x as xor128$1 } from '../../_vendor/seedrandom/lib/xor128.js_commonjs-module.js';
|
|
10
|
-
import { x as xorwow$1 } from '../../_vendor/seedrandom/lib/xorwow.js_commonjs-module.js';
|
|
11
|
-
import { x as xorshift7$1 } from '../../_vendor/seedrandom/lib/xorshift7.js_commonjs-module.js';
|
|
12
|
-
import { x as xor4096$1 } from '../../_vendor/seedrandom/lib/xor4096.js_commonjs-module.js';
|
|
13
|
-
import { t as tychei$1 } from '../../_vendor/seedrandom/lib/tychei.js_commonjs-module.js';
|
|
14
|
-
import { s as seedrandom$1 } from '../../_vendor/seedrandom/seedrandom.js_commonjs-module.js';
|
|
15
|
-
|
|
16
|
-
// A library of seedable RNGs implemented in Javascript.
|
|
17
|
-
//
|
|
18
|
-
// Usage:
|
|
19
|
-
//
|
|
20
|
-
// var seedrandom = require('seedrandom');
|
|
21
|
-
// var random = seedrandom(1); // or any seed.
|
|
22
|
-
// var x = random(); // 0 <= x < 1. Every bit is random.
|
|
23
|
-
// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.
|
|
24
|
-
|
|
25
|
-
// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.
|
|
26
|
-
// Period: ~2^116
|
|
27
|
-
// Reported to pass all BigCrush tests.
|
|
28
|
-
var alea = alea$1.exports;
|
|
29
|
-
|
|
30
|
-
// xor128, a pure xor-shift generator by George Marsaglia.
|
|
31
|
-
// Period: 2^128-1.
|
|
32
|
-
// Reported to fail: MatrixRank and LinearComp.
|
|
33
|
-
var xor128 = xor128$1.exports;
|
|
34
|
-
|
|
35
|
-
// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.
|
|
36
|
-
// Period: 2^192-2^32
|
|
37
|
-
// Reported to fail: CollisionOver, SimpPoker, and LinearComp.
|
|
38
|
-
var xorwow = xorwow$1.exports;
|
|
39
|
-
|
|
40
|
-
// xorshift7, by François Panneton and Pierre L'ecuyer, takes
|
|
41
|
-
// a different approach: it adds robustness by allowing more shifts
|
|
42
|
-
// than Marsaglia's original three. It is a 7-shift generator
|
|
43
|
-
// with 256 bits, that passes BigCrush with no systmatic failures.
|
|
44
|
-
// Period 2^256-1.
|
|
45
|
-
// No systematic BigCrush failures reported.
|
|
46
|
-
var xorshift7 = xorshift7$1.exports;
|
|
47
|
-
|
|
48
|
-
// xor4096, by Richard Brent, is a 4096-bit xor-shift with a
|
|
49
|
-
// very long period that also adds a Weyl generator. It also passes
|
|
50
|
-
// BigCrush with no systematic failures. Its long period may
|
|
51
|
-
// be useful if you have many generators and need to avoid
|
|
52
|
-
// collisions.
|
|
53
|
-
// Period: 2^4128-2^32.
|
|
54
|
-
// No systematic BigCrush failures reported.
|
|
55
|
-
var xor4096 = xor4096$1.exports;
|
|
56
|
-
|
|
57
|
-
// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random
|
|
58
|
-
// number generator derived from ChaCha, a modern stream cipher.
|
|
59
|
-
// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf
|
|
60
|
-
// Period: ~2^127
|
|
61
|
-
// No systematic BigCrush failures reported.
|
|
62
|
-
var tychei = tychei$1.exports;
|
|
63
|
-
|
|
64
|
-
// The original ARC4-based prng included in this library.
|
|
65
|
-
// Period: ~2^1600
|
|
66
|
-
var sr = seedrandom$1.exports;
|
|
67
|
-
|
|
68
|
-
sr.alea = alea;
|
|
69
|
-
sr.xor128 = xor128;
|
|
70
|
-
sr.xorwow = xorwow;
|
|
71
|
-
sr.xorshift7 = xorshift7;
|
|
72
|
-
sr.xor4096 = xor4096;
|
|
73
|
-
sr.tychei = tychei;
|
|
74
|
-
|
|
75
|
-
var seedrandom = sr;
|
|
76
|
-
|
|
77
|
-
export { seedrandom as s };
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { c as commonjsGlobal } from '../../../_virtual/commonjsHelpers.js';
|
|
2
|
-
import { a as alea } from '../../../_vendor/seedrandom/lib/alea.js_commonjs-module.js';
|
|
3
|
-
|
|
4
|
-
(function (module) {
|
|
5
|
-
// A port of an algorithm by Johannes Baagøe <baagoe@baagoe.com>, 2010
|
|
6
|
-
// http://baagoe.com/en/RandomMusings/javascript/
|
|
7
|
-
// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror
|
|
8
|
-
// Original work is under MIT license -
|
|
9
|
-
|
|
10
|
-
// Copyright (C) 2010 by Johannes Baagøe <baagoe@baagoe.org>
|
|
11
|
-
//
|
|
12
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
14
|
-
// in the Software without restriction, including without limitation the rights
|
|
15
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
17
|
-
// furnished to do so, subject to the following conditions:
|
|
18
|
-
//
|
|
19
|
-
// The above copyright notice and this permission notice shall be included in
|
|
20
|
-
// all copies or substantial portions of the Software.
|
|
21
|
-
//
|
|
22
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
28
|
-
// THE SOFTWARE.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
(function(global, module, define) {
|
|
33
|
-
|
|
34
|
-
function Alea(seed) {
|
|
35
|
-
var me = this, mash = Mash();
|
|
36
|
-
|
|
37
|
-
me.next = function() {
|
|
38
|
-
var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32
|
|
39
|
-
me.s0 = me.s1;
|
|
40
|
-
me.s1 = me.s2;
|
|
41
|
-
return me.s2 = t - (me.c = t | 0);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
// Apply the seeding algorithm from Baagoe.
|
|
45
|
-
me.c = 1;
|
|
46
|
-
me.s0 = mash(' ');
|
|
47
|
-
me.s1 = mash(' ');
|
|
48
|
-
me.s2 = mash(' ');
|
|
49
|
-
me.s0 -= mash(seed);
|
|
50
|
-
if (me.s0 < 0) { me.s0 += 1; }
|
|
51
|
-
me.s1 -= mash(seed);
|
|
52
|
-
if (me.s1 < 0) { me.s1 += 1; }
|
|
53
|
-
me.s2 -= mash(seed);
|
|
54
|
-
if (me.s2 < 0) { me.s2 += 1; }
|
|
55
|
-
mash = null;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function copy(f, t) {
|
|
59
|
-
t.c = f.c;
|
|
60
|
-
t.s0 = f.s0;
|
|
61
|
-
t.s1 = f.s1;
|
|
62
|
-
t.s2 = f.s2;
|
|
63
|
-
return t;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function impl(seed, opts) {
|
|
67
|
-
var xg = new Alea(seed),
|
|
68
|
-
state = opts && opts.state,
|
|
69
|
-
prng = xg.next;
|
|
70
|
-
prng.int32 = function() { return (xg.next() * 0x100000000) | 0; };
|
|
71
|
-
prng.double = function() {
|
|
72
|
-
return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53
|
|
73
|
-
};
|
|
74
|
-
prng.quick = prng;
|
|
75
|
-
if (state) {
|
|
76
|
-
if (typeof(state) == 'object') copy(state, xg);
|
|
77
|
-
prng.state = function() { return copy(xg, {}); };
|
|
78
|
-
}
|
|
79
|
-
return prng;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function Mash() {
|
|
83
|
-
var n = 0xefc8249d;
|
|
84
|
-
|
|
85
|
-
var mash = function(data) {
|
|
86
|
-
data = String(data);
|
|
87
|
-
for (var i = 0; i < data.length; i++) {
|
|
88
|
-
n += data.charCodeAt(i);
|
|
89
|
-
var h = 0.02519603282416938 * n;
|
|
90
|
-
n = h >>> 0;
|
|
91
|
-
h -= n;
|
|
92
|
-
h *= n;
|
|
93
|
-
n = h >>> 0;
|
|
94
|
-
h -= n;
|
|
95
|
-
n += h * 0x100000000; // 2^32
|
|
96
|
-
}
|
|
97
|
-
return (n >>> 0) * 2.3283064365386963e-10; // 2^-32
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
return mash;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (module && module.exports) {
|
|
105
|
-
module.exports = impl;
|
|
106
|
-
} else if (define && define.amd) {
|
|
107
|
-
define(function() { return impl; });
|
|
108
|
-
} else {
|
|
109
|
-
this.alea = impl;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
})(
|
|
113
|
-
commonjsGlobal,
|
|
114
|
-
module, // present in node.js
|
|
115
|
-
(typeof undefined) == 'function' // present with an AMD loader
|
|
116
|
-
);
|
|
117
|
-
}(alea));
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { c as commonjsGlobal } from '../../../_virtual/commonjsHelpers.js';
|
|
2
|
-
import { t as tychei } from '../../../_vendor/seedrandom/lib/tychei.js_commonjs-module.js';
|
|
3
|
-
|
|
4
|
-
(function (module) {
|
|
5
|
-
// A Javascript implementaion of the "Tyche-i" prng algorithm by
|
|
6
|
-
// Samuel Neves and Filipe Araujo.
|
|
7
|
-
// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf
|
|
8
|
-
|
|
9
|
-
(function(global, module, define) {
|
|
10
|
-
|
|
11
|
-
function XorGen(seed) {
|
|
12
|
-
var me = this, strseed = '';
|
|
13
|
-
|
|
14
|
-
// Set up generator function.
|
|
15
|
-
me.next = function() {
|
|
16
|
-
var b = me.b, c = me.c, d = me.d, a = me.a;
|
|
17
|
-
b = (b << 25) ^ (b >>> 7) ^ c;
|
|
18
|
-
c = (c - d) | 0;
|
|
19
|
-
d = (d << 24) ^ (d >>> 8) ^ a;
|
|
20
|
-
a = (a - b) | 0;
|
|
21
|
-
me.b = b = (b << 20) ^ (b >>> 12) ^ c;
|
|
22
|
-
me.c = c = (c - d) | 0;
|
|
23
|
-
me.d = (d << 16) ^ (c >>> 16) ^ a;
|
|
24
|
-
return me.a = (a - b) | 0;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/* The following is non-inverted tyche, which has better internal
|
|
28
|
-
* bit diffusion, but which is about 25% slower than tyche-i in JS.
|
|
29
|
-
me.next = function() {
|
|
30
|
-
var a = me.a, b = me.b, c = me.c, d = me.d;
|
|
31
|
-
a = (me.a + me.b | 0) >>> 0;
|
|
32
|
-
d = me.d ^ a; d = d << 16 ^ d >>> 16;
|
|
33
|
-
c = me.c + d | 0;
|
|
34
|
-
b = me.b ^ c; b = b << 12 ^ d >>> 20;
|
|
35
|
-
me.a = a = a + b | 0;
|
|
36
|
-
d = d ^ a; me.d = d = d << 8 ^ d >>> 24;
|
|
37
|
-
me.c = c = c + d | 0;
|
|
38
|
-
b = b ^ c;
|
|
39
|
-
return me.b = (b << 7 ^ b >>> 25);
|
|
40
|
-
}
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
me.a = 0;
|
|
44
|
-
me.b = 0;
|
|
45
|
-
me.c = 2654435769 | 0;
|
|
46
|
-
me.d = 1367130551;
|
|
47
|
-
|
|
48
|
-
if (seed === Math.floor(seed)) {
|
|
49
|
-
// Integer seed.
|
|
50
|
-
me.a = (seed / 0x100000000) | 0;
|
|
51
|
-
me.b = seed | 0;
|
|
52
|
-
} else {
|
|
53
|
-
// String seed.
|
|
54
|
-
strseed += seed;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Mix in string seed, then discard an initial batch of 64 values.
|
|
58
|
-
for (var k = 0; k < strseed.length + 20; k++) {
|
|
59
|
-
me.b ^= strseed.charCodeAt(k) | 0;
|
|
60
|
-
me.next();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function copy(f, t) {
|
|
65
|
-
t.a = f.a;
|
|
66
|
-
t.b = f.b;
|
|
67
|
-
t.c = f.c;
|
|
68
|
-
t.d = f.d;
|
|
69
|
-
return t;
|
|
70
|
-
}
|
|
71
|
-
function impl(seed, opts) {
|
|
72
|
-
var xg = new XorGen(seed),
|
|
73
|
-
state = opts && opts.state,
|
|
74
|
-
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
|
75
|
-
prng.double = function() {
|
|
76
|
-
do {
|
|
77
|
-
var top = xg.next() >>> 11,
|
|
78
|
-
bot = (xg.next() >>> 0) / 0x100000000,
|
|
79
|
-
result = (top + bot) / (1 << 21);
|
|
80
|
-
} while (result === 0);
|
|
81
|
-
return result;
|
|
82
|
-
};
|
|
83
|
-
prng.int32 = xg.next;
|
|
84
|
-
prng.quick = prng;
|
|
85
|
-
if (state) {
|
|
86
|
-
if (typeof(state) == 'object') copy(state, xg);
|
|
87
|
-
prng.state = function() { return copy(xg, {}); };
|
|
88
|
-
}
|
|
89
|
-
return prng;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (module && module.exports) {
|
|
93
|
-
module.exports = impl;
|
|
94
|
-
} else if (define && define.amd) {
|
|
95
|
-
define(function() { return impl; });
|
|
96
|
-
} else {
|
|
97
|
-
this.tychei = impl;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
})(
|
|
101
|
-
commonjsGlobal,
|
|
102
|
-
module, // present in node.js
|
|
103
|
-
(typeof undefined) == 'function' // present with an AMD loader
|
|
104
|
-
);
|
|
105
|
-
}(tychei));
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { c as commonjsGlobal } from '../../../_virtual/commonjsHelpers.js';
|
|
2
|
-
import { x as xor128 } from '../../../_vendor/seedrandom/lib/xor128.js_commonjs-module.js';
|
|
3
|
-
|
|
4
|
-
(function (module) {
|
|
5
|
-
// A Javascript implementaion of the "xor128" prng algorithm by
|
|
6
|
-
// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper
|
|
7
|
-
|
|
8
|
-
(function(global, module, define) {
|
|
9
|
-
|
|
10
|
-
function XorGen(seed) {
|
|
11
|
-
var me = this, strseed = '';
|
|
12
|
-
|
|
13
|
-
me.x = 0;
|
|
14
|
-
me.y = 0;
|
|
15
|
-
me.z = 0;
|
|
16
|
-
me.w = 0;
|
|
17
|
-
|
|
18
|
-
// Set up generator function.
|
|
19
|
-
me.next = function() {
|
|
20
|
-
var t = me.x ^ (me.x << 11);
|
|
21
|
-
me.x = me.y;
|
|
22
|
-
me.y = me.z;
|
|
23
|
-
me.z = me.w;
|
|
24
|
-
return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
if (seed === (seed | 0)) {
|
|
28
|
-
// Integer seed.
|
|
29
|
-
me.x = seed;
|
|
30
|
-
} else {
|
|
31
|
-
// String seed.
|
|
32
|
-
strseed += seed;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Mix in string seed, then discard an initial batch of 64 values.
|
|
36
|
-
for (var k = 0; k < strseed.length + 64; k++) {
|
|
37
|
-
me.x ^= strseed.charCodeAt(k) | 0;
|
|
38
|
-
me.next();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function copy(f, t) {
|
|
43
|
-
t.x = f.x;
|
|
44
|
-
t.y = f.y;
|
|
45
|
-
t.z = f.z;
|
|
46
|
-
t.w = f.w;
|
|
47
|
-
return t;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function impl(seed, opts) {
|
|
51
|
-
var xg = new XorGen(seed),
|
|
52
|
-
state = opts && opts.state,
|
|
53
|
-
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
|
54
|
-
prng.double = function() {
|
|
55
|
-
do {
|
|
56
|
-
var top = xg.next() >>> 11,
|
|
57
|
-
bot = (xg.next() >>> 0) / 0x100000000,
|
|
58
|
-
result = (top + bot) / (1 << 21);
|
|
59
|
-
} while (result === 0);
|
|
60
|
-
return result;
|
|
61
|
-
};
|
|
62
|
-
prng.int32 = xg.next;
|
|
63
|
-
prng.quick = prng;
|
|
64
|
-
if (state) {
|
|
65
|
-
if (typeof(state) == 'object') copy(state, xg);
|
|
66
|
-
prng.state = function() { return copy(xg, {}); };
|
|
67
|
-
}
|
|
68
|
-
return prng;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (module && module.exports) {
|
|
72
|
-
module.exports = impl;
|
|
73
|
-
} else if (define && define.amd) {
|
|
74
|
-
define(function() { return impl; });
|
|
75
|
-
} else {
|
|
76
|
-
this.xor128 = impl;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
})(
|
|
80
|
-
commonjsGlobal,
|
|
81
|
-
module, // present in node.js
|
|
82
|
-
(typeof undefined) == 'function' // present with an AMD loader
|
|
83
|
-
);
|
|
84
|
-
}(xor128));
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { c as commonjsGlobal } from '../../../_virtual/commonjsHelpers.js';
|
|
2
|
-
import { x as xor4096 } from '../../../_vendor/seedrandom/lib/xor4096.js_commonjs-module.js';
|
|
3
|
-
|
|
4
|
-
(function (module) {
|
|
5
|
-
// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.
|
|
6
|
-
//
|
|
7
|
-
// This fast non-cryptographic random number generator is designed for
|
|
8
|
-
// use in Monte-Carlo algorithms. It combines a long-period xorshift
|
|
9
|
-
// generator with a Weyl generator, and it passes all common batteries
|
|
10
|
-
// of stasticial tests for randomness while consuming only a few nanoseconds
|
|
11
|
-
// for each prng generated. For background on the generator, see Brent's
|
|
12
|
-
// paper: "Some long-period random number generators using shifts and xors."
|
|
13
|
-
// http://arxiv.org/pdf/1004.3115v1.pdf
|
|
14
|
-
//
|
|
15
|
-
// Usage:
|
|
16
|
-
//
|
|
17
|
-
// var xor4096 = require('xor4096');
|
|
18
|
-
// random = xor4096(1); // Seed with int32 or string.
|
|
19
|
-
// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.
|
|
20
|
-
// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.
|
|
21
|
-
//
|
|
22
|
-
// For nonzero numeric keys, this impelementation provides a sequence
|
|
23
|
-
// identical to that by Brent's xorgens 3 implementaion in C. This
|
|
24
|
-
// implementation also provides for initalizing the generator with
|
|
25
|
-
// string seeds, or for saving and restoring the state of the generator.
|
|
26
|
-
//
|
|
27
|
-
// On Chrome, this prng benchmarks about 2.1 times slower than
|
|
28
|
-
// Javascript's built-in Math.random().
|
|
29
|
-
|
|
30
|
-
(function(global, module, define) {
|
|
31
|
-
|
|
32
|
-
function XorGen(seed) {
|
|
33
|
-
var me = this;
|
|
34
|
-
|
|
35
|
-
// Set up generator function.
|
|
36
|
-
me.next = function() {
|
|
37
|
-
var w = me.w,
|
|
38
|
-
X = me.X, i = me.i, t, v;
|
|
39
|
-
// Update Weyl generator.
|
|
40
|
-
me.w = w = (w + 0x61c88647) | 0;
|
|
41
|
-
// Update xor generator.
|
|
42
|
-
v = X[(i + 34) & 127];
|
|
43
|
-
t = X[i = ((i + 1) & 127)];
|
|
44
|
-
v ^= v << 13;
|
|
45
|
-
t ^= t << 17;
|
|
46
|
-
v ^= v >>> 15;
|
|
47
|
-
t ^= t >>> 12;
|
|
48
|
-
// Update Xor generator array state.
|
|
49
|
-
v = X[i] = v ^ t;
|
|
50
|
-
me.i = i;
|
|
51
|
-
// Result is the combination.
|
|
52
|
-
return (v + (w ^ (w >>> 16))) | 0;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
function init(me, seed) {
|
|
56
|
-
var t, v, i, j, w, X = [], limit = 128;
|
|
57
|
-
if (seed === (seed | 0)) {
|
|
58
|
-
// Numeric seeds initialize v, which is used to generates X.
|
|
59
|
-
v = seed;
|
|
60
|
-
seed = null;
|
|
61
|
-
} else {
|
|
62
|
-
// String seeds are mixed into v and X one character at a time.
|
|
63
|
-
seed = seed + '\0';
|
|
64
|
-
v = 0;
|
|
65
|
-
limit = Math.max(limit, seed.length);
|
|
66
|
-
}
|
|
67
|
-
// Initialize circular array and weyl value.
|
|
68
|
-
for (i = 0, j = -32; j < limit; ++j) {
|
|
69
|
-
// Put the unicode characters into the array, and shuffle them.
|
|
70
|
-
if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);
|
|
71
|
-
// After 32 shuffles, take v as the starting w value.
|
|
72
|
-
if (j === 0) w = v;
|
|
73
|
-
v ^= v << 10;
|
|
74
|
-
v ^= v >>> 15;
|
|
75
|
-
v ^= v << 4;
|
|
76
|
-
v ^= v >>> 13;
|
|
77
|
-
if (j >= 0) {
|
|
78
|
-
w = (w + 0x61c88647) | 0; // Weyl.
|
|
79
|
-
t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.
|
|
80
|
-
i = (0 == t) ? i + 1 : 0; // Count zeroes.
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// We have detected all zeroes; make the key nonzero.
|
|
84
|
-
if (i >= 128) {
|
|
85
|
-
X[(seed && seed.length || 0) & 127] = -1;
|
|
86
|
-
}
|
|
87
|
-
// Run the generator 512 times to further mix the state before using it.
|
|
88
|
-
// Factoring this as a function slows the main generator, so it is just
|
|
89
|
-
// unrolled here. The weyl generator is not advanced while warming up.
|
|
90
|
-
i = 127;
|
|
91
|
-
for (j = 4 * 128; j > 0; --j) {
|
|
92
|
-
v = X[(i + 34) & 127];
|
|
93
|
-
t = X[i = ((i + 1) & 127)];
|
|
94
|
-
v ^= v << 13;
|
|
95
|
-
t ^= t << 17;
|
|
96
|
-
v ^= v >>> 15;
|
|
97
|
-
t ^= t >>> 12;
|
|
98
|
-
X[i] = v ^ t;
|
|
99
|
-
}
|
|
100
|
-
// Storing state as object members is faster than using closure variables.
|
|
101
|
-
me.w = w;
|
|
102
|
-
me.X = X;
|
|
103
|
-
me.i = i;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
init(me, seed);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function copy(f, t) {
|
|
110
|
-
t.i = f.i;
|
|
111
|
-
t.w = f.w;
|
|
112
|
-
t.X = f.X.slice();
|
|
113
|
-
return t;
|
|
114
|
-
}
|
|
115
|
-
function impl(seed, opts) {
|
|
116
|
-
if (seed == null) seed = +(new Date);
|
|
117
|
-
var xg = new XorGen(seed),
|
|
118
|
-
state = opts && opts.state,
|
|
119
|
-
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
|
120
|
-
prng.double = function() {
|
|
121
|
-
do {
|
|
122
|
-
var top = xg.next() >>> 11,
|
|
123
|
-
bot = (xg.next() >>> 0) / 0x100000000,
|
|
124
|
-
result = (top + bot) / (1 << 21);
|
|
125
|
-
} while (result === 0);
|
|
126
|
-
return result;
|
|
127
|
-
};
|
|
128
|
-
prng.int32 = xg.next;
|
|
129
|
-
prng.quick = prng;
|
|
130
|
-
if (state) {
|
|
131
|
-
if (state.X) copy(state, xg);
|
|
132
|
-
prng.state = function() { return copy(xg, {}); };
|
|
133
|
-
}
|
|
134
|
-
return prng;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (module && module.exports) {
|
|
138
|
-
module.exports = impl;
|
|
139
|
-
} else if (define && define.amd) {
|
|
140
|
-
define(function() { return impl; });
|
|
141
|
-
} else {
|
|
142
|
-
this.xor4096 = impl;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
})(
|
|
146
|
-
commonjsGlobal, // window object or global
|
|
147
|
-
module, // present in node.js
|
|
148
|
-
(typeof undefined) == 'function' // present with an AMD loader
|
|
149
|
-
);
|
|
150
|
-
}(xor4096));
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { c as commonjsGlobal } from '../../../_virtual/commonjsHelpers.js';
|
|
2
|
-
import { x as xorshift7 } from '../../../_vendor/seedrandom/lib/xorshift7.js_commonjs-module.js';
|
|
3
|
-
|
|
4
|
-
(function (module) {
|
|
5
|
-
// A Javascript implementaion of the "xorshift7" algorithm by
|
|
6
|
-
// François Panneton and Pierre L'ecuyer:
|
|
7
|
-
// "On the Xorgshift Random Number Generators"
|
|
8
|
-
// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf
|
|
9
|
-
|
|
10
|
-
(function(global, module, define) {
|
|
11
|
-
|
|
12
|
-
function XorGen(seed) {
|
|
13
|
-
var me = this;
|
|
14
|
-
|
|
15
|
-
// Set up generator function.
|
|
16
|
-
me.next = function() {
|
|
17
|
-
// Update xor generator.
|
|
18
|
-
var X = me.x, i = me.i, t, v;
|
|
19
|
-
t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);
|
|
20
|
-
t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);
|
|
21
|
-
t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);
|
|
22
|
-
t = X[(i + 4) & 7]; v ^= t ^ (t << 7);
|
|
23
|
-
t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);
|
|
24
|
-
X[i] = v;
|
|
25
|
-
me.i = (i + 1) & 7;
|
|
26
|
-
return v;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
function init(me, seed) {
|
|
30
|
-
var j, X = [];
|
|
31
|
-
|
|
32
|
-
if (seed === (seed | 0)) {
|
|
33
|
-
// Seed state array using a 32-bit integer.
|
|
34
|
-
X[0] = seed;
|
|
35
|
-
} else {
|
|
36
|
-
// Seed state using a string.
|
|
37
|
-
seed = '' + seed;
|
|
38
|
-
for (j = 0; j < seed.length; ++j) {
|
|
39
|
-
X[j & 7] = (X[j & 7] << 15) ^
|
|
40
|
-
(seed.charCodeAt(j) + X[(j + 1) & 7] << 13);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
// Enforce an array length of 8, not all zeroes.
|
|
44
|
-
while (X.length < 8) X.push(0);
|
|
45
|
-
for (j = 0; j < 8 && X[j] === 0; ++j);
|
|
46
|
-
if (j == 8) X[7] = -1;
|
|
47
|
-
|
|
48
|
-
me.x = X;
|
|
49
|
-
me.i = 0;
|
|
50
|
-
|
|
51
|
-
// Discard an initial 256 values.
|
|
52
|
-
for (j = 256; j > 0; --j) {
|
|
53
|
-
me.next();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
init(me, seed);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function copy(f, t) {
|
|
61
|
-
t.x = f.x.slice();
|
|
62
|
-
t.i = f.i;
|
|
63
|
-
return t;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function impl(seed, opts) {
|
|
67
|
-
if (seed == null) seed = +(new Date);
|
|
68
|
-
var xg = new XorGen(seed),
|
|
69
|
-
state = opts && opts.state,
|
|
70
|
-
prng = function() { return (xg.next() >>> 0) / 0x100000000; };
|
|
71
|
-
prng.double = function() {
|
|
72
|
-
do {
|
|
73
|
-
var top = xg.next() >>> 11,
|
|
74
|
-
bot = (xg.next() >>> 0) / 0x100000000,
|
|
75
|
-
result = (top + bot) / (1 << 21);
|
|
76
|
-
} while (result === 0);
|
|
77
|
-
return result;
|
|
78
|
-
};
|
|
79
|
-
prng.int32 = xg.next;
|
|
80
|
-
prng.quick = prng;
|
|
81
|
-
if (state) {
|
|
82
|
-
if (state.x) copy(state, xg);
|
|
83
|
-
prng.state = function() { return copy(xg, {}); };
|
|
84
|
-
}
|
|
85
|
-
return prng;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (module && module.exports) {
|
|
89
|
-
module.exports = impl;
|
|
90
|
-
} else if (define && define.amd) {
|
|
91
|
-
define(function() { return impl; });
|
|
92
|
-
} else {
|
|
93
|
-
this.xorshift7 = impl;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
})(
|
|
97
|
-
commonjsGlobal,
|
|
98
|
-
module, // present in node.js
|
|
99
|
-
(typeof undefined) == 'function' // present with an AMD loader
|
|
100
|
-
);
|
|
101
|
-
}(xorshift7));
|