mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-03 23:36:21 +02:00
2 lines
3.4 KiB
JavaScript
2 lines
3.4 KiB
JavaScript
"use strict";var m=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var d=(s,t,i)=>t in s?m(s,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[t]=i;var g=(s,t)=>{for(var i in t)m(s,i,{get:t[i],enumerable:!0})},o=(s,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of u(t))!a.call(s,e)&&e!==i&&m(s,e,{get:()=>t[e],enumerable:!(n=f(t,e))||n.enumerable});return s};var b=s=>o(m({},"__esModule",{value:!0}),s);var h=(s,t,i)=>(d(s,typeof t!="symbol"?t+"":t,i),i);var A={};g(A,{generateMersenne32Randomizer:()=>M});module.exports=b(A);class l{constructor(){h(this,"N",624);h(this,"M",397);h(this,"MATRIX_A",2567483615);h(this,"UPPER_MASK",2147483648);h(this,"LOWER_MASK",2147483647);h(this,"mt",Array.from({length:this.N}));h(this,"mti",this.N+1);h(this,"mag01",[0,this.MATRIX_A])}unsigned32(t){return t<0?(t^this.UPPER_MASK)+this.UPPER_MASK:t}subtraction32(t,i){return t<i?this.unsigned32(4294967296-(i-t)&4294967295):t-i}addition32(t,i){return this.unsigned32(t+i&4294967295)}multiplication32(t,i){let n=0;for(let e=0;e<32;++e)t>>>e&1&&(n=this.addition32(n,this.unsigned32(i<<e)));return n}initGenrand(t){for(this.mt[0]=this.unsigned32(t&4294967295),this.mti=1;this.mti<this.N;this.mti++)this.mt[this.mti]=this.addition32(this.multiplication32(1812433253,this.unsigned32(this.mt[this.mti-1]^this.mt[this.mti-1]>>>30)),this.mti),this.mt[this.mti]=this.unsigned32(this.mt[this.mti]&4294967295)}initByArray(t,i){this.initGenrand(19650218);let n=1,e=0,r=this.N>i?this.N:i;for(;r;r--)this.mt[n]=this.addition32(this.addition32(this.unsigned32(this.mt[n]^this.multiplication32(this.unsigned32(this.mt[n-1]^this.mt[n-1]>>>30),1664525)),t[e]),e),this.mt[n]=this.unsigned32(this.mt[n]&4294967295),n++,e++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),e>=i&&(e=0);for(r=this.N-1;r;r--)this.mt[n]=this.subtraction32(this.unsigned32(this.mt[n]^this.multiplication32(this.unsigned32(this.mt[n-1]^this.mt[n-1]>>>30),1566083941)),n),this.mt[n]=this.unsigned32(this.mt[n]&4294967295),n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1);this.mt[0]=2147483648}genrandInt32(){let t;if(this.mti>=this.N){let i;for(this.mti===this.N+1&&this.initGenrand(5489),i=0;i<this.N-this.M;i++)t=this.unsigned32(this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK),this.mt[i]=this.unsigned32(this.mt[i+this.M]^t>>>1^this.mag01[t&1]);for(;i<this.N-1;i++)t=this.unsigned32(this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK),this.mt[i]=this.unsigned32(this.mt[i+(this.M-this.N)]^t>>>1^this.mag01[t&1]);t=this.unsigned32(this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK),this.mt[this.N-1]=this.unsigned32(this.mt[this.M-1]^t>>>1^this.mag01[t&1]),this.mti=0}return t=this.mt[this.mti++],t=this.unsigned32(t^t>>>11),t=this.unsigned32(t^t<<7&2636928640),t=this.unsigned32(t^t<<15&4022730752),t=this.unsigned32(t^t>>>18),t}genrandInt31(){return this.genrandInt32()>>>1}genrandReal1(){return this.genrandInt32()*(1/4294967295)}genrandReal2(){return this.genrandInt32()*(1/4294967296)}genrandReal3(){return(this.genrandInt32()+.5)*(1/4294967296)}genrandRes53(){const t=this.genrandInt32()>>>5,i=this.genrandInt32()>>>6;return(t*67108864+i)*(1/9007199254740992)}}function M(){const s=new l;return s.initGenrand(Math.ceil(Math.random()*Number.MAX_SAFE_INTEGER)),{next(){return s.genrandReal2()},seed(t){typeof t=="number"?s.initGenrand(t):Array.isArray(t)&&s.initByArray(t,t.length)}}}0&&(module.exports={generateMersenne32Randomizer});
|