index of namespace default
 
 index of project core
 
 index of module core

Class core.LFSR_NR


SynopsisNon-repeating Pseudo random number generator (linear feedback shift register).

  Methods: Description:


Warning: This is meant for _small_ random arrays (e.g. a sequence of 32 random values). It becomes exponentially slower with larger array sizes, e.g.: len= 8: ~9.1 mrand/sec len= 16: ~7.0 mrand/sec len= 32: ~5.8 mrand/sec len= 64: ~4.2 mrand/sec len= 128: ~2.9 mrand/sec len= 256: ~1.9 mrand/sec len= 512: ~1.1 mrand/sec len=1024: ~0.6 mrand/sec len=2048: ~0.3 mrand/sec len=4096: ~0.15 mrand/sec (see tks-examples/lfsr.tks)


 
 top of page

Method getNext
Return next random value in the range 0..(len-1)
Signature
getNext()

 
 top of page
Method init
Signature
init(intseed,
  intlen 
  )  
Arguments
intseed0=use address of this (pseudo-random seed). >0: use given uint32 value
intlenNumber of random values

 
 top of page
 

Project Modules:core 
Project Classes:Boolean , Buffer , Byte , Class , ClassArray , Condition , Configuration , Double , DummyStream , Envelope , Event , Exception , File , Float , FloatArray , FloatArray128 , FloatArray16 , FloatArray32 , FloatArray64 , FloatArray8 , Function , HashTable , IntArray , IntArray128 , IntArray16 , IntArray32 , IntArray64 , IntArray8 , Integer , LFSR , LFSR_NR , List , ListNode , Long , Mailbox , Mutex , Object , ObjectArray , PakFile , PointerArray , Pool , Process , Script , SharedBuffer , Short , Stack , StdErrStream , StdInStream , StdOutStream , Stream , String , String128 , String16 , String32 , String64 , String8 , StringArray , StringIterator , Thread , Time , TKS , TreeNode , UnsignedByte , UnsignedInteger , UnsignedLong , UnsignedShort , Value , ValueArray , Variable 
Project Functions:ceil , exit , floor , GetCurrentThread , getenv , lcchar , mathAbsMaxf , mathAbsMinf , mathAbsMini , mathAbsMini , mathCerpf , mathClampf , mathClampi , mathDistancePointPlane2d , mathFoldf , mathFoldi , mathGCD , mathLerpCyclicf , mathLerpf , mathMaxf , mathMaxi , mathMinf , mathMini , mathNextCyclicf , mathPowerf , mathPowerfC , mathPoweri , mathSerpf , mathSmoothStepf , mathSmoothStepNf , mathWrapf , mathWrapi , milliSeconds , milliSecondsDouble , psystem , putenv , srand , system , ucchar 
All Namespaces:default , graph , ui 
All Projects:core , eqxmms , ShaderVG , ShaderVG_Text , tkanalogrytm , tkchipmunk , tkclap , tkfileutils , tkfreeglut , tkfreetype2 , tkfreeverb , tkmath , tkmidi , tkmidipipe , tkminnie , tkoldmath , tkopengl , tkportaudio , tkradiastools , tksamplechain , tksampleedit , tksampler , tksdl , tksdl_net , tksidplay2 , tkspeexdsp , tksqlite , tktriangulate , tkui , tkvst2 , tkzip , ui , yingtest 


auto-generated by "DOG", the TkScript document generator. Thu, 11/Dec/2025 13:41:59