├── Random.res ├── _LIBRARY └── LUXOPHIA │ └── LUX │ ├── README.md │ ├── .gitignore │ ├── LUX.~.pas │ ├── Curve │ └── LUX.Curve.D2.pas │ ├── FMX │ ├── LUX.FMX.Controls.pas │ ├── LUX.FMX.Pratform.pas │ ├── LUX.FMX.Forms.pas │ └── LUX.FMX.Messaging.Win.pas │ ├── Random │ ├── LUX.Random.WELL.pas │ ├── Xoshiro │ │ ├── B32 │ │ │ ├── LUX.Random.Xoshiro.B32.P64.pas │ │ │ └── LUX.Random.Xoshiro.B32.P128.pas │ │ ├── B64 │ │ │ ├── LUX.Random.Xoshiro.B64.P512.pas │ │ │ └── LUX.Random.Xoshiro.B64.P256.pas │ │ └── LUX.Random.Xoshiro.B32.pas │ ├── LUX.Random.Xoshiro.pas │ ├── LUX.Random.PCG.pas │ └── SFMT │ │ ├── LUX.Random.SFMT.P2281.pas │ │ ├── LUX.Random.SFMT.P4253.pas │ │ ├── LUX.Random.SFMT.P1279.pas │ │ ├── LUX.Random.SFMT.P11213.pas │ │ ├── LUX.Random.SFMT.P44497.pas │ │ ├── LUX.Random.SFMT.P86243.pas │ │ └── LUX.Random.SFMT.P19937.pas │ ├── Color │ ├── _VCL │ │ ├── LUX.Color.Grid.D1.pas │ │ ├── LUX.Color.Grid.D2.pas │ │ └── LUX.Color.Grid.D3.pas │ └── _FMX │ │ ├── LUX.Color.Grid.D1.pas │ │ ├── LUX.Color.Grid.D3.pas │ │ └── LUX.Color.Grid.D2.pas │ ├── Data │ ├── Grid │ │ ├── LUX.Data.Grid.T1.D1.pas │ │ ├── LUX.Data.Grid.T2.D1.pas │ │ └── LUX.Data.Grid.pas │ └── Dictionary │ │ └── LUX.Data.Dictionary.pas │ ├── Math │ ├── LUX.Math.Special.pas │ └── LUX.Math.Distribution.pas │ ├── LUX.D3x4.pas │ └── Complex │ └── LUX.Complex.D1.pas ├── .gitattributes ├── -------- └── _SCREENSHOT │ └── Random.gif ├── MethodsFrame.fmx ├── .gitignore ├── Random.dpr ├── Main.pas ├── Main.fmx └── MethodsFrame.pas /Random.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LUXOPHIA/Random/HEAD/Random.res -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/README.md: -------------------------------------------------------------------------------- 1 | # LUX.idea 2 | luxidea 製の汎用ライブラリ。 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.png filter=lfs diff=lfs merge=lfs -text 2 | *.gif filter=lfs diff=lfs merge=lfs -text 3 | -------------------------------------------------------------------------------- /--------/_SCREENSHOT/Random.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f5eb3eb729d5ee3674e4ff8c86cc2300b9e15afdce94a8dad5b3130cb1778142 3 | size 8439945 4 | -------------------------------------------------------------------------------- /MethodsFrame.fmx: -------------------------------------------------------------------------------- 1 | object FrameM: TFrameM 2 | Size.Width = 213.000000000000000000 3 | Size.Height = 500.000000000000000000 4 | Size.PlatformDefault = False 5 | object StringGridM: TStringGrid 6 | Align = Client 7 | CanFocus = True 8 | ClipChildren = True 9 | Size.Width = 213.000000000000000000 10 | Size.Height = 500.000000000000000000 11 | Size.PlatformDefault = False 12 | TabOrder = 0 13 | RowCount = 58 14 | Options = [ColumnResize, ColumnMove, ColLines, RowLines, RowSelect, Tabs, Header, HeaderClick, AutoDisplacement] 15 | OnSelectCell = StringGridMSelectCell 16 | Viewport.Width = 213.000000000000000000 17 | Viewport.Height = 500.000000000000000000 18 | object StringColumnA: TStringColumn 19 | Header = 'Algorithm' 20 | Size.Width = 75.000000000000000000 21 | end 22 | object StringColumnP: TStringColumn 23 | Header = 'Period' 24 | Size.Width = 50.000000000000000000 25 | end 26 | object StringColumnB: TStringColumn 27 | Header = 'Bit' 28 | Size.Width = 30.000000000000000000 29 | end 30 | object StringColumnS: TStringColumn 31 | Header = 'Step' 32 | Size.Width = 35.000000000000000000 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | #*.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | #*.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | 25 | # Delphi compiler-generated binaries (safe to delete) 26 | *.exe 27 | #*.dll 28 | *.bpl 29 | *.bpi 30 | *.dcp 31 | *.so 32 | *.apk 33 | *.drc 34 | *.map 35 | *.dres 36 | *.rsm 37 | *.tds 38 | *.dcu 39 | *.lib 40 | 41 | # Delphi autogenerated files (duplicated info) 42 | *.cfg 43 | *Resource.rc 44 | 45 | # Delphi local files (user-specific info) 46 | *.local 47 | *.identcache 48 | *.projdata 49 | *.tvsconfig 50 | *.dsk 51 | 52 | # Delphi history and backups 53 | __history/ 54 | __recovery/ 55 | *.~* 56 | 57 | # Castalia statistics file 58 | *.stat 59 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | #*.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | #*.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | 25 | # Delphi compiler-generated binaries (safe to delete) 26 | *.exe 27 | #*.dll 28 | *.bpl 29 | *.bpi 30 | *.dcp 31 | *.so 32 | *.apk 33 | *.drc 34 | *.map 35 | *.dres 36 | *.rsm 37 | *.tds 38 | *.dcu 39 | *.lib 40 | 41 | # Delphi autogenerated files (duplicated info) 42 | *.cfg 43 | *Resource.rc 44 | 45 | # Delphi local files (user-specific info) 46 | *.local 47 | *.identcache 48 | *.projdata 49 | *.tvsconfig 50 | *.dsk 51 | 52 | # Delphi history and backups 53 | __history/ 54 | __recovery/ 55 | *.~* 56 | 57 | # Castalia statistics file 58 | *.stat 59 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/LUX.~.pas: -------------------------------------------------------------------------------- 1 | unit LUX.~; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX; 6 | 7 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 8 | 9 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 10 | 11 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {RECORD} 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {CLASS} 16 | 17 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 18 | 19 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 20 | 21 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 22 | 23 | implementation //############################################################### ■ 24 | 25 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 26 | 27 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {RECORD} 28 | 29 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 30 | 31 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 32 | 33 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 34 | 35 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {CLASS} 36 | 37 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 38 | 39 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 40 | 41 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 42 | 43 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 44 | 45 | //############################################################################## □ 46 | 47 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 48 | 49 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 50 | 51 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Curve/LUX.Curve.D2.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Curve.D2; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, 6 | LUX.D1, 7 | LUX.D2, 8 | LUX.Curve; 9 | 10 | //type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 11 | 12 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 13 | 14 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 15 | 16 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 17 | 18 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 19 | 20 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 21 | 22 | function Delta( const X_,Y_:Single ) :Single; overload; 23 | function Delta( const X_,Y_:Double ) :Double; overload; 24 | 25 | function Sinc( const X_,Y_:Single ) :Single; overload; 26 | function Sinc( const X_,Y_:Double ) :Double; overload; 27 | 28 | implementation //############################################################### ■ 29 | 30 | uses LUX.Curve.BSpline, LUX.Curve.Bezier; 31 | 32 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 33 | 34 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 35 | 36 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 37 | 38 | function Delta( const X_,Y_:Single ) :Single; 39 | begin 40 | Result := Delta( Y_ ) * Delta( X_ ); 41 | end; 42 | 43 | function Delta( const X_,Y_:Double ) :Double; 44 | begin 45 | Result := Delta( Y_ ) * Delta( X_ ); 46 | end; 47 | 48 | //------------------------------------------------------------------------------ 49 | 50 | function Sinc( const X_,Y_:Single ) :Single; 51 | begin 52 | Result := Sinc( Y_ ) * Sinc( X_ ); 53 | end; 54 | 55 | function Sinc( const X_,Y_:Double ) :Double; 56 | begin 57 | Result := Sinc( Y_ ) * Sinc( X_ ); 58 | end; 59 | 60 | //############################################################################## □ 61 | 62 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 63 | 64 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 65 | 66 | end. //######################################################################### ■ 67 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/FMX/LUX.FMX.Controls.pas: -------------------------------------------------------------------------------- 1 | unit LUX.FMX.Controls; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses System.Types, 6 | FMX.Controls, FMX.Forms, 7 | LUX, 8 | LUX.FMX.Pratform, 9 | LUX.FMX.Forms; 10 | 11 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 14 | 15 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 16 | 17 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HControl 18 | 19 | HControl = class helper for TControl 20 | private 21 | protected 22 | public 23 | ///// メソッド 24 | function MousePos :TPointF; 25 | end; 26 | 27 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 28 | 29 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 30 | 31 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 32 | 33 | implementation //############################################################### ■ 34 | 35 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 36 | 37 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 38 | 39 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HControl 40 | 41 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 42 | 43 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 44 | 45 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 46 | 47 | /////////////////////////////////////////////////////////////////////// メソッド 48 | 49 | function HControl.MousePos :TPointF; 50 | begin 51 | Result := AbsoluteToLocal( ( Root.GetObject as TCommonCustomForm ).MousePos ); 52 | end; 53 | 54 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 55 | 56 | //############################################################################## □ 57 | 58 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 59 | 60 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 61 | 62 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/LUX.Random.WELL.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.WELL; 2 | 3 | { http://www.iro.umontreal.ca/~panneton/WELLRNG.html } 4 | 5 | interface //#################################################################### ■ 6 | 7 | uses LUX, 8 | LUX.Random; 9 | 10 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 11 | 12 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 13 | 14 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 15 | 16 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandomWEL<_TSeed_> 17 | 18 | IRandomWEL<_TSeed_:record> = interface( IRandom<_TSeed_> ) 19 | ['{D26B5CD1-3A30-4AA0-9F06-4B98B5A38F88}'] 20 | {protected} 21 | {public} 22 | end; 23 | 24 | //------------------------------------------------------------------------- 25 | 26 | TRandomWEL<_TSeed_:record> = class( TRandom<_TSeed_>, IRandomWEL<_TSeed_> ) 27 | private 28 | protected 29 | public 30 | end; 31 | 32 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 33 | 34 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 35 | 36 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 37 | 38 | implementation //############################################################### ■ 39 | 40 | uses System.SysUtils; 41 | 42 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 43 | 44 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 45 | 46 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandomWEL<_TSeed_> 47 | 48 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 49 | 50 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 51 | 52 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 53 | 54 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 55 | 56 | //############################################################################## □ 57 | 58 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 59 | 60 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 61 | 62 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/FMX/LUX.FMX.Pratform.pas: -------------------------------------------------------------------------------- 1 | unit LUX.FMX.Pratform; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses FMX.Platform; 6 | 7 | //type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 8 | 9 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 10 | 11 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {RECORD} 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {CLASS} 16 | 17 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 18 | 19 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 20 | 21 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 22 | 23 | function GetDisplayScale :Single; 24 | 25 | implementation //############################################################### ■ 26 | 27 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 28 | 29 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {RECORD} 30 | 31 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 32 | 33 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 34 | 35 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 36 | 37 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {CLASS} 38 | 39 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 40 | 41 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 42 | 43 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 44 | 45 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 46 | 47 | function GetDisplayScale :Single; 48 | var 49 | S :IFMXScreenService; 50 | begin 51 | if TPlatformServices.Current.SupportsPlatformService( IFMXScreenService, IInterface( S ) ) 52 | then Result := S.GetScreenScale 53 | else Result := 1; 54 | end; 55 | 56 | //############################################################################## □ 57 | 58 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 59 | 60 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 61 | 62 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/Xoshiro/B32/LUX.Random.Xoshiro.B32.P64.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.Xoshiro.B32.P64; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, 6 | LUX.Random, 7 | LUX.Random.Xoshiro, 8 | LUX.Random.Xoshiro.B32; 9 | 10 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 11 | 12 | TRandom32ROS64s = class; 13 | TRandom32ROS64ss = class; 14 | 15 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 16 | 17 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 18 | 19 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32ROS64s 20 | 21 | TRandom32ROS64s = class( TRandom32ROS64 ) 22 | private 23 | protected 24 | ///// メソッド 25 | function CalcRandInt32u :Int32u; override; 26 | public 27 | end; 28 | 29 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32ROS64ss 30 | 31 | TRandom32ROS64ss = class( TRandom32ROS64 ) 32 | private 33 | protected 34 | ///// メソッド 35 | function CalcRandInt32u :Int32u; override; 36 | public 37 | end; 38 | 39 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 40 | 41 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 42 | 43 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 44 | 45 | implementation //############################################################### ■ 46 | 47 | uses System.SysUtils; 48 | 49 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 50 | 51 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 52 | 53 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32ROS64s 54 | 55 | { http://xoshiro.di.unimi.it/xoroshiro64star.c } 56 | 57 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 58 | 59 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 60 | 61 | /////////////////////////////////////////////////////////////////////// メソッド 62 | 63 | function TRandom32ROS64s.CalcRandInt32u :Int32u; 64 | begin 65 | Result := _Seed.X * $9E3779BB; 66 | end; 67 | 68 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 69 | 70 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32ROS64ss 71 | 72 | { http://xoshiro.di.unimi.it/xoroshiro64starstar.c } 73 | 74 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 75 | 76 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 77 | 78 | /////////////////////////////////////////////////////////////////////// メソッド 79 | 80 | function TRandom32ROS64ss.CalcRandInt32u :Int32u; 81 | begin 82 | Result := rotl( _Seed.X * $9E3779BB, 5 ) * 5; 83 | end; 84 | 85 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 86 | 87 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 88 | 89 | //############################################################################## □ 90 | 91 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 92 | 93 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 94 | 95 | end. //######################################################################### ■ 96 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/Xoshiro/B64/LUX.Random.Xoshiro.B64.P512.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.Xoshiro.B64.P512; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D2, LUX.D4, 6 | LUX.Random, 7 | LUX.Random.Xoshiro, 8 | LUX.Random.Xoshiro.B64; 9 | 10 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 11 | 12 | TRandom64XOS512p = class; 13 | TRandom64XOS512ss = class; 14 | 15 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 16 | 17 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 18 | 19 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS512p 20 | 21 | TRandom64XOS512p = class( TRandom64XOS512 ) 22 | private 23 | protected 24 | ///// メソッド 25 | function CalcRandInt64u :Int64u; override; 26 | public 27 | end; 28 | 29 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS512ss 30 | 31 | TRandom64XOS512ss = class( TRandom64XOS512 ) 32 | private 33 | protected 34 | ///// メソッド 35 | function CalcRandInt64u :Int64u; override; 36 | public 37 | end; 38 | 39 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 40 | 41 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 42 | 43 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 44 | 45 | implementation //############################################################### ■ 46 | 47 | uses System.SysUtils; 48 | 49 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 50 | 51 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 52 | 53 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS512p 54 | 55 | { http://xoshiro.di.unimi.it/xoshiro256plus.c } 56 | 57 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 58 | 59 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 60 | 61 | /////////////////////////////////////////////////////////////////////// メソッド 62 | 63 | function TRandom64XOS512p.CalcRandInt64u :Int64u; 64 | begin 65 | with _Seed do Result := s[ 0 ] + s[ 2 ]; 66 | end; 67 | 68 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 69 | 70 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS512ss 71 | 72 | { http://xoshiro.di.unimi.it/xoshiro256starstar.c } 73 | 74 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 75 | 76 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 77 | 78 | /////////////////////////////////////////////////////////////////////// メソッド 79 | 80 | function TRandom64XOS512ss.CalcRandInt64u :Int64u; 81 | begin 82 | Result := rotl( _Seed.s[ 1 ] * 5, 7 ) * 9; 83 | end; 84 | 85 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 86 | 87 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 88 | 89 | //############################################################################## □ 90 | 91 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 92 | 93 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 94 | 95 | end. //######################################################################### ■ 96 | -------------------------------------------------------------------------------- /Random.dpr: -------------------------------------------------------------------------------- 1 | program Random; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | Main in 'Main.pas' {Form1}, 7 | LUX.Random in '_LIBRARY\LUXOPHIA\LUX\Random\LUX.Random.pas', 8 | LUX.Random.LCG in '_LIBRARY\LUXOPHIA\LUX\Random\LUX.Random.LCG.pas', 9 | LUX.Random.Xorshift in '_LIBRARY\LUXOPHIA\LUX\Random\LUX.Random.Xorshift.pas', 10 | LUX.Random.Xoshiro in '_LIBRARY\LUXOPHIA\LUX\Random\LUX.Random.Xoshiro.pas', 11 | LUX.Random.WELL in '_LIBRARY\LUXOPHIA\LUX\Random\LUX.Random.WELL.pas', 12 | LUX.Random.PCG in '_LIBRARY\LUXOPHIA\LUX\Random\LUX.Random.PCG.pas', 13 | LUX.Random.SFMT in '_LIBRARY\LUXOPHIA\LUX\Random\LUX.Random.SFMT.pas', 14 | MethodsFrame in 'MethodsFrame.pas' {FrameM: TFrame}, 15 | LUX.Random.PCG.B32 in '_LIBRARY\LUXOPHIA\LUX\Random\PCG\LUX.Random.PCG.B32.pas', 16 | LUX.Random.PCG.B64 in '_LIBRARY\LUXOPHIA\LUX\Random\PCG\LUX.Random.PCG.B64.pas', 17 | LUX.Random.PCG.B08 in '_LIBRARY\LUXOPHIA\LUX\Random\PCG\LUX.Random.PCG.B08.pas', 18 | LUX.Random.PCG.B16 in '_LIBRARY\LUXOPHIA\LUX\Random\PCG\LUX.Random.PCG.B16.pas', 19 | LUX.Random.WELL.P19937 in '_LIBRARY\LUXOPHIA\LUX\Random\WELL\LUX.Random.WELL.P19937.pas', 20 | LUX.Random.WELL.P44497 in '_LIBRARY\LUXOPHIA\LUX\Random\WELL\LUX.Random.WELL.P44497.pas', 21 | LUX.Random.WELL.P512 in '_LIBRARY\LUXOPHIA\LUX\Random\WELL\LUX.Random.WELL.P512.pas', 22 | LUX.Random.WELL.P1024 in '_LIBRARY\LUXOPHIA\LUX\Random\WELL\LUX.Random.WELL.P1024.pas', 23 | LUX.Random.Xoshiro.B64 in '_LIBRARY\LUXOPHIA\LUX\Random\Xoshiro\LUX.Random.Xoshiro.B64.pas', 24 | LUX.Random.Xoshiro.B32 in '_LIBRARY\LUXOPHIA\LUX\Random\Xoshiro\LUX.Random.Xoshiro.B32.pas', 25 | LUX.Random.Xoshiro.B32.P64 in '_LIBRARY\LUXOPHIA\LUX\Random\Xoshiro\B32\LUX.Random.Xoshiro.B32.P64.pas', 26 | LUX.Random.Xoshiro.B32.P128 in '_LIBRARY\LUXOPHIA\LUX\Random\Xoshiro\B32\LUX.Random.Xoshiro.B32.P128.pas', 27 | LUX.Random.Xoshiro.B64.P128 in '_LIBRARY\LUXOPHIA\LUX\Random\Xoshiro\B64\LUX.Random.Xoshiro.B64.P128.pas', 28 | LUX.Random.Xoshiro.B64.P256 in '_LIBRARY\LUXOPHIA\LUX\Random\Xoshiro\B64\LUX.Random.Xoshiro.B64.P256.pas', 29 | LUX.Random.Xoshiro.B64.P512 in '_LIBRARY\LUXOPHIA\LUX\Random\Xoshiro\B64\LUX.Random.Xoshiro.B64.P512.pas', 30 | LUX.Random.SFMT.P4253 in '_LIBRARY\LUXOPHIA\LUX\Random\SFMT\LUX.Random.SFMT.P4253.pas', 31 | LUX.Random.SFMT.P11213 in '_LIBRARY\LUXOPHIA\LUX\Random\SFMT\LUX.Random.SFMT.P11213.pas', 32 | LUX.Random.SFMT.P19937 in '_LIBRARY\LUXOPHIA\LUX\Random\SFMT\LUX.Random.SFMT.P19937.pas', 33 | LUX.Random.SFMT.P44497 in '_LIBRARY\LUXOPHIA\LUX\Random\SFMT\LUX.Random.SFMT.P44497.pas', 34 | LUX.Random.SFMT.P86243 in '_LIBRARY\LUXOPHIA\LUX\Random\SFMT\LUX.Random.SFMT.P86243.pas', 35 | LUX.Random.SFMT.P132049 in '_LIBRARY\LUXOPHIA\LUX\Random\SFMT\LUX.Random.SFMT.P132049.pas', 36 | LUX.Random.SFMT.P216091 in '_LIBRARY\LUXOPHIA\LUX\Random\SFMT\LUX.Random.SFMT.P216091.pas', 37 | LUX.Random.SFMT.P607 in '_LIBRARY\LUXOPHIA\LUX\Random\SFMT\LUX.Random.SFMT.P607.pas', 38 | LUX.Random.SFMT.P1279 in '_LIBRARY\LUXOPHIA\LUX\Random\SFMT\LUX.Random.SFMT.P1279.pas', 39 | LUX.Random.SFMT.P2281 in '_LIBRARY\LUXOPHIA\LUX\Random\SFMT\LUX.Random.SFMT.P2281.pas', 40 | LUX.D5 in '_LIBRARY\LUXOPHIA\LUX\LUX.D5.pas', 41 | LUX.DN in '_LIBRARY\LUXOPHIA\LUX\LUX.DN.pas', 42 | LUX in '_LIBRARY\LUXOPHIA\LUX\LUX.pas', 43 | LUX.D1 in '_LIBRARY\LUXOPHIA\LUX\LUX.D1.pas', 44 | LUX.D2 in '_LIBRARY\LUXOPHIA\LUX\LUX.D2.pas', 45 | LUX.D2x2 in '_LIBRARY\LUXOPHIA\LUX\LUX.D2x2.pas', 46 | LUX.D2x4 in '_LIBRARY\LUXOPHIA\LUX\LUX.D2x4.pas', 47 | LUX.D2x4x4 in '_LIBRARY\LUXOPHIA\LUX\LUX.D2x4x4.pas', 48 | LUX.D3 in '_LIBRARY\LUXOPHIA\LUX\LUX.D3.pas', 49 | LUX.D3x3 in '_LIBRARY\LUXOPHIA\LUX\LUX.D3x3.pas', 50 | LUX.D3x4 in '_LIBRARY\LUXOPHIA\LUX\LUX.D3x4.pas', 51 | LUX.D3x4x4 in '_LIBRARY\LUXOPHIA\LUX\LUX.D3x4x4.pas', 52 | LUX.D4 in '_LIBRARY\LUXOPHIA\LUX\LUX.D4.pas', 53 | LUX.D4x4 in '_LIBRARY\LUXOPHIA\LUX\LUX.D4x4.pas', 54 | LUX.D4x4x4 in '_LIBRARY\LUXOPHIA\LUX\LUX.D4x4x4.pas'; 55 | 56 | {$R *.res} 57 | 58 | begin 59 | Application.Initialize; 60 | Application.CreateForm(TForm1, Form1); 61 | Application.Run; 62 | end. 63 | 64 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Color/_VCL/LUX.Color.Grid.D1.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Color.Grid.D1; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses System.UITypes, 6 | Vcl.Graphics, 7 | LUX, LUX.Data.Lattice.T1, LUX.Color; 8 | 9 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 10 | 11 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid1D<_TItem_> 16 | 17 | TPoinColorGrid1D<_TItem_> = class( TPoinArray1D<_TItem_> ) 18 | private 19 | protected 20 | ///// メソッド 21 | procedure DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); overload; 22 | public 23 | end; 24 | 25 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid1D<_TItem_> 26 | 27 | TCellColorGrid1D<_TItem_> = class( TCellArray1D<_TItem_> ) 28 | private 29 | protected 30 | ///// メソッド 31 | procedure DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); overload; 32 | public 33 | end; 34 | 35 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 36 | 37 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 38 | 39 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 40 | 41 | implementation //############################################################### ■ 42 | 43 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 44 | 45 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 46 | 47 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid1D<_TItem_> 48 | 49 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 50 | 51 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 52 | 53 | /////////////////////////////////////////////////////////////////////// メソッド 54 | 55 | procedure TPoinColorGrid1D<_TItem_>.DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); 56 | var 57 | P :PAlphaColor; 58 | X :Integer; 59 | begin 60 | BMP_.SetSize( PoinsX, 1 ); 61 | 62 | P := BMP_.ScanLine[ 0 ]; 63 |  64 | for X := 0 to PoinsX-1 do 65 | begin 66 | P^ := Func_( X ); Inc( P ); 67 | end; 68 | end; 69 | 70 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 71 | 72 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid1D 73 | 74 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 75 | 76 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 77 | 78 | /////////////////////////////////////////////////////////////////////// メソッド 79 | 80 | procedure TCellColorGrid1D<_TItem_>.DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); 81 | var 82 | P :PAlphaColor; 83 | X :Integer; 84 | begin 85 | BMP_.SetSize( CellsX, 1 ); 86 | 87 | P := BMP_.Scanline[ 0 ]; 88 | 89 | for X := 0 to CellsX-1 do 90 | begin 91 | P^ := Func_( X ); Inc( P ); 92 | end; 93 | end; 94 | 95 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 96 | 97 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 98 | 99 | //############################################################################## □ 100 | 101 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 102 | 103 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 104 | 105 | end. //######################################################################### ■ 106 | -------------------------------------------------------------------------------- /Main.pas: -------------------------------------------------------------------------------- 1 | unit Main; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 7 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, 8 | FMX.TabControl, FMX.Objects, FMX.Controls.Presentation, FMX.StdCtrls, 9 | MethodsFrame, 10 | LUX, LUX.D3, LUX.D4, 11 | LUX.Random; 12 | 13 | type 14 | TForm1 = class(TForm) 15 | LabelX: TLabel; 16 | LabelY: TLabel; 17 | Image1: TImage; 18 | Timer1: TTimer; 19 | TabControl1: TTabControl; 20 | TabItemS: TTabItem; 21 | FrameMS: TFrameM; 22 | TabItemR: TTabItem; 23 | FrameMR: TFrameM; 24 | procedure FormCreate(Sender: TObject); 25 | procedure Timer1Timer(Sender: TObject); 26 | procedure FrameMSStringGridMSelectCell(Sender: TObject; const ACol, ARow: Integer; var CanSelect: Boolean); 27 | procedure FrameMRStringGridMSelectCell(Sender: TObject; const ACol, ARow: Integer; var CanSelect: Boolean); 28 | private 29 | { private 宣言 } 30 | ///// メソッド 31 | procedure ShowRands; 32 | public 33 | { public 宣言 } 34 | _SeedO :IRandom; 35 | _RandC :CRandom; 36 | _Rands :TArray2; 37 | _ThresN :Integer; 38 | _SequsN :Integer; 39 | end; 40 | 41 | var 42 | Form1: TForm1; 43 | 44 | implementation //############################################################### ■ 45 | 46 | {$R *.fmx} 47 | 48 | uses System.Math, System.Threading, 49 | FMX.Grid; 50 | 51 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 52 | 53 | /////////////////////////////////////////////////////////////////////// メソッド 54 | 55 | procedure TForm1.ShowRands; 56 | var 57 | B :TBitmapData; 58 | begin 59 | with Image1.Bitmap do 60 | begin 61 | SetSize( _SequsN, _ThresN ); 62 | 63 | Map( TMapAccess.Write, B ); 64 | 65 | TParallel.For( 16, 0, _ThresN-1, procedure( Y:Integer ) 66 | var 67 | X :Integer; 68 | P :PAlphaColor; 69 | C :Single; 70 | begin 71 | P := B.GetScanline( _ThresN-1 - Y ); 72 | 73 | for X := 0 to _SequsN-1 do 74 | begin 75 | C := Power( _Rands[ Y, X ], 1 / 2.2{Gamma} ); 76 | 77 | P^ := TAlphaColorF.Create( C, C, C ).ToAlphaColor; Inc( P ); 78 | end; 79 | end ); 80 | 81 | Unmap( B ); 82 | end; 83 | end; 84 | 85 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 86 | 87 | procedure TForm1.FrameMSStringGridMSelectCell(Sender: TObject; const ACol, ARow: Integer; var CanSelect: Boolean); 88 | begin 89 | FrameMS.StringGridMSelectCell(Sender, ACol, ARow, CanSelect); 90 | 91 | _SeedO := FrameMS.Method.Create; 92 | end; 93 | 94 | procedure TForm1.FrameMRStringGridMSelectCell(Sender: TObject; const ACol, ARow: Integer; var CanSelect: Boolean); 95 | begin 96 | FrameMR.StringGridMSelectCell(Sender, ACol, ARow, CanSelect); 97 | 98 | _RandC := FrameMR.Method; 99 | end; 100 | 101 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 102 | 103 | procedure TForm1.FormCreate(Sender: TObject); 104 | begin 105 | _ThresN := 256; 106 | _SequsN := 256; 107 | 108 | SetLength( _Rands, _ThresN, _SequsN ); 109 | 110 | FrameMS.StringGridM.SelectRow( 0 ); 111 | FrameMR.StringGridM.SelectRow( 1 ); 112 | end; 113 | 114 | //////////////////////////////////////////////////////////////////////////////// 115 | 116 | procedure TForm1.Timer1Timer(Sender: TObject); 117 | var 118 | Y, X :Integer; 119 | R :IRandom; 120 | begin 121 | for Y := 0 to _ThresN-1 do 122 | begin 123 | R := _RandC.Create( _SeedO ); 124 | 125 | for X := 0 to _SequsN-1 do _Rands[ Y, X ] := R.DrawRandFlo64s; 126 | end; 127 | 128 | ShowRands; 129 | end; 130 | 131 | end. //######################################################################### ■ 132 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Color/_FMX/LUX.Color.Grid.D1.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Color.Grid.D1; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses System.UITypes, 6 | FMX.Graphics, 7 | LUX, 8 | LUX.Data.Grid.T1, 9 | LUX.Color; 10 | 11 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 14 | 15 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 16 | 17 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid1D<_TItem_> 18 | 19 | TPoinColorGrid1D<_TItem_> = class( TPoinArray1D<_TItem_> ) 20 | private 21 | protected 22 | ///// メソッド 23 | procedure DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); overload; 24 | public 25 | end; 26 | 27 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid1D<_TItem_> 28 | 29 | TCellColorGrid1D<_TItem_> = class( TCellArray1D<_TItem_> ) 30 | private 31 | protected 32 | ///// メソッド 33 | procedure DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); overload; 34 | public 35 | end; 36 | 37 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 38 | 39 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 40 | 41 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 42 | 43 | implementation //############################################################### ■ 44 | 45 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 46 | 47 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 48 | 49 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid1D<_TItem_> 50 | 51 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 52 | 53 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 54 | 55 | /////////////////////////////////////////////////////////////////////// メソッド 56 | 57 | procedure TPoinColorGrid1D<_TItem_>.DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); 58 | var 59 | B :TBitmapData; 60 | P :PAlphaColor; 61 | X :Integer; 62 | begin 63 | BMP_.SetSize( PoinsX, 1 ); 64 | 65 | BMP_.Map( TMapAccess.Write, B ); 66 | 67 | P := B.GetScanline( 0 ); 68 | 69 | for X := 0 to PoinsX-1 do 70 | begin 71 | P^ := Func_( X ); Inc( P ); 72 | end; 73 | 74 | BMP_.Unmap( B ); 75 | end; 76 | 77 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 78 | 79 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid1D 80 | 81 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 82 | 83 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 84 | 85 | /////////////////////////////////////////////////////////////////////// メソッド 86 | 87 | procedure TCellColorGrid1D<_TItem_>.DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); 88 | var 89 | B :TBitmapData; 90 | P :PAlphaColor; 91 | X :Integer; 92 | begin 93 | BMP_.SetSize( CellsX, 1 ); 94 | 95 | BMP_.Map( TMapAccess.Write, B ); 96 | 97 | P := B.GetScanline( 0 ); 98 | 99 | for X := 0 to CellsX-1 do 100 | begin 101 | P^ := Func_( X ); Inc( P ); 102 | end; 103 | 104 | BMP_.Unmap( B ); 105 | end; 106 | 107 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 108 | 109 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 110 | 111 | //############################################################################## □ 112 | 113 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 114 | 115 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 116 | 117 | end. //######################################################################### ■ 118 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Color/_VCL/LUX.Color.Grid.D2.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Color.Grid.D2; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses System.UITypes, 6 | Vcl.Graphics, 7 | LUX, LUX.Data.Lattice.T2, LUX.Color; 8 | 9 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 10 | 11 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid2D<_TItem_> 16 | 17 | TPoinColorGrid2D<_TItem_> = class( TPoinArray2D<_TItem_> ) 18 | private 19 | protected 20 | ///// メソッド 21 | procedure DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); overload; 22 | public 23 | end; 24 | 25 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid2D<_TItem_> 26 | 27 | TCellColorGrid2D<_TItem_> = class( TCellArray2D<_TItem_> ) 28 | private 29 | protected 30 | ///// メソッド 31 | procedure DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); overload; 32 | public 33 | end; 34 | 35 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 36 | 37 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 38 | 39 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 40 | 41 | implementation //############################################################### ■ 42 | 43 | uses System.Threading; 44 | 45 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 46 | 47 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 48 | 49 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid2D<_TItem_> 50 | 51 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 52 | 53 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 54 | 55 | /////////////////////////////////////////////////////////////////////// メソッド 56 | 57 | procedure TPoinColorGrid2D<_TItem_>.DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); 58 | begin 59 | BMP_.SetSize( PoinsX, PoinsY ); 60 | 61 | TParallel.For( 0, PoinsY-1, procedure( Y:Integer ) 62 | var 63 | P :PAlphaColor; 64 | X :Integer; 65 | begin 66 | P := BMP_.Scanline[ Y ]; 67 | 68 | for X := 0 to PoinsX-1 do 69 | begin 70 | P^ := Func_( X, Y ); Inc( P ); 71 | end; 72 | end ); 73 | end; 74 | 75 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 76 | 77 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid2D 78 | 79 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 80 | 81 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 82 | 83 | /////////////////////////////////////////////////////////////////////// メソッド 84 | 85 | procedure TCellColorGrid2D<_TItem_>.DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); 86 | begin 87 | BMP_.SetSize( CellsX, CellsY ); 88 | 89 | TParallel.For( 0, CellsY-1, procedure( Y:Integer ) 90 | var 91 | P :PAlphaColor; 92 | X :Integer; 93 | begin 94 | P := BMP_.Scanline[ Y ]; 95 | 96 | for X := 0 to CellsX-1 do 97 | begin 98 | P^ := Func_( X, Y ); Inc( P ); 99 | end; 100 | end ); 101 | end; 102 | 103 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 104 | 105 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 106 | 107 | //############################################################################## □ 108 | 109 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 110 | 111 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 112 | 113 | end. //######################################################################### ■ 114 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Data/Grid/LUX.Data.Grid.T1.D1.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Data.Grid.T1.D1; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX.Data.Grid.T1, 6 | LUX.Curve.CatRom; 7 | 8 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 9 | 10 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 11 | 12 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 13 | 14 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSingleIrreMap1D 15 | 16 | TSingleIrreMap1D = class( TIrreMap1D ) 17 | private 18 | protected 19 | ///// メソッド 20 | function Interp( const G0_,G1_,G2_,G3_:Single; const Id_:Single ) :Single; overload; override; 21 | function InterpPos( const G0_,G1_,G2_,G3_:TPosval1D; const Pos_:Single ) :Single; overload; override; 22 | public 23 | ///// メソッド 24 | procedure MakeEdgeExtra; 25 | end; 26 | 27 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 28 | 29 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 30 | 31 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 32 | 33 | implementation //############################################################### ■ 34 | 35 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 36 | 37 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 38 | 39 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSingleIrreMap1D 40 | 41 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 42 | 43 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 44 | 45 | /////////////////////////////////////////////////////////////////////// メソッド 46 | 47 | function TSingleIrreMap1D.Interp( const G0_,G1_,G2_,G3_:Single; const Id_:Single ) :Single; 48 | begin 49 | Result := CatmullRom( G0_, G1_, G2_, G3_, Id_ ); 50 | end; 51 | 52 | function TSingleIrreMap1D.InterpPos( const G0_,G1_,G2_,G3_:TPosval1D; const Pos_:Single ) :Single; 53 | begin 54 | Result := CatmullRom( G0_.Val, G1_.Val, G2_.Val, G3_.Val, 55 | G0_.Pos, G1_.Pos, G2_.Pos, G3_.Pos, Pos_ ); 56 | end; 57 | 58 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 59 | 60 | /////////////////////////////////////////////////////////////////////// メソッド 61 | 62 | procedure TSingleIrreMap1D.MakeEdgeExtra; 63 | var 64 | H, X :Integer; 65 | G0, G1, Gd, G :TPosval1D; 66 | begin 67 | { H 68 | | 69 | -3 -2 -1 00 +1 +2 +3 +4 +5 +6 +7 +8 +9 70 | ┠─╂─╂─┣━╋━╋━╋━╋━╋━┫─╂─╂─┨ 71 | -3 -2 -1 ・ ・ ・ ・ ・ ・ ・ +7 +8 +9 72 | G0 G1 G0 G1 } 73 | 74 | H := CellsX; 75 | 76 | G0 := Items[ 0 ]; 77 | G1 := Items[ 1 ]; 78 | 79 | Gd.Pos := G0.Pos - G1.Pos; 80 | Gd.Val := G0.Val - G1.Val; 81 | 82 | for X := 1 to _MargsX do 83 | begin 84 | with G do 85 | begin 86 | Pos := G0.Pos + X * Gd.Pos; 87 | Val := G0.Val + X * Gd.Val; 88 | end; 89 | 90 | Poins[ 0-X ] := G; 91 | end; 92 | 93 | G0 := Items[ H-1 ]; 94 | G1 := Items[ H ]; 95 | 96 | Gd.Pos := G1.Pos - G0.Pos; 97 | Gd.Val := G1.Val - G0.Val; 98 | 99 | for X := 1 to _MargsX do 100 | begin 101 | with G do 102 | begin 103 | Pos := G1.Pos + X * Gd.Pos; 104 | Val := G1.Val + X * Gd.Pos; 105 | end; 106 | 107 | Poins[ H+X ] := G; 108 | end; 109 | end; 110 | 111 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 112 | 113 | //############################################################################## □ 114 | 115 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 116 | 117 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 118 | 119 | end. //######################################################################### ■ 120 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Color/_VCL/LUX.Color.Grid.D3.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Color.Grid.D3; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses System.UITypes, 6 | Vcl.Graphics, 7 | LUX, LUX.Data.Lattice.T3, LUX.Color; 8 | 9 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 10 | 11 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid3D<_TItem_> 16 | 17 | TPoinColorGrid3D<_TItem_> = class( TPoinArray3D<_TItem_> ) 18 | private 19 | protected 20 | ///// メソッド 21 | procedure DrawToXY( const BMP_:TBitmap; Z_:Integer; const Func_:TConstFunc ); overload; 22 | public 23 | end; 24 | 25 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid3D<_TItem_> 26 | 27 | TCellColorGrid3D<_TItem_> = class( TCellArray3D<_TItem_> ) 28 | private 29 | protected 30 | ///// メソッド 31 | procedure DrawToXY( const BMP_:TBitmap; Z_:Integer; const Func_:TConstFunc ); overload; 32 | public 33 | end; 34 | 35 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 36 | 37 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 38 | 39 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 40 | 41 | implementation //############################################################### ■ 42 | 43 | uses System.Threading; 44 | 45 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 46 | 47 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 48 | 49 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid3D<_TItem_> 50 | 51 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 52 | 53 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 54 | 55 | /////////////////////////////////////////////////////////////////////// メソッド 56 | 57 | procedure TPoinColorGrid3D<_TItem_>.DrawToXY( const BMP_:TBitmap; Z_:Integer; const Func_:TConstFunc ); 58 | begin 59 | BMP_.SetSize( PoinsX, PoinsY ); 60 | 61 | TParallel.For( 0, PoinsY-1, procedure( Y:Integer ) 62 | var 63 | P :PAlphaColor; 64 | X :Integer; 65 | begin 66 | P := BMP_.Scanline[ Y ]; 67 | 68 | for X := 0 to PoinsX-1 do 69 | begin 70 | P^ := Func_( X, Y, Z_ ); Inc( P ); 71 | end; 72 | end ); 73 | end; 74 | 75 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 76 | 77 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid3D 78 | 79 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 80 | 81 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 82 | 83 | /////////////////////////////////////////////////////////////////////// メソッド 84 | 85 | procedure TCellColorGrid3D<_TItem_>.DrawToXY( const BMP_:TBitmap; Z_:Integer; const Func_:TConstFunc ); 86 | begin 87 | BMP_.SetSize( CellsX, CellsY ); 88 | 89 | TParallel.For( 0, CellsY-1, procedure( Y:Integer ) 90 | var 91 | P :PAlphaColor; 92 | X :Integer; 93 | begin 94 | P := BMP_.Scanline[ Y ]; 95 | 96 | for X := 0 to CellsX-1 do 97 | begin 98 | P^ := Func_( X, Y, Z_ ); Inc( P ); 99 | end; 100 | end ); 101 | end; 102 | 103 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 104 | 105 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 106 | 107 | //############################################################################## □ 108 | 109 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 110 | 111 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 112 | 113 | end. //######################################################################### ■ 114 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/LUX.Random.Xoshiro.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.Xoshiro; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D2, LUX.D3, LUX.D4, 6 | LUX.Random; 7 | 8 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 9 | 10 | IRandomSHI<_TSeed_:record> = interface; 11 | 12 | TRandomSHI<_TSeed_:record> = class; 13 | TRandom32SHI<_TSeed_:record> = class; 14 | TRandom64SHI<_TSeed_:record> = class; 15 | 16 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 17 | 18 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 19 | 20 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandomSHI<_TSeed_> 21 | 22 | IRandomSHI<_TSeed_:record> = interface( IRandom<_TSeed_> ) 23 | ['{DCD720B8-D569-4949-8BD0-1BF7A436BB62}'] 24 | {protected} 25 | {public} 26 | end; 27 | 28 | //------------------------------------------------------------------------- 29 | 30 | TRandomSHI<_TSeed_:record> = class( TRandom<_TSeed_>, IRandomSHI<_TSeed_> ) 31 | private 32 | protected 33 | public 34 | end; 35 | 36 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SHI<_TSeed_> 37 | 38 | TRandom32SHI<_TSeed_:record> = class( TRandomSHI<_TSeed_> ) 39 | private 40 | protected 41 | ///// メソッド 42 | function rotl( const X_:Int32u; const K_:Int32s ) :Int32u; overload; inline; 43 | public 44 | end; 45 | 46 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SHI<_TSeed_> 47 | 48 | TRandom64SHI<_TSeed_:record> = class( TRandomSHI<_TSeed_> ) 49 | private 50 | protected 51 | ///// メソッド 52 | function rotl( const X_:Int64u; const K_:Int64s ) :Int64u; overload; inline; 53 | public 54 | end; 55 | 56 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 57 | 58 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 59 | 60 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 61 | 62 | implementation //############################################################### ■ 63 | 64 | uses System.SysUtils; 65 | 66 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 67 | 68 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 69 | 70 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandomSHI<_TSeed_> 71 | 72 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 73 | 74 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 75 | 76 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 77 | 78 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SHI<_TSeed_> 79 | 80 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 81 | 82 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 83 | 84 | /////////////////////////////////////////////////////////////////////// メソッド 85 | 86 | function TRandom32SHI<_TSeed_>.rotl( const X_:Int32u; const K_:Int32s ) :Int32u; 87 | begin 88 | Result := ( X_ shl K_ ) or ( X_ shr ( 32 - K_ ) ); 89 | end; 90 | 91 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 92 | 93 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SHI<_TSeed_> 94 | 95 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 96 | 97 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 98 | 99 | /////////////////////////////////////////////////////////////////////// メソッド 100 | 101 | function TRandom64SHI<_TSeed_>.rotl( const X_:Int64u; const K_:Int64s ) :Int64u; 102 | begin 103 | Result := ( X_ shl K_ ) or ( X_ shr ( 64 - K_ ) ); 104 | end; 105 | 106 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 107 | 108 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 109 | 110 | //############################################################################## □ 111 | 112 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 113 | 114 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 115 | 116 | end. //######################################################################### ■ 117 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Color/_FMX/LUX.Color.Grid.D3.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Color.Grid.D3; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses System.UITypes, 6 | FMX.Graphics, 7 | LUX, 8 | LUX.Data.Grid.T3, 9 | LUX.Color; 10 | 11 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 14 | 15 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 16 | 17 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid3D<_TItem_> 18 | 19 | TPoinColorGrid3D<_TItem_> = class( TPoinArray3D<_TItem_> ) 20 | private 21 | protected 22 | ///// メソッド 23 | procedure DrawToXY( const BMP_:TBitmap; Z_:Integer; const Func_:TConstFunc ); overload; 24 | public 25 | end; 26 | 27 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid3D<_TItem_> 28 | 29 | TCellColorGrid3D<_TItem_> = class( TCellArray3D<_TItem_> ) 30 | private 31 | protected 32 | ///// メソッド 33 | procedure DrawToXY( const BMP_:TBitmap; Z_:Integer; const Func_:TConstFunc ); overload; 34 | public 35 | end; 36 | 37 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 38 | 39 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 40 | 41 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 42 | 43 | implementation //############################################################### ■ 44 | 45 | uses System.Threading; 46 | 47 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 48 | 49 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 50 | 51 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid3D<_TItem_> 52 | 53 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 54 | 55 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 56 | 57 | /////////////////////////////////////////////////////////////////////// メソッド 58 | 59 | procedure TPoinColorGrid3D<_TItem_>.DrawToXY( const BMP_:TBitmap; Z_:Integer; const Func_:TConstFunc ); 60 | var 61 | B :TBitmapData; 62 | begin 63 | BMP_.SetSize( PoinsX, PoinsY ); 64 | 65 | BMP_.Map( TMapAccess.Write, B ); 66 | 67 | TParallel.For( 0, PoinsY-1, procedure( Y:Integer ) 68 | var 69 | P :PAlphaColor; 70 | X :Integer; 71 | begin 72 | P := B.GetScanline( Y ); 73 | 74 | for X := 0 to PoinsX-1 do 75 | begin 76 | P^ := Func_( X, Y, Z_ ); Inc( P ); 77 | end; 78 | end ); 79 | 80 | BMP_.Unmap( B ); 81 | end; 82 | 83 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 84 | 85 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid3D 86 | 87 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 88 | 89 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 90 | 91 | /////////////////////////////////////////////////////////////////////// メソッド 92 | 93 | procedure TCellColorGrid3D<_TItem_>.DrawToXY( const BMP_:TBitmap; Z_:Integer; const Func_:TConstFunc ); 94 | var 95 | B :TBitmapData; 96 | begin 97 | BMP_.SetSize( CellsX, CellsY ); 98 | 99 | BMP_.Map( TMapAccess.Write, B ); 100 | 101 | TParallel.For( 0, CellsY-1, procedure( Y:Integer ) 102 | var 103 | P :PAlphaColor; 104 | X :Integer; 105 | begin 106 | P := B.GetScanline( Y ); 107 | 108 | for X := 0 to CellsX-1 do 109 | begin 110 | P^ := Func_( X, Y, Z_ ); Inc( P ); 111 | end; 112 | end ); 113 | 114 | BMP_.Unmap( B ); 115 | end; 116 | 117 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 118 | 119 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 120 | 121 | //############################################################################## □ 122 | 123 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 124 | 125 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 126 | 127 | end. //######################################################################### ■ 128 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/FMX/LUX.FMX.Forms.pas: -------------------------------------------------------------------------------- 1 | unit LUX.FMX.Forms; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses System.Types, System.UITypes, System.Classes, 6 | FMX.Types, FMX.Forms, FMX.Graphics, 7 | LUX, 8 | LUX.FMX.Pratform; 9 | 10 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 11 | 12 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 13 | 14 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 15 | 16 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HCommonCustomForm 17 | 18 | HCommonCustomForm = class helper for TCommonCustomForm 19 | private 20 | protected 21 | public 22 | ///// メソッド 23 | function MousePos :TPointF; 24 | end; 25 | 26 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HCustomForm 27 | 28 | HCustomForm = class helper for TCustomForm 29 | private 30 | protected 31 | public 32 | ///// メソッド 33 | function MakeScreenShot :TBitmap; 34 | end; 35 | 36 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TLuxCommonCustomForm 37 | 38 | TLuxCommonCustomForm = class( FMX.Forms.TCommonCustomForm ) 39 | private 40 | protected 41 | ///// イベント 42 | _OnMouseClick :TMouseEvent; 43 | public 44 | ///// イベント 45 | property OnMouseClick :TMouseEvent read _OnMouseClick write _OnMouseClick; 46 | ///// メソッド 47 | procedure MouseUp( Button_:TMouseButton; Shift_:TShiftState; X_,Y_:Single; DoClick_:Boolean = True ); override; 48 | end; 49 | 50 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 51 | 52 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 53 | 54 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 55 | 56 | implementation //############################################################### ■ 57 | 58 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 59 | 60 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 61 | 62 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HCommonCustomForm 63 | 64 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 65 | 66 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 67 | 68 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 69 | 70 | /////////////////////////////////////////////////////////////////////// メソッド 71 | 72 | function HCommonCustomForm.MousePos :TPointF; 73 | begin 74 | Result := ScreenToClient( Screen.MousePos ); 75 | end; 76 | 77 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HCustomForm 78 | 79 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 80 | 81 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 82 | 83 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 84 | 85 | /////////////////////////////////////////////////////////////////////// メソッド 86 | 87 | function HCustomForm.MakeScreenshot :TBitmap; 88 | begin 89 | Result := TBitmap.Create; 90 | 91 | with Result do 92 | begin 93 | BitmapScale := GetDisplayScale; 94 | 95 | SetSize( Round( BitmapScale * ClientWidth ), 96 | Round( BitmapScale * ClientHeight ) ); 97 | 98 | PaintTo( Canvas ); 99 | end; 100 | end; 101 | 102 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TLuxCommonCustomForm 103 | 104 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 105 | 106 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 107 | 108 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 109 | 110 | procedure TLuxCommonCustomForm.MouseUp( Button_:TMouseButton; Shift_:TShiftState; X_,Y_:Single; DoClick_:Boolean = True ); 111 | begin 112 | if Assigned( _OnMouseClick ) and DoClick_ then _OnMouseClick( Self, Button_, Shift_, X_, Y_ ); 113 | 114 | inherited; 115 | end; 116 | 117 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 118 | 119 | //############################################################################## □ 120 | 121 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 122 | 123 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 124 | 125 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/Xoshiro/LUX.Random.Xoshiro.B32.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.Xoshiro.B32; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D2, LUX.D4, 6 | LUX.Random, 7 | LUX.Random.Xoshiro; 8 | 9 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 10 | 11 | TRandom32ROS64 = class; 12 | TRandom32XOS128 = class; 13 | 14 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 15 | 16 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 17 | 18 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32ROS64 19 | 20 | IRandom32ROS64 = interface( IRandom ) 21 | ['{E6D4EE10-CCC9-4E35-AD85-D94987524CDF}'] 22 | {protected} 23 | {public} 24 | end; 25 | 26 | //------------------------------------------------------------------------- 27 | 28 | TRandom32ROS64 = class( TRandom32SHI, IRandom32ROS64 ) 29 | private 30 | protected 31 | ///// メソッド 32 | procedure CalcNextSeed; override; 33 | public 34 | constructor CreateFromRand( const Random_:IRandom ); overload; override; 35 | end; 36 | 37 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128 38 | 39 | IRandom32XOS128 = interface( IRandom ) 40 | ['{3A1CEE71-C699-4F5F-BCF8-1ABEC365DC82}'] 41 | {protected} 42 | {public} 43 | end; 44 | 45 | //------------------------------------------------------------------------- 46 | 47 | TRandom32XOS128 = class( TRandom32SHI, IRandom32XOS128 ) 48 | private 49 | protected 50 | ///// メソッド 51 | procedure CalcNextSeed; override; 52 | public 53 | constructor CreateFromRand( const Random_:IRandom ); overload; override; 54 | end; 55 | 56 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 57 | 58 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 59 | 60 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 61 | 62 | implementation //############################################################### ■ 63 | 64 | uses System.SysUtils; 65 | 66 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 67 | 68 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 69 | 70 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32ROS64 71 | 72 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 73 | 74 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 75 | 76 | /////////////////////////////////////////////////////////////////////// メソッド 77 | 78 | procedure TRandom32ROS64.CalcNextSeed; 79 | var 80 | S :TInt32u2D; 81 | begin 82 | S := _Seed; 83 | 84 | with S do 85 | begin 86 | Y := Y xor X; 87 | 88 | _Seed.X := rotl( X, 26 ) xor Y xor ( Y shl 9 ); // a, b 89 | _Seed.Y := rotl( Y, 13 ); // c 90 | end; 91 | end; 92 | 93 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 94 | 95 | constructor TRandom32ROS64.CreateFromRand( const Random_:IRandom ); 96 | begin 97 | Create( TInt32u2D.Create( Random_.DrawRandInt32u, 98 | Random_.DrawRandInt32u ) ); 99 | end; 100 | 101 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128 102 | 103 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 104 | 105 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 106 | 107 | /////////////////////////////////////////////////////////////////////// メソッド 108 | 109 | procedure TRandom32XOS128.CalcNextSeed; 110 | var 111 | T :Int32u; 112 | begin 113 | with _Seed do 114 | begin 115 | T := Y shl 9; 116 | 117 | Z := Z xor X; 118 | W := W xor Y; 119 | Y := Y xor Z; 120 | X := X xor W; 121 | 122 | Z := Z xor T; 123 | 124 | W := rotl( W, 11 ); 125 | end; 126 | end; 127 | 128 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 129 | 130 | constructor TRandom32XOS128.CreateFromRand( const Random_:IRandom ); 131 | begin 132 | Create( TInt32u4D.Create( Random_.DrawRandInt32u, 133 | Random_.DrawRandInt32u, 134 | Random_.DrawRandInt32u, 135 | Random_.DrawRandInt32u ) ); 136 | end; 137 | 138 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 139 | 140 | //############################################################################## □ 141 | 142 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 143 | 144 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 145 | 146 | end. //######################################################################### ■ 147 | -------------------------------------------------------------------------------- /Main.fmx: -------------------------------------------------------------------------------- 1 | object Form1: TForm1 2 | Left = 0 3 | Top = 0 4 | Caption = 'Random' 5 | ClientHeight = 552 6 | ClientWidth = 795 7 | FormFactor.Width = 320 8 | FormFactor.Height = 480 9 | FormFactor.Devices = [Desktop] 10 | OnCreate = FormCreate 11 | DesignerMasterStyle = 0 12 | object LabelY: TLabel 13 | Position.X = 5.000000000000000000 14 | Position.Y = 85.000000000000000000 15 | RotationAngle = -90.000000000000000000 16 | RotationCenter.X = 0.000000000000000000 17 | RotationCenter.Y = 0.000000000000000000 18 | Size.Width = 55.000000000000000000 19 | Size.Height = 20.000000000000000000 20 | Size.PlatformDefault = False 21 | TextSettings.HorzAlign = Trailing 22 | Text = #8592' Thread' 23 | TabOrder = 0 24 | end 25 | object LabelX: TLabel 26 | Position.X = 30.000000000000000000 27 | Position.Y = 5.000000000000000000 28 | Size.Width = 70.000000000000000000 29 | Size.Height = 20.000000000000000000 30 | Size.PlatformDefault = False 31 | Text = 'Sequence '#8594 32 | TabOrder = 1 33 | end 34 | object Image1: TImage 35 | MultiResBitmap = < 36 | item 37 | end> 38 | Align = Client 39 | DisableInterpolation = True 40 | Margins.Left = 30.000000000000000000 41 | Margins.Top = 30.000000000000000000 42 | Margins.Bottom = 10.000000000000000000 43 | Size.Width = 512.000000000000000000 44 | Size.Height = 512.000000000000000000 45 | Size.PlatformDefault = False 46 | WrapMode = Stretch 47 | end 48 | object Timer1: TTimer 49 | Interval = 10 50 | OnTimer = Timer1Timer 51 | Left = 45 52 | Top = 45 53 | end 54 | object TabControl1: TTabControl 55 | Align = Right 56 | Margins.Left = 10.000000000000000000 57 | Margins.Top = 10.000000000000000000 58 | Margins.Right = 10.000000000000000000 59 | Margins.Bottom = 10.000000000000000000 60 | Position.X = 552.000000000000000000 61 | Position.Y = 10.000000000000000000 62 | Size.Width = 233.000000000000000000 63 | Size.Height = 532.000000000000000000 64 | Size.PlatformDefault = False 65 | TabIndex = 1 66 | TabOrder = 3 67 | TabPosition = PlatformDefault 68 | Sizes = ( 69 | 233s 70 | 506s 71 | 233s 72 | 506s) 73 | object TabItemS: TTabItem 74 | CustomIcon = < 75 | item 76 | end> 77 | IsSelected = False 78 | Size.Width = 46.000000000000000000 79 | Size.Height = 26.000000000000000000 80 | Size.PlatformDefault = False 81 | StyleLookup = '' 82 | TabOrder = 0 83 | Text = 'Seed' 84 | ExplicitSize.cx = 46.000000000000000000 85 | ExplicitSize.cy = 26.000000000000000000 86 | inline FrameMS: TFrameM 87 | Align = Client 88 | Margins.Left = 10.000000000000000000 89 | Margins.Top = 10.000000000000000000 90 | Margins.Right = 10.000000000000000000 91 | Margins.Bottom = 10.000000000000000000 92 | Size.Width = 213.000000000000000000 93 | Size.Height = 486.000000000000000000 94 | Size.PlatformDefault = False 95 | inherited StringGridM: TStringGrid 96 | Size.Height = 486.000000000000000000 97 | OnSelectCell = FrameMSStringGridMSelectCell 98 | Viewport.Width = 193.000000000000000000 99 | Viewport.Height = 461.000000000000000000 100 | inherited StringColumnA: TStringColumn 101 | Size.Width = 75.000000000000000000 102 | end 103 | inherited StringColumnP: TStringColumn 104 | Size.Width = 50.000000000000000000 105 | end 106 | inherited StringColumnB: TStringColumn 107 | Size.Width = 30.000000000000000000 108 | end 109 | inherited StringColumnS: TStringColumn 110 | Size.Width = 35.000000000000000000 111 | end 112 | end 113 | end 114 | end 115 | object TabItemR: TTabItem 116 | CustomIcon = < 117 | item 118 | end> 119 | IsSelected = True 120 | Size.Width = 48.000000000000000000 121 | Size.Height = 26.000000000000000000 122 | Size.PlatformDefault = False 123 | StyleLookup = '' 124 | TabOrder = 0 125 | Text = 'Rand' 126 | ExplicitSize.cx = 48.000000000000000000 127 | ExplicitSize.cy = 26.000000000000000000 128 | inline FrameMR: TFrameM 129 | Align = Client 130 | Margins.Left = 10.000000000000000000 131 | Margins.Top = 10.000000000000000000 132 | Margins.Right = 10.000000000000000000 133 | Margins.Bottom = 10.000000000000000000 134 | Size.Width = 213.000000000000000000 135 | Size.Height = 486.000000000000000000 136 | Size.PlatformDefault = False 137 | inherited StringGridM: TStringGrid 138 | Size.Height = 486.000000000000000000 139 | OnSelectCell = FrameMRStringGridMSelectCell 140 | Viewport.Width = 193.000000000000000000 141 | Viewport.Height = 461.000000000000000000 142 | inherited StringColumnA: TStringColumn 143 | Size.Width = 75.000000000000000000 144 | end 145 | inherited StringColumnP: TStringColumn 146 | Size.Width = 50.000000000000000000 147 | end 148 | inherited StringColumnB: TStringColumn 149 | Size.Width = 30.000000000000000000 150 | end 151 | inherited StringColumnS: TStringColumn 152 | Size.Width = 35.000000000000000000 153 | end 154 | end 155 | end 156 | end 157 | end 158 | end 159 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Data/Grid/LUX.Data.Grid.T2.D1.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Data.Grid.T2.D1; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, 6 | LUX.D1, LUX.D2, LUX.D4x4, 7 | LUX.Data.Grid.T2, 8 | LUX.Curve.BSpline.D2; 9 | 10 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 11 | 12 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 13 | 14 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 15 | 16 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSingleGridMap2T 17 | 18 | TSingleGridMap2T = class( TPoinArray2D ) 19 | private 20 | protected 21 | public 22 | constructor Create; overload; 23 | constructor Create( const CellsX_,CellsY_:Integer ); overload; 24 | destructor Destroy; override; 25 | ///// メソッド 26 | procedure Patch( const T_:TSingle2D; out M_:TSingleM4 ); overload; 27 | procedure Patch( const T_:TSingle2D; out M_:TdSingleM4 ); overload; 28 | function Interp( const T_:TSingle2D ) :Single; overload; 29 | function Interp( const T_:TdSingle2D ) :TdSingle; overload; 30 | function Nabla( const T_:TSingle2D ) :TSingle2D; 31 | end; 32 | 33 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 34 | 35 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 36 | 37 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 38 | 39 | implementation //############################################################### ■ 40 | 41 | uses System.Math; 42 | 43 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 44 | 45 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 46 | 47 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSingleGridMap2T 48 | 49 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 50 | 51 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 52 | 53 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 54 | 55 | constructor TSingleGridMap2T.Create; 56 | begin 57 | Create( 2, 2 ); 58 | end; 59 | 60 | constructor TSingleGridMap2T.Create( const CellsX_,CellsY_:Integer ); 61 | begin 62 | Create( CellsX_, CellsY_, 2, 2 ); 63 | end; 64 | 65 | destructor TSingleGridMap2T.Destroy; 66 | begin 67 | 68 | inherited; 69 | end; 70 | 71 | /////////////////////////////////////////////////////////////////////// メソッド 72 | 73 | procedure TSingleGridMap2T.Patch( const T_:TSingle2D; out M_:TSingleM4 ); 74 | var 75 | X1, X2, X3, X4, 76 | Y1, Y2, Y3, Y4 :Integer; 77 | begin 78 | X2 := Floor( T_.X ); X1 := X2 - 1; X3 := X2 + 1; X4 := X3 + 1; 79 | Y2 := Floor( T_.Y ); Y1 := Y2 - 1; Y3 := Y2 + 1; Y4 := Y3 + 1; 80 | 81 | with M_ do 82 | begin 83 | _11 := Poins[ X1, Y1 ]; _12 := Poins[ X2, Y1 ]; _13 := Poins[ X3, Y1 ]; _14 := Poins[ X4, Y1 ]; 84 | _21 := Poins[ X1, Y2 ]; _22 := Poins[ X2, Y2 ]; _23 := Poins[ X3, Y2 ]; _24 := Poins[ X4, Y2 ]; 85 | _31 := Poins[ X1, Y3 ]; _32 := Poins[ X2, Y3 ]; _33 := Poins[ X3, Y3 ]; _34 := Poins[ X4, Y3 ]; 86 | _41 := Poins[ X1, Y4 ]; _42 := Poins[ X2, Y4 ]; _43 := Poins[ X3, Y4 ]; _44 := Poins[ X4, Y4 ]; 87 | end; 88 | end; 89 | 90 | procedure TSingleGridMap2T.Patch( const T_:TSingle2D; out M_:TdSingleM4 ); 91 | var 92 | X1, X2, X3, X4, 93 | Y1, Y2, Y3, Y4 :Integer; 94 | begin 95 | X2 := Floor( T_.X ); X1 := X2 - 1; X3 := X2 + 1; X4 := X3 + 1; 96 | Y2 := Floor( T_.Y ); Y1 := Y2 - 1; Y3 := Y2 + 1; Y4 := Y3 + 1; 97 | 98 | with M_ do 99 | begin 100 | _11 := Poins[ X1, Y1 ]; _12 := Poins[ X2, Y1 ]; _13 := Poins[ X3, Y1 ]; _14 := Poins[ X4, Y1 ]; 101 | _21 := Poins[ X1, Y2 ]; _22 := Poins[ X2, Y2 ]; _23 := Poins[ X3, Y2 ]; _24 := Poins[ X4, Y2 ]; 102 | _31 := Poins[ X1, Y3 ]; _32 := Poins[ X2, Y3 ]; _33 := Poins[ X3, Y3 ]; _34 := Poins[ X4, Y3 ]; 103 | _41 := Poins[ X1, Y4 ]; _42 := Poins[ X2, Y4 ]; _43 := Poins[ X3, Y4 ]; _44 := Poins[ X4, Y4 ]; 104 | end; 105 | end; 106 | 107 | function TSingleGridMap2T.Interp( const T_:TSingle2D ) :Single; 108 | var 109 | M :TSingleM4; 110 | T :TSingle2D; 111 | begin 112 | Patch( T_, M ); 113 | 114 | T.X := Frac( T_.X ); 115 | T.Y := Frac( T_.Y ); 116 | 117 | Result := BSplin4( M, T ); 118 | end; 119 | 120 | function TSingleGridMap2T.Interp( const T_:TdSingle2D ) :TdSingle; 121 | var 122 | M :TdSingleM4; 123 | T :TdSingle2D; 124 | begin 125 | Patch( T_.o, M ); 126 | 127 | T.X.o := Frac( T_.X.o ); T.X.d := T_.X.d; 128 | T.Y.o := Frac( T_.Y.o ); T.Y.d := T_.Y.d; 129 | 130 | Result := BSplin4( M, T ); 131 | end; 132 | 133 | function TSingleGridMap2T.Nabla( const T_:TSingle2D ) :TSingle2D; 134 | var 135 | M :TdSingleM4; 136 | T :TdSingle2D; 137 | begin 138 | Patch( T_, M ); 139 | 140 | T.X.o := Frac( T_.X ); 141 | T.Y.o := Frac( T_.Y ); 142 | 143 | T.d := TSingle2D.Create( 1, 0 ); 144 | 145 | Result.X := BSplin4( M, T ).d; 146 | 147 | T.d := TSingle2D.Create( 0, 1 ); 148 | 149 | Result.Y := BSplin4( M, T ).d; 150 | end; 151 | 152 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 153 | 154 | //############################################################################## □ 155 | 156 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 157 | 158 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 159 | 160 | end. //######################################################################### ■ 161 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/FMX/LUX.FMX.Messaging.Win.pas: -------------------------------------------------------------------------------- 1 | unit LUX.FMX.Messaging.Win; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses System.Generics.Collections, 6 |    FMX.Platform, 7 | Winapi.Windows; 8 | 9 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 10 | 11 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 12 | 13 | TMessageEvent = reference to procedure( const MSG_:TMSG ); 14 | 15 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 16 | 17 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 18 | 19 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TMessageEventList 20 | 21 | TMessageEventList = TDictionary; 22 | 23 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TMessageService 24 | 25 | TMessageService = class( TInterfacedObject, IFMXApplicationService ) 26 | private 27 | class var OldAppService :IFMXApplicationService; 28 | class var NewAppService :IFMXApplicationService; 29 | ///// メソッド 30 | class procedure AddPlatformService; 31 | protected 32 | class var _EventList :TMessageEventList; 33 | public 34 | class constructor Create; 35 | class destructor Destroy; 36 | ///// メソッド 37 | procedure Run; 38 | function HandleMessage :Boolean; 39 | procedure WaitMessage; 40 | function GetDefaultTitle :String; 41 | function GetTitle :String; 42 | procedure SetTitle( const Value_:String ); 43 | function GetVersionString :String; 44 | procedure Terminate; 45 | function Terminating :Boolean; 46 | function Running :Boolean; 47 | ///// プロパティ 48 | class property EventList :TMessageEventList read _EventList ; 49 | property DefaultTitle :String read GetDefaultTitle ; 50 | property Title :String read GetTitle write SetTitle; 51 | property AppVersion :String read GetVersionString ; 52 | end; 53 | 54 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 55 | 56 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 57 | 58 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 59 | 60 | implementation //############################################################### ■ 61 | 62 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 63 | 64 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 65 | 66 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TMessageService 67 | 68 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 69 | 70 | class constructor TMessageService.Create; 71 | begin 72 | inherited; 73 | 74 | _EventList := TMessageEventList.Create; 75 | end; 76 | 77 | class destructor TMessageService.Destroy; 78 | begin 79 | _EventList.Free; 80 | 81 | inherited; 82 | end; 83 | 84 | /////////////////////////////////////////////////////////////////////// メソッド 85 | 86 | class procedure TMessageService.AddPlatformService; 87 | begin 88 | with TPlatformServices.Current do 89 | begin 90 | if SupportsPlatformService( IFMXApplicationService, IInterface( OldAppService ) ) then 91 | begin 92 | RemovePlatformService( IFMXApplicationService ); 93 | 94 | NewAppService := TMessageService.Create; 95 | 96 | AddPlatformService( IFMXApplicationService, NewAppService ); 97 | end; 98 | end; 99 | end; 100 | 101 | procedure TMessageService.Run; 102 | begin 103 | OldAppService.Run; 104 | end; 105 | 106 | function TMessageService.HandleMessage :Boolean; 107 | var 108 | M :TMsg; 109 | begin 110 | Result := PeekMessage( M, 0, 0, 0, PM_REMOVE ); 111 | 112 | if Result then 113 | begin 114 | if _EventList.ContainsKey( M.Message ) then _EventList[ M.Message ]( M ) 115 | else 116 | begin 117 | OldAppService.HandleMessage; 118 | OldAppService.HandleMessage; 119 | 120 | TranslateMessage( M ); 121 | DispatchMessage( M ); 122 | end; 123 | end; 124 | end; 125 | 126 | procedure TMessageService.WaitMessage; 127 | begin 128 | OldAppService.WaitMessage; 129 | end; 130 | 131 | function TMessageService.GetDefaultTitle :String; 132 | begin 133 | Result := OldAppService.GetDefaultTitle; 134 | end; 135 | 136 | function TMessageService.GetTitle :String; 137 | begin 138 | Result := OldAppService.GetTitle; 139 | end; 140 | 141 | procedure TMessageService.SetTitle( const Value_:String ); 142 | begin 143 | OldAppService.SetTitle( Value_ ); 144 | end; 145 | 146 | function TMessageService.GetVersionString: String; 147 | begin 148 | Result := OldAppService.GetVersionString; 149 | end; 150 | 151 | procedure TMessageService.Terminate; 152 | begin 153 | OldAppService.Terminate; 154 | end; 155 | 156 | function TMessageService.Terminating :Boolean; 157 | begin 158 | Result := OldAppService.Terminating; 159 | end; 160 | 161 | function TMessageService.Running :Boolean; 162 | begin 163 | Result := OldAppService.Running; 164 | end; 165 | 166 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 167 | 168 | //############################################################################## □ 169 | 170 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 171 | 172 | TMessageService.AddPlatformService; 173 | 174 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 175 | 176 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Color/_FMX/LUX.Color.Grid.D2.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Color.Grid.D2; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses System.UITypes, 6 | FMX.Graphics, 7 | LUX, 8 | LUX.Data.Grid.T2, 9 | LUX.Color; 10 | 11 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 14 | 15 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 16 | 17 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid2D<_TItem_> 18 | 19 | TPoinColorGrid2D<_TItem_> = class( TPoinArray2D<_TItem_> ) 20 | private 21 | protected 22 | ///// メソッド 23 | procedure DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); overload; 24 | procedure DrawFrom( const BMP_:TBitmap; const Func_:TConstFunc ); overload; 25 | public 26 | end; 27 | 28 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid2D<_TItem_> 29 | 30 | TCellColorGrid2D<_TItem_> = class( TCellArray2D<_TItem_> ) 31 | private 32 | protected 33 | ///// メソッド 34 | procedure DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); overload; 35 | procedure DrawFrom( const BMP_:TBitmap; const Func_:TConstFunc ); overload; 36 | public 37 | end; 38 | 39 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 40 | 41 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 42 | 43 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 44 | 45 | implementation //############################################################### ■ 46 | 47 | uses System.Threading; 48 | 49 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 50 | 51 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 52 | 53 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TPoinColorGrid2D<_TItem_> 54 | 55 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 56 | 57 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 58 | 59 | /////////////////////////////////////////////////////////////////////// メソッド 60 | 61 | procedure TPoinColorGrid2D<_TItem_>.DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); 62 | var 63 | B :TBitmapData; 64 | begin 65 | BMP_.SetSize( PoinsX, PoinsY ); 66 | 67 | BMP_.Map( TMapAccess.Write, B ); 68 | 69 | TParallel.For( 0, PoinsY-1, procedure( Y:Integer ) 70 | var 71 | P :PAlphaColor; 72 | X :Integer; 73 | begin 74 | P := B.GetScanline( Y ); 75 | 76 | for X := 0 to PoinsX-1 do 77 | begin 78 | P^ := Func_( X, Y ); Inc( P ); 79 | end; 80 | end ); 81 | 82 | BMP_.Unmap( B ); 83 | end; 84 | 85 | procedure TPoinColorGrid2D<_TItem_>.DrawFrom( const BMP_:TBitmap; const Func_:TConstFunc ); 86 | var 87 | B :TBitmapData; 88 | begin 89 | PoinsX := BMP_.Width ; 90 | PoinsY := BMP_.Height; 91 | 92 | BMP_.Map( TMapAccess.Read, B ); 93 | 94 | TParallel.For( 0, PoinsY-1, procedure( Y:Integer ) 95 | var 96 | P :PAlphaColor; 97 | X :Integer; 98 | begin 99 | P := B.GetScanline( Y ); 100 | 101 | for X := 0 to PoinsX-1 do 102 | begin 103 | Poins[ X, Y ] := Func_( P^ ); Inc( P ); 104 | end; 105 | end ); 106 | 107 | BMP_.Unmap( B ); 108 | end; 109 | 110 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 111 | 112 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCellColorGrid2D 113 | 114 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 115 | 116 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 117 | 118 | /////////////////////////////////////////////////////////////////////// メソッド 119 | 120 | procedure TCellColorGrid2D<_TItem_>.DrawTo( const BMP_:TBitmap; const Func_:TConstFunc ); 121 | var 122 | B :TBitmapData; 123 | begin 124 | BMP_.SetSize( CellsX, CellsY ); 125 | 126 | BMP_.Map( TMapAccess.Write, B ); 127 | 128 | TParallel.For( 0, CellsY-1, procedure( Y:Integer ) 129 | var 130 | P :PAlphaColor; 131 | X :Integer; 132 | begin 133 | P := B.GetScanline( Y ); 134 | 135 | for X := 0 to CellsX-1 do 136 | begin 137 | P^ := Func_( X, Y ); Inc( P ); 138 | end; 139 | end ); 140 | 141 | BMP_.Unmap( B ); 142 | end; 143 | 144 | 145 | procedure TCellColorGrid2D<_TItem_>.DrawFrom( const BMP_:TBitmap; const Func_:TConstFunc ); 146 | var 147 | B :TBitmapData; 148 | begin 149 | CellsX := BMP_.Width ; 150 | CellsY := BMP_.Height; 151 | 152 | BMP_.Map( TMapAccess.Read, B ); 153 | 154 | TParallel.For( 0, CellsY-1, procedure( Y:Integer ) 155 | var 156 | P :PAlphaColor; 157 | X :Integer; 158 | begin 159 | P := B.GetScanline( Y ); 160 | 161 | for X := 0 to CellsX-1 do 162 | begin 163 | Cells[ X, Y ] := Func_( P^ ); Inc( P ); 164 | end; 165 | end ); 166 | 167 | BMP_.Unmap( B ); 168 | end; 169 | 170 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 171 | 172 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 173 | 174 | //############################################################################## □ 175 | 176 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 177 | 178 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 179 | 180 | end. //######################################################################### ■ 181 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Data/Dictionary/LUX.Data.Dictionary.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Data.Dictionary; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses System.SysUtils, System.Generics.Collections, 6 | LUX; 7 | 8 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 9 | 10 | TDictItem<_TKey_,_TValue_> = class; 11 | 12 | TIndexDictionary<_TKey_,_TValue_> = class; 13 | 14 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 15 | 16 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 17 | 18 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDictItem<_TKey_,_TValue_> 19 | 20 | TDictItem<_TKey_,_TValue_> = class 21 | private 22 | protected 23 | _Paren :TIndexDictionary<_TKey_,_TValue_>; 24 | _Key :_TKey_; 25 | _Order :Integer; 26 | _Value :_TValue_; 27 | ///// アクセス 28 | function GetParen :TIndexDictionary<_TKey_,_TValue_>; 29 | function GetKey :_TKey_; 30 | function GetOrder :Integer; 31 | function GetValue :_TValue_; 32 | procedure SetValue( const Value_:_TValue_ ); 33 | public 34 | constructor Create( const Paren_:TIndexDictionary<_TKey_,_TValue_> ); 35 | destructor Destroy; override; 36 | ///// プロパティ 37 | property Paren :TIndexDictionary<_TKey_,_TValue_> read GetParen; 38 | property Key :_TKey_ read GetKey ; 39 | property Order :Integer read GetOrder; 40 | property Value :_TValue_ read GetValue write SetValue; 41 | end; 42 | 43 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TIndexDictionary<_TKey_,_TValue_> 44 | 45 | TIndexDictionary<_TKey_,_TValue_> = class( TObjectDictionary<_TKey_,TDictItem<_TKey_,_TValue_>> ) 46 | private 47 | protected 48 | ///// イベント 49 | _OnChange :TConstProc>; 50 | public 51 | constructor Create( Capacity_:Integer = 0 ); 52 | destructor Destroy; override; 53 | ///// メソッド 54 | procedure Add( const Key_:_TKey_; const Value_:_TValue_ ); 55 | procedure Del( const Key_:_TKey_ ); 56 | ///// イベント 57 | property OnChange :TConstProc> read _OnChange write _OnChange; 58 | end; 59 | 60 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 61 | 62 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 63 | 64 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 65 | 66 | implementation //############################################################### ■ 67 | 68 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 69 | 70 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 71 | 72 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDictItem<_TKey_,_TValue_> 73 | 74 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 75 | 76 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 77 | 78 | function TDictItem<_TKey_,_TValue_>.GetParen :TIndexDictionary<_TKey_,_TValue_>; 79 | begin 80 | Result := Paren; 81 | end; 82 | 83 | function TDictItem<_TKey_,_TValue_>.GetKey :_TKey_; 84 | begin 85 | Result := _Key; 86 | end; 87 | 88 | function TDictItem<_TKey_,_TValue_>.GetOrder :Integer; 89 | begin 90 | Result := _Order; 91 | end; 92 | 93 | function TDictItem<_TKey_,_TValue_>.GetValue :_TValue_; 94 | begin 95 | Result := _Value; 96 | end; 97 | 98 | procedure TDictItem<_TKey_,_TValue_>.SetValue( const Value_:_TValue_ ); 99 | begin 100 | _Value := Value_; 101 | 102 | with _Paren do 103 | begin 104 | if Assigned( _OnChange ) then _OnChange( Self ); 105 | end; 106 | end; 107 | 108 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 109 | 110 | constructor TDictItem<_TKey_,_TValue_>.Create( const Paren_:TIndexDictionary<_TKey_,_TValue_> ); 111 | begin 112 | inherited Create; 113 | 114 | _Paren := Paren_; 115 | 116 | with _Paren do 117 | begin 118 | if Assigned( _OnChange ) then _OnChange( Self ); 119 | end; 120 | end; 121 | 122 | destructor TDictItem<_TKey_,_TValue_>.Destroy; 123 | begin 124 | with _Paren do 125 | begin 126 | if Assigned( _OnChange ) then _OnChange( Self ); 127 | end; 128 | 129 | inherited; 130 | end; 131 | 132 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TIndexDictionary<_TKey_,_TValue_> 133 | 134 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 135 | 136 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 137 | 138 | constructor TIndexDictionary<_TKey_,_TValue_>.Create( Capacity_:Integer = 0 ); 139 | begin 140 | inherited Create( [ doOwnsValues ], Capacity_ ); 141 | 142 | end; 143 | 144 | destructor TIndexDictionary<_TKey_,_TValue_>.Destroy; 145 | begin 146 | 147 | inherited; 148 | end; 149 | 150 | procedure TIndexDictionary<_TKey_,_TValue_>.Add( const Key_:_TKey_; const Value_:_TValue_ ); 151 | var 152 | V :TDictItem<_TKey_,_TValue_>; 153 | begin 154 | if ContainsKey( Key_ ) then Items[ Key_ ].Value := Value_ 155 | else 156 | begin 157 | V := TDictItem<_TKey_,_TValue_>.Create( Self ); 158 | 159 | V._Order := Count; 160 | V._Value := Value_; 161 | 162 | inherited Add( Key_, V ); 163 | end; 164 | end; 165 | 166 | procedure TIndexDictionary<_TKey_,_TValue_>.Del( const Key_:_TKey_ ); 167 | begin 168 | Remove( Key_ ); 169 | end; 170 | 171 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 172 | 173 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 174 | 175 | //############################################################################## □ 176 | 177 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 178 | 179 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 180 | 181 | end. //######################################################################### ■ 182 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Data/Grid/LUX.Data.Grid.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Data.Grid; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses System.SysUtils, 6 | LUX; 7 | 8 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 9 | 10 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 11 | 12 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 13 | 14 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCoreArray<_TElem_> 15 | 16 | ICoreArray = interface 17 | ['{C9E5529F-E994-416A-935E-D2370D376792}'] 18 | ///// アクセス 19 | function GetElemByte :Integer; 20 | function GetElemsN :Integer; 21 | procedure SetElemsN( const ElemsN_:Integer ); 22 | function GetElemsByte :Integer; 23 | function GetElem0P :Pointer; 24 | ///// プロパティ 25 | property ElemByte :Integer read GetElemByte ; 26 | property ElemsN :Integer read GetElemsN write SetElemsN; 27 | property ElemsByte :Integer read GetElemsByte ; 28 | property Elem0P :Pointer read GetElem0P ; 29 | end; 30 | 31 | //------------------------------------------------------------------------- 32 | 33 | TCoreArray<_TElem_> = class( TInterfacedBase, ICoreArray ) 34 | public 35 | type _PElem_ = ^_TElem_; 36 | protected 37 | _Elems :TArray<_TElem_>; 38 | ///// アクセス 39 | function GetElemByte :Integer; 40 | function GetElemsN :Integer; virtual; 41 | procedure SetElemsN( const ElemsN_:Integer ); 42 | function GetElemsByte :Integer; 43 | function GetElems( const I_:Integer ) :_TElem_; 44 | procedure SetElems( const I_:Integer; const Elem_:_TElem_ ); 45 | function GetElemsP( const I_:Integer ) :_PElem_; 46 | function GetElem0P :Pointer; 47 | ///// メソッド 48 | procedure MakeArray; virtual; 49 | public 50 | ///// イベント 51 | _OnChange :TProc; 52 | public 53 | constructor Create; overload; 54 | constructor Create( const ElemsX_:Integer ); overload; 55 | procedure AfterConstruction; override; 56 | destructor Destroy; override; 57 | ///// プロパティ 58 | property ElemByte :Integer read GetElemByte ; 59 | property ElemsN :Integer read GetElemsN write SetElemsN; 60 | property ElemsByte :Integer read GetElemsByte ; 61 | property Elems[ const I_:Integer ] :_TElem_ read GetElems write SetElems ; default; 62 | property ElemsP[ const I_:Integer ] :_PElem_ read GetElemsP ; 63 | property Elem0P :Pointer read GetElem0P ; 64 | ///// メソッド 65 | class procedure Swap( var Array0_,Array1_:TCoreArray<_TElem_> ); static; 66 | end; 67 | 68 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 69 | 70 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 71 | 72 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 73 | 74 | implementation //############################################################### ■ 75 | 76 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 77 | 78 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 79 | 80 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TCoreArray<_TElem_> 81 | 82 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 83 | 84 | /////////////////////////////////////////////////////////////////////// メソッド 85 | 86 | procedure TCoreArray<_TElem_>.MakeArray; 87 | begin 88 | ElemsN := ElemsN; 89 | end; 90 | 91 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 92 | 93 | /////////////////////////////////////////////////////////////////////// アクセス 94 | 95 | function TCoreArray<_TElem_>.GetElemByte :Integer; 96 | begin 97 | Result := SizeOf( _TElem_ ); 98 | end; 99 | 100 | //------------------------------------------------------------------------------ 101 | 102 | function TCoreArray<_TElem_>.GetElemsN :Integer; 103 | begin 104 | Result := Length( _Elems ); 105 | end; 106 | 107 | procedure TCoreArray<_TElem_>.SetElemsN( const ElemsN_:Integer ); 108 | begin 109 | SetLength( _Elems, ElemsN_ ); 110 | 111 | _OnChange; 112 | end; 113 | 114 | //------------------------------------------------------------------------------ 115 | 116 | function TCoreArray<_TElem_>.GetElemsByte :Integer; 117 | begin 118 | Result := ElemByte * ElemsN; 119 | end; 120 | 121 | //------------------------------------------------------------------------------ 122 | 123 | function TCoreArray<_TElem_>.GetElems( const I_:Integer ) :_TElem_; 124 | begin 125 | Result := _Elems[ I_ ]; 126 | end; 127 | 128 | procedure TCoreArray<_TElem_>.SetElems( const I_:Integer; const Elem_:_TElem_ ); 129 | begin 130 | _Elems[ I_ ] := Elem_; 131 | end; 132 | 133 | function TCoreArray<_TElem_>.GetElemsP( const I_:Integer ) :_PElem_; 134 | begin 135 | Result := @_Elems[ I_ ]; 136 | end; 137 | 138 | function TCoreArray<_TElem_>.GetElem0P :Pointer; 139 | begin 140 | Result := GetElemsP( 0 ); 141 | end; 142 | 143 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 144 | 145 | constructor TCoreArray<_TElem_>.Create; 146 | begin 147 | Create( 0 ); 148 | end; 149 | 150 | constructor TCoreArray<_TElem_>.Create( const ElemsX_:Integer ); 151 | begin 152 | inherited Create; 153 | 154 | _OnChange := procedure begin end; 155 | end; 156 | 157 | procedure TCoreArray<_TElem_>.AfterConstruction; 158 | begin 159 | MakeArray; 160 | end; 161 | 162 | destructor TCoreArray<_TElem_>.Destroy; 163 | begin 164 | 165 | inherited; 166 | end; 167 | 168 | /////////////////////////////////////////////////////////////////////// メソッド 169 | 170 | class procedure TCoreArray<_TElem_>.Swap( var Array0_,Array1_:TCoreArray<_TElem_> ); 171 | var 172 | A :TCoreArray<_TElem_>; 173 | begin 174 | A := Array0_; Array0_ := Array1_; Array1_ := A; 175 | end; 176 | 177 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 178 | 179 | //############################################################################## □ 180 | 181 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 182 | 183 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 184 | 185 | end. //######################################################################### ■ 186 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Math/LUX.Math.Special.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Math.Special; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D1; 6 | 7 | //type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 8 | 9 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 10 | 11 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {RECORD} 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {CLASS} 16 | 17 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 18 | 19 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 20 | 21 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 22 | 23 | function HypGeo21( const A_,B_,C_,X_:Single ) :Single; overload; 24 | function HypGeo21( const A_,B_,C_,X_:Double ) :Double; overload; 25 | function HypGeo21( const A_,B_,C_,X_:TdSingle ) :TdSingle; overload; 26 | function HypGeo21( const A_,B_,C_,X_:TdDouble ) :TdDouble; overload; 27 | 28 | ///// HypGeo21A( B_, C_, X_ ) = HypGeo21( 1, B_, C_, X_ ) 29 | function HypGeo21A( const B_,C_,X_:Single ) :Single; overload; 30 | function HypGeo21A( const B_,C_,X_:Double ) :Double; overload; 31 | function HypGeo21A( const B_,C_,X_:TdSingle ) :TdSingle; overload; 32 | function HypGeo21A( const B_,C_,X_:TdDouble ) :TdDouble; overload; 33 | 34 | implementation //############################################################### ■ 35 | 36 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 37 | 38 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {RECORD} 39 | 40 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 41 | 42 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 43 | 44 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 45 | 46 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {CLASS} 47 | 48 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 49 | 50 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 51 | 52 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 53 | 54 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 55 | 56 | function HypGeo21( const A_,B_,C_,X_:Single ) :Single; 57 | var 58 | P0, P1 :Single; 59 | N :Integer; 60 | begin 61 | P0 := 1; 62 | 63 | Result := P0; 64 | 65 | for N := 0 to 10000 do 66 | begin 67 | P1 := ( ( A_ + N ) * ( B_ + N ) ) 68 | / ( ( C_ + N ) * ( 1 + N ) ) * X_ * P0; 69 | 70 | Result := Result + P1; 71 | 72 | if Abs( P1 ) < SINGLE_EPS3 then Break; 73 | 74 | P0 := P1; 75 | end; 76 | end; 77 | 78 | function HypGeo21( const A_,B_,C_,X_:Double ) :Double; 79 | var 80 | P0, P1 :Double; 81 | N :Integer; 82 | begin 83 | P0 := 1; 84 | 85 | Result := P0; 86 | 87 | for N := 0 to 10000 do 88 | begin 89 | P1 := ( ( A_ + N ) * ( B_ + N ) ) 90 | / ( ( C_ + N ) * ( 1 + N ) ) * X_ * P0; 91 | 92 | Result := Result + P1; 93 | 94 | if Abs( P1 ) < DOUBLE_EPS3 then Break; 95 | 96 | P0 := P1; 97 | end; 98 | end; 99 | 100 | function HypGeo21( const A_,B_,C_,X_:TdSingle ) :TdSingle; 101 | var 102 | P0, P1 :TdSingle; 103 | N :Integer; 104 | begin 105 | P0 := 1; 106 | 107 | Result := P0; 108 | 109 | for N := 0 to 10000 do 110 | begin 111 | P1 := ( ( A_ + N ) * ( B_ + N ) ) 112 | / ( ( C_ + N ) * ( 1 + N ) ) * X_ * P0; 113 | 114 | Result := Result + P1; 115 | 116 | if Abs( P1.o ) < SINGLE_EPS3 then Break; 117 | 118 | P0 := P1; 119 | end; 120 | end; 121 | 122 | function HypGeo21( const A_,B_,C_,X_:TdDouble ) :TdDouble; 123 | var 124 | P0, P1 :TdDouble; 125 | N :Integer; 126 | begin 127 | P0 := 1; 128 | 129 | Result := P0; 130 | 131 | for N := 0 to 10000 do 132 | begin 133 | P1 := ( ( A_ + N ) * ( B_ + N ) ) 134 | / ( ( C_ + N ) * ( 1 + N ) ) * X_ * P0; 135 | 136 | Result := Result + P1; 137 | 138 | if Abs( P1.o ) < DOUBLE_EPS3 then Break; 139 | 140 | P0 := P1; 141 | end; 142 | end; 143 | 144 | //------------------------------------------------------------------------------ 145 | 146 | function HypGeo21A( const B_,C_,X_:Single ) :Single; 147 | var 148 | P0, P1 :Single; 149 | N :Integer; 150 | begin 151 | P0 := 1; 152 | 153 | Result := P0; 154 | 155 | for N := 0 to 10000 do 156 | begin 157 | P1 := ( B_ + N ) / ( C_ + N ) * X_ * P0; 158 | 159 | Result := Result + P1; 160 | 161 | if Abs( P1 ) < DOUBLE_EPS3 then Break; 162 | 163 | P0 := P1; 164 | end; 165 | end; 166 | 167 | function HypGeo21A( const B_,C_,X_:Double ) :Double; 168 | var 169 | P0, P1 :Double; 170 | N :Integer; 171 | begin 172 | P0 := 1; 173 | 174 | Result := P0; 175 | 176 | for N := 0 to 10000 do 177 | begin 178 | P1 := ( B_ + N ) / ( C_ + N ) * X_ * P0; 179 | 180 | Result := Result + P1; 181 | 182 | if Abs( P1 ) < DOUBLE_EPS3 then Break; 183 | 184 | P0 := P1; 185 | end; 186 | end; 187 | 188 | function HypGeo21A( const B_,C_,X_:TdSingle ) :TdSingle; 189 | var 190 | P0, P1 :TdSingle; 191 | N :Integer; 192 | begin 193 | P0 := 1; 194 | 195 | Result := P0; 196 | 197 | for N := 0 to 10000 do 198 | begin 199 | P1 := ( B_ + N ) / ( C_ + N ) * X_ * P0; 200 | 201 | Result := Result + P1; 202 | 203 | if Abs( P1.o ) < DOUBLE_EPS3 then Break; 204 | 205 | P0 := P1; 206 | end; 207 | end; 208 | 209 | function HypGeo21A( const B_,C_,X_:TdDouble ) :TdDouble; 210 | var 211 | P0, P1 :TdDouble; 212 | N :Integer; 213 | begin 214 | P0 := 1; 215 | 216 | Result := P0; 217 | 218 | for N := 0 to 10000 do 219 | begin 220 | P1 := ( B_ + N ) / ( C_ + N ) * X_ * P0; 221 | 222 | Result := Result + P1; 223 | 224 | if Abs( P1.o ) < DOUBLE_EPS3 then Break; 225 | 226 | P0 := P1; 227 | end; 228 | end; 229 | 230 | //############################################################################## □ 231 | 232 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 233 | 234 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 235 | 236 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Math/LUX.Math.Distribution.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Math.Distribution; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D1; 6 | 7 | //type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 8 | 9 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 10 | 11 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {RECORD} 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {CLASS} 16 | 17 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 18 | 19 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 20 | 21 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 22 | 23 | function DistT( const X_,V_:Single ) :Single; overload; 24 | function DistT( const X_,V_:Double ) :Double; overload; 25 | function DistT( const X_,V_:TdSingle ) :TdSingle; overload; 26 | function DistT( const X_,V_:TdDouble ) :TdDouble; overload; 27 | 28 | function Cum2DistT( const X_,V_:Single ) :Single; overload; 29 | function Cum2DistT( const X_,V_:Double ) :Double; overload; 30 | 31 | function CumDistT( const X_,V_:Single ) :Single; overload; 32 | function CumDistT( const X_,V_:Double ) :Double; overload; 33 | function CumDistT( const X_:TdSingle; const V_:Single ) :TdSingle; overload; 34 | function CumDistT( const X_:TdDouble; const V_:Double ) :TdDouble; overload; 35 | 36 | function InvCumDistT( const P_,V_:Single ) :Single; overload; 37 | function InvCumDistT( const P_,V_:Double ) :Double; overload; 38 | 39 | implementation //############################################################### ■ 40 | 41 | uses System.Math, 42 | LUX.Math.Special.Beta; 43 | 44 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 45 | 46 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {RECORD} 47 | 48 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 49 | 50 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 51 | 52 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 53 | 54 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% {CLASS} 55 | 56 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 57 | 58 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 59 | 60 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 61 | 62 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 63 | 64 | function DistT( const X_,V_:Single ) :Single; 65 | begin 66 | Result := Power( 1 + Pow2( X_ ) / V_, -( V_ + 1 ) / 2 ) 67 | / ( Roo2( V_ ) * Beta( V_ / 2, 0.5 ) ); 68 | end; 69 | 70 | function DistT( const X_,V_:Double ) :Double; 71 | begin 72 | Result := Power( 1 + Pow2( X_ ) / V_, -( V_ + 1 ) / 2 ) 73 | / ( Roo2( V_ ) * Beta( V_ / 2, 0.5 ) ); 74 | end; 75 | 76 | function DistT( const X_,V_:TdSingle ) :TdSingle; 77 | begin 78 | Result := Power( 1 + Pow2( X_ ) / V_, -( V_ + 1 ) / 2 ) 79 | / ( Roo2( V_ ) * Beta( V_ / 2, 0.5 ) ); 80 | end; 81 | 82 | function DistT( const X_,V_:TdDouble ) :TdDouble; 83 | begin 84 | Result := Power( 1 + Pow2( X_ ) / V_, -( V_ + 1 ) / 2 ) 85 | / ( Roo2( V_ ) * Beta( V_ / 2, 0.5 ) ); 86 | end; 87 | 88 | //------------------------------------------------------------------------------ 89 | 90 | // RegIncBeta( x a, b ) = 1 - RegIncBeta( 1 - x b, a ) 91 | 92 | function Cum2DistT( const X_,V_:Single ) :Single; 93 | var 94 | X2 :Double; 95 | begin 96 | X2 := Pow2( X_ ); 97 | 98 | if 100 * X2 < V_ then Result := 1 - RegIncBeta( X2 / ( X2 + V_ ), 1 / 2, V_ / 2 ) 99 | else Result := RegIncBeta( V_ / ( X2 + V_ ), V_ / 2, 1 / 2 ); 100 | end; 101 | 102 | function Cum2DistT( const X_,V_:Double ) :Double; 103 | var 104 | X2 :Double; 105 | begin 106 | X2 := Pow2( X_ ); 107 | 108 | if 100 * X2 < V_ then Result := 1 - RegIncBeta( X2 / ( X2 + V_ ), 1 / 2, V_ / 2 ) 109 | else Result := RegIncBeta( V_ / ( X2 + V_ ), V_ / 2, 1 / 2 ); 110 | end; 111 | 112 | //------------------------------------------------------------------------------ 113 | 114 | // Result := RegIncBeta( ( X_ + Roo2( X2 + V_ ) ) 115 | // / ( 2 * Roo2( X2 + V_ ) ), V_ / 2, V_ / 2 ); 116 | 117 | function CumDistT( const X_,V_:Single ) :Single; 118 | var 119 | C :Double; 120 | begin 121 | C := Cum2DistT( X_, V_ ); 122 | 123 | if X_ < 0 then Result := C / 2 124 | else Result := 1 - C / 2; 125 | end; 126 | 127 | function CumDistT( const X_,V_:Double ) :Double; 128 | var 129 | C :Double; 130 | begin 131 | C := Cum2DistT( X_, V_ ); 132 | 133 | if X_ < 0 then Result := C / 2 134 | else Result := 1 - C / 2; 135 | end; 136 | 137 | function CumDistT( const X_:TdSingle; const V_:Single ) :TdSingle; 138 | begin 139 | with X_ do 140 | begin 141 | Result.o := CumDistT( o, V_ ) ; 142 | Result.d := DistT( o, V_ ) * d; 143 | end; 144 | end; 145 | 146 | function CumDistT( const X_:TdDouble; const V_:Double ) :TdDouble; 147 | begin 148 | with X_ do 149 | begin 150 | Result.o := CumDistT( o, V_ ) ; 151 | Result.d := DistT( o, V_ ) * d; 152 | end; 153 | end; 154 | 155 | //------------------------------------------------------------------------------ 156 | 157 | function InvCumDistT( const P_,V_:Single ) :Single; 158 | var 159 | X, P :TdSingle; 160 | Pd :Single; 161 | begin 162 | X := TdSingle.Create( 0, 1 ); 163 | 164 | repeat 165 | P := CumDistT( X, V_ ); 166 | 167 | Pd := P.o - P_; 168 | 169 | X.o := X.o - Pd / P.d; 170 | 171 | until Abs( Pd ) < SINGLE_EPS3; 172 | 173 | Result := X.o; 174 | end; 175 | 176 | function InvCumDistT( const P_,V_:Double ) :Double; 177 | var 178 | X, P :TdDouble; 179 | Pd :Double; 180 | begin 181 | X := TdDouble.Create( 0, 1 ); 182 | 183 | repeat 184 | P := CumDistT( X, V_ ); 185 | 186 | Pd := P.o - P_; 187 | 188 | X.o := X.o - Pd / P.d; 189 | 190 | until Abs( Pd ) < DOUBLE_EPS3; 191 | 192 | Result := X.o; 193 | end; 194 | 195 | //############################################################################## □ 196 | 197 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 198 | 199 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 200 | 201 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/LUX.Random.PCG.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.PCG; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, 6 | LUX.Random; 7 | 8 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 9 | 10 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 11 | 12 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% T_pcg32_random_t 13 | 14 | (* Representations setseq variants *) 15 | 16 | T_pcg32_random_t = record 17 | private 18 | public 19 | state :Int64u; 20 | inc :Int64u; 21 | end; 22 | 23 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 24 | 25 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandomPCG<_TSeed_> 26 | 27 | IRandomPCG<_TSeed_:record> = interface( IRandom<_TSeed_> ) 28 | ['{5794CF7C-B2C7-4E22-96CE-B30A4647EAAC}'] 29 | {protected} 30 | {public} 31 | end; 32 | 33 | //------------------------------------------------------------------------- 34 | 35 | TRandomPCG<_TSeed_:record> = class( TRandom<_TSeed_>, IRandomPCG<_TSeed_> ) 36 | private const 37 | private 38 | protected 39 | public 40 | end; 41 | 42 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32PCG64basic 43 | 44 | { http://www.pcg-random.org/using-pcg-c-basic.html } 45 | 46 | TRandom32PCG64x63basic = class( TRandomPCG ) 47 | public 48 | protected 49 | ///// メソッド 50 | procedure CalcNextSeed; override; 51 | function CalcRandInt32u :Int32u; override; 52 | public 53 | constructor CreateFromRand( const Random_:IRandom ); overload; override; 54 | constructor CreateFromRand( const Random_:IRandom; const Stream_:Int64u ); overload; 55 | ///// メソッド 56 | procedure pcg32_srandom_r( var rng:T_pcg32_random_t; initstate,initseq:Int64u ); 57 | procedure pcg32_srandom( seed,seq:Int64u ); 58 | function pcg32_random_r( var rng:T_pcg32_random_t ) :Int32u; 59 | function pcg32_random :Int32u; 60 | function pcg32_boundedrand_r( var rng:T_pcg32_random_t; bound:Int32u ) :Int32u; 61 | function pcg32_boundedrand( bound:Int32u ) :Int32u; 62 | end; 63 | 64 | const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 65 | 66 | PCG32_INITIALIZER :T_pcg32_random_t = ( state:$853c49e6748fea9b; 67 | inc :$da3e39cb94b95bdb ); 68 | 69 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 70 | 71 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 72 | 73 | implementation //############################################################### ■ 74 | 75 | uses System.SysUtils; 76 | 77 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 78 | 79 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 80 | 81 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandomPCG<_TSeed_> 82 | 83 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 84 | 85 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 86 | 87 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 88 | 89 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32PCG64basic 90 | 91 | { https://github.com/imneme/pcg-c-basic } 92 | 93 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 94 | 95 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 96 | 97 | /////////////////////////////////////////////////////////////////////// メソッド 98 | 99 | procedure TRandom32PCG64x63basic.CalcNextSeed; 100 | begin 101 | with _Seed do state := state * Int64u( 6364136223846793005 ) + inc; 102 | end; 103 | 104 | function TRandom32PCG64x63basic.CalcRandInt32u :Int32u; 105 | var 106 | xorshifted, rot :Int32u; 107 | begin 108 | with _Seed do 109 | begin 110 | xorshifted := ( ( state shr 18 ) xor state ) shr 27; 111 | 112 | rot := state shr 59; 113 | end; 114 | 115 | Result := ( xorshifted shr rot ) or ( xorshifted shl ( -rot and 31 ) ); 116 | end; 117 | 118 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 119 | 120 | constructor TRandom32PCG64x63basic.CreateFromRand( const Random_:IRandom ); 121 | begin 122 | CreateFromRand( Random_, Random_.DrawRandInt64u ); 123 | end; 124 | 125 | constructor TRandom32PCG64x63basic.CreateFromRand( const Random_:IRandom; const Stream_:Int64u ); 126 | var 127 | S :T_pcg32_random_t; 128 | begin 129 | pcg32_srandom_r( S, Random_.DrawRandInt64u, Stream_ ); 130 | 131 | Create( S ); 132 | end; 133 | 134 | /////////////////////////////////////////////////////////////////////// メソッド 135 | 136 | procedure TRandom32PCG64x63basic.pcg32_srandom_r( var rng:T_pcg32_random_t; initstate,initseq:Int64u ); 137 | begin 138 | rng.state := 0; 139 | rng.inc := ( initseq shl 1 ) or 1; 140 | 141 | pcg32_random_r( rng ); 142 | 143 | rng.state := rng.state + initstate; 144 | 145 | pcg32_random_r( rng ); 146 | end; 147 | 148 | procedure TRandom32PCG64x63basic.pcg32_srandom( seed,seq:Int64u ); 149 | begin 150 | pcg32_srandom_r( _Seed, seed, seq ); 151 | end; 152 | 153 | function TRandom32PCG64x63basic.pcg32_random_r( var rng:T_pcg32_random_t ) :Int32u; 154 | var 155 | oldstate :Int64u; 156 | xorshifted, rot :Int32u; 157 | begin 158 | oldstate := rng.state; 159 | 160 | rng.state := oldstate * Int64u( 6364136223846793005 ) + rng.inc; 161 | 162 | xorshifted := ( ( oldstate shr 18 ) xor oldstate ) shr 27; 163 | 164 | rot := oldstate shr 59; 165 | 166 | Result := ( xorshifted shr rot ) or ( xorshifted shl ( -rot and 31 ) ); 167 | end; 168 | 169 | function TRandom32PCG64x63basic.pcg32_random :Int32u; 170 | begin 171 | Result := pcg32_random_r( _Seed ); 172 | end; 173 | 174 | function TRandom32PCG64x63basic.pcg32_boundedrand_r( var rng:T_pcg32_random_t; bound:Int32u ) :Int32u; 175 | var 176 | threshold, r :Int32u; 177 | begin 178 | threshold := -bound mod bound; 179 | 180 | repeat 181 | r := pcg32_random_r( rng ); 182 | 183 | until r >= threshold; 184 | 185 | Result := r mod bound; 186 | end; 187 | 188 | function TRandom32PCG64x63basic.pcg32_boundedrand( bound:Int32u ) :Int32u; 189 | begin 190 | Result := pcg32_boundedrand_r( &_Seed, bound ); 191 | end; 192 | 193 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 194 | 195 | //############################################################################## □ 196 | 197 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 198 | 199 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 200 | 201 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/LUX.D3x4.pas: -------------------------------------------------------------------------------- 1 | unit LUX.D3x4; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D1, LUX.D2, LUX.D3; 6 | 7 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 8 | 9 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 10 | 11 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSingle4x3D 12 | 13 | TSingle4x3D = record 14 | private 15 | ///// アクセス 16 | function Gets( const Y_:Integer ) :TSingle3D; inline; 17 | procedure Sets( const Y_:Integer; const V_:TSingle3D ); inline; 18 | public 19 | ///// プロパティ 20 | property _s[ const Y_:Integer ] :TSingle3D read Gets write Sets; default; 21 | case Byte of 22 | 0:( _YXs :array [ 1..4, 1..3 ] of Single; ); 23 | 1:( _11, _12, _13, 24 | _21, _22, _23, 25 | _31, _32, _33, 26 | _41, _42, _43 :Single; ); 27 | 2:( _Ys :array [ 1..4 ] of TSingle3D; ); 28 | 3:( _1, 29 | _2, 30 | _3, 31 | _4 :TSingle3D; ); 32 | end; 33 | 34 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDouble4x3D 35 | 36 | TDouble4x3D = record 37 | private 38 | ///// アクセス 39 | function Gets( const Y_:Integer ) :TDouble3D; inline; 40 | procedure Sets( const Y_:Integer; const V_:TDouble3D ); inline; 41 | public 42 | ///// プロパティ 43 | property _s[ const Y_:Integer ] :TDouble3D read Gets write Sets; default; 44 | 45 | case Byte of 46 | 0:( _YXs :array [ 1..4, 1..3 ] of Double; ); 47 | 1:( _11, _12, _13, 48 | _21, _22, _23, 49 | _31, _32, _33, 50 | _41, _42, _43 :Double; ); 51 | 2:( _Ys :array [ 1..4 ] of TDouble3D; ); 52 | 3:( _1, 53 | _2, 54 | _3, 55 | _4 :TDouble3D; ); 56 | end; 57 | 58 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdSingle4x3D 59 | 60 | TdSingle4x3D = record 61 | private 62 | ///// アクセス 63 | function Gets( const Y_:Integer ) :TdSingle3D; inline; 64 | procedure Sets( const Y_:Integer; const V_:TdSingle3D ); inline; 65 | public 66 | ///// プロパティ 67 | property _s[ const Y_:Integer ] :TdSingle3D read Gets write Sets; default; 68 | case Byte of 69 | 0:( _YXs :array [ 1..4, 1..3 ] of TdSingle; ); 70 | 1:( _11, _12, _13, 71 | _21, _22, _23, 72 | _31, _32, _33, 73 | _41, _42, _43 :TdSingle; ); 74 | 2:( _Ys :array [ 1..4 ] of TdSingle3D; ); 75 | 3:( _1, 76 | _2, 77 | _3, 78 | _4 :TdSingle3D; ); 79 | end; 80 | 81 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdDouble4x3D 82 | 83 | TdDouble4x3D = record 84 | private 85 | ///// アクセス 86 | function Gets( const Y_:Integer ) :TdDouble3D; inline; 87 | procedure Sets( const Y_:Integer; const V_:TdDouble3D ); inline; 88 | public 89 | ///// プロパティ 90 | property _s[ const Y_:Integer ] :TdDouble3D read Gets write Sets; default; 91 | case Byte of 92 | 0:( _YXs :array [ 1..4, 1..3 ] of TdDouble; ); 93 | 1:( _11, _12, _13, 94 | _21, _22, _23, 95 | _31, _32, _33, 96 | _41, _42, _43 :TdDouble; ); 97 | 2:( _Ys :array [ 1..4 ] of TdDouble3D; ); 98 | 3:( _1, 99 | _2, 100 | _3, 101 | _4 :TdDouble3D; ); 102 | end; 103 | 104 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 105 | 106 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 107 | 108 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 109 | 110 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 111 | 112 | implementation //############################################################### ■ 113 | 114 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 115 | 116 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TSingle4x3D 117 | 118 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 119 | 120 | /////////////////////////////////////////////////////////////////////// アクセス 121 | 122 | function TSingle4x3D.Gets( const Y_:Integer ) :TSingle3D; 123 | begin 124 | Result := _Ys[ Y_ ]; 125 | end; 126 | 127 | procedure TSingle4x3D.Sets( const Y_:Integer; const V_:TSingle3D ); 128 | begin 129 | _Ys[ Y_ ] := V_; 130 | end; 131 | 132 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 133 | 134 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDouble4x3D 135 | 136 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 137 | 138 | /////////////////////////////////////////////////////////////////////// アクセス 139 | 140 | function TDouble4x3D.Gets( const Y_:Integer ) :TDouble3D; 141 | begin 142 | Result := _Ys[ Y_ ]; 143 | end; 144 | 145 | procedure TDouble4x3D.Sets( const Y_:Integer; const V_:TDouble3D ); 146 | begin 147 | _Ys[ Y_ ] := V_; 148 | end; 149 | 150 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdSingle4x3D 151 | 152 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 153 | 154 | /////////////////////////////////////////////////////////////////////// アクセス 155 | 156 | function TdSingle4x3D.Gets( const Y_:Integer ) :TdSingle3D; 157 | begin 158 | Result := _Ys[ Y_ ]; 159 | end; 160 | 161 | procedure TdSingle4x3D.Sets( const Y_:Integer; const V_:TdSingle3D ); 162 | begin 163 | _Ys[ Y_ ] := V_; 164 | end; 165 | 166 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 167 | 168 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TdDouble4x3D 169 | 170 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 171 | 172 | /////////////////////////////////////////////////////////////////////// アクセス 173 | 174 | function TdDouble4x3D.Gets( const Y_:Integer ) :TdDouble3D; 175 | begin 176 | Result := _Ys[ Y_ ]; 177 | end; 178 | 179 | procedure TdDouble4x3D.Sets( const Y_:Integer; const V_:TdDouble3D ); 180 | begin 181 | _Ys[ Y_ ] := V_; 182 | end; 183 | 184 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 185 | 186 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 187 | 188 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 189 | 190 | //############################################################################## □ 191 | 192 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 193 | 194 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 195 | 196 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Complex/LUX.Complex.D1.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Complex.D1; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D1, LUX.Complex; 6 | 7 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 8 | 9 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 10 | 11 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 12 | 13 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDoubleCIter1D 14 | 15 | TDoubleCIter1D = class( TTransIter1D< TDoubleC, TSingleC > ) 16 | private 17 | protected 18 | ///// アクセス 19 | function GetValue :TDoubleC; override; 20 | procedure SetValue( const Value_:TDoubleC ); override; 21 | public 22 | end; 23 | 24 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDoubleRandWalkC 25 | 26 | IDoubleRandWalkC = interface 27 | ['{952E0B09-3DFF-4A8C-A7E1-18DCE86F550A}'] 28 | {protected} 29 | ///// アクセス 30 | function GetWalks( const I_:Integer ) :TDoubleC; 31 | function GetWalksN :Integer; 32 | procedure SetWalksN( const WalksN_:Integer ); 33 | function GetStdDev :TDoubleC; 34 | procedure SetStdDev( const SDev_:TDoubleC ); 35 | {public} 36 | ///// プロパティ 37 | property Walks[ const I_:Integer ] :TDoubleC read GetWalks ; default; 38 | property WalksN :Integer read GetWalksN write SetWalksN; 39 | property StdDev :TDoubleC read GetStdDev write SetStdDev; 40 | ///// メソッド 41 | procedure AddStep; 42 | end; 43 | 44 | TDoubleRandWalkC = class( TInterfacedObject, IDoubleRandWalkC ) 45 | private 46 | ///// メソッド 47 | function NextStep( const C_:TDoubleC ) :TDoubleC; 48 | protected 49 | _Walks :TArray; 50 | _StdDev :TDoubleC; 51 | ///// アクセス 52 | function GetWalks( const I_:Integer ) :TDoubleC; 53 | function GetWalksN :Integer; 54 | procedure SetWalksN( const WalksN_:Integer ); 55 | function GetStdDev :TDoubleC; 56 | procedure SetStdDev( const SDev_:TDoubleC ); 57 | public 58 | constructor Create; overload; 59 | constructor Create( const WalksN_:Integer ); overload; virtual; 60 | destructor Destroy; override; 61 | ///// プロパティ 62 | property Walks[ const I_:Integer ] :TDoubleC read GetWalks ; default; 63 | property WalksN :Integer read GetWalksN write SetWalksN; 64 | property StdDev :TDoubleC read GetStdDev write SetStdDev; 65 | ///// メソッド 66 | procedure AddStep; 67 | end; 68 | 69 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 70 | 71 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 72 | 73 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 74 | 75 | function Gauss( const C_,SD_:TSingleC ) :Single; overload; 76 | function Gauss( const C_,SD_:TDoubleC ) :Double; overload; 77 | 78 | implementation //############################################################### ■ 79 | 80 | uses System.Math; 81 | 82 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 83 | 84 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 85 | 86 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDoubleCIter1D 87 | 88 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 89 | 90 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 91 | 92 | /////////////////////////////////////////////////////////////////////// アクセス 93 | 94 | function TDoubleCIter1D.GetValue :TDoubleC; 95 | begin 96 | Result := _Iter.Value; 97 | end; 98 | 99 | procedure TDoubleCIter1D.SetValue( const Value_:TDoubleC ); 100 | begin 101 | _Iter.Value := Value_; 102 | end; 103 | 104 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 105 | 106 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TDoubleRandWalkC 107 | 108 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 109 | 110 | function MetroWalk( const C0,AreaSD_:TDoubleC; const W_:Single ) :TDoubleC; overload; 111 | var 112 | C1 :TDoubleC; 113 | A :Double; 114 | begin 115 | C1 := C0 + TDoubleC.RandG( W_ * AreaSD_ ); 116 | 117 | A := Gauss( C1, AreaSD_ ) / Gauss( C0, AreaSD_ ); 118 | 119 | if Random < A then Result := C1 120 | else Result := C0; 121 | end; 122 | 123 | function TDoubleRandWalkC.NextStep( const C_:TDoubleC ) :TDoubleC; 124 | begin 125 | Result := MetroWalk( C_, _StdDev, 0.2 ) 126 | end; 127 | 128 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 129 | 130 | /////////////////////////////////////////////////////////////////////// アクセス 131 | 132 | function TDoubleRandWalkC.GetWalks( const I_:Integer ) :TDoubleC; 133 | begin 134 | Result := _Walks[ I_ ]; 135 | end; 136 | 137 | function TDoubleRandWalkC.GetWalksN :Integer; 138 | begin 139 | Result := Length( _Walks ); 140 | end; 141 | 142 | procedure TDoubleRandWalkC.SetWalksN( const WalksN_:Integer ); 143 | var 144 | N, I :Integer; 145 | begin 146 | N := WalksN; 147 | 148 | SetLength( _Walks, WalksN_ ); 149 | 150 | for I := N to WalksN_-1 do _Walks[ I ] := NextStep( _Walks[ I-1 ] ); 151 | end; 152 | 153 | function TDoubleRandWalkC.GetStdDev :TDoubleC; 154 | begin 155 | Result := _StdDev; 156 | end; 157 | 158 | procedure TDoubleRandWalkC.SetStdDev( const SDev_:TDoubleC ); 159 | begin 160 | _StdDev := SDev_; 161 | end; 162 | 163 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 164 | 165 | constructor TDoubleRandWalkC.Create; 166 | begin 167 | Create( 0 ); 168 | end; 169 | 170 | constructor TDoubleRandWalkC.Create( const WalksN_:Integer ); 171 | begin 172 | inherited Create; 173 | 174 | WalksN := WalksN_; 175 | StdDev := TDoubleC.Create( 0.25, 0.25 ); 176 | end; 177 | 178 | destructor TDoubleRandWalkC.Destroy; 179 | begin 180 | 181 | inherited; 182 | end; 183 | 184 | /////////////////////////////////////////////////////////////////////// メソッド 185 | 186 | procedure TDoubleRandWalkC.AddStep; 187 | var 188 | I :Integer; 189 | begin 190 | for I := 0 to WalksN-2 do _Walks[ I ] := _Walks[ I+1 ]; 191 | 192 | _Walks[ WalksN-1 ] := NextStep( _Walks[ WalksN-2 ] ); 193 | end; 194 | 195 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 196 | 197 | function Gauss( const C_,SD_:TSingleC ) :Single; 198 | begin 199 | Result := Gauss( C_.R, SD_.R ) * Gauss( C_.I, SD_.I ); 200 | end; 201 | 202 | function Gauss( const C_,SD_:TDoubleC ) :Double; 203 | begin 204 | Result := Gauss( C_.R, SD_.R ) * Gauss( C_.I, SD_.I ); 205 | end; 206 | 207 | //############################################################################## □ 208 | 209 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 210 | 211 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 212 | 213 | end. //######################################################################### ■ 214 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/Xoshiro/B32/LUX.Random.Xoshiro.B32.P128.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.Xoshiro.B32.P128; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D4, 6 | LUX.Random, 7 | LUX.Random.Xoshiro, 8 | LUX.Random.Xoshiro.B32; 9 | 10 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 11 | 12 | TRandom32XOS128p = class; 13 | TRandom32XOS128ss = class; 14 | TRandom32XOS128x64 = class; 15 | TRandom32XOS128x64p = class; 16 | TRandom32XOS128x64ss = class; 17 | 18 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 19 | 20 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 21 | 22 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128p 23 | 24 | TRandom32XOS128p = class( TRandom32XOS128 ) 25 | private 26 | protected 27 | ///// メソッド 28 | function CalcRandInt32u :Int32u; override; 29 | public 30 | end; 31 | 32 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128ss 33 | 34 | TRandom32XOS128ss = class( TRandom32XOS128 ) 35 | private 36 | protected 37 | ///// メソッド 38 | function CalcRandInt32u :Int32u; override; 39 | public 40 | end; 41 | 42 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128x64 43 | 44 | TRandom32XOS128x64 = class( TRandom32XOS128 ) 45 | private 46 | protected 47 | ///// メソッド 48 | procedure CalcNextSeed; override; 49 | public 50 | end; 51 | 52 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128x64p 53 | 54 | TRandom32XOS128x64p = class( TRandom32XOS128x64 ) 55 | private 56 | protected 57 | ///// メソッド 58 | function CalcRandInt32u :Int32u; override; 59 | public 60 | end; 61 | 62 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128x64ss 63 | 64 | TRandom32XOS128x64ss = class( TRandom32XOS128x64 ) 65 | private 66 | protected 67 | ///// メソッド 68 | function CalcRandInt32u :Int32u; override; 69 | public 70 | end; 71 | 72 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 73 | 74 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 75 | 76 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 77 | 78 | implementation //############################################################### ■ 79 | 80 | uses System.SysUtils; 81 | 82 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 83 | 84 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 85 | 86 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128p 87 | 88 | { http://xoshiro.di.unimi.it/xoshiro128plus.c } 89 | 90 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 91 | 92 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 93 | 94 | /////////////////////////////////////////////////////////////////////// メソッド 95 | 96 | function TRandom32XOS128p.CalcRandInt32u :UInt32; 97 | begin 98 | with _Seed do Result := X + W; 99 | end; 100 | 101 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 102 | 103 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128ss 104 | 105 | { http://xoshiro.di.unimi.it/xoshiro128plus.c } 106 | 107 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 108 | 109 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 110 | 111 | /////////////////////////////////////////////////////////////////////// メソッド 112 | 113 | function TRandom32XOS128ss.CalcRandInt32u :UInt32; 114 | begin 115 | Result := rotl( _Seed.X * 5, 7 ) * 9; 116 | end; 117 | 118 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 119 | 120 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128x64 121 | 122 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 123 | 124 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 125 | 126 | /////////////////////////////////////////////////////////////////////// メソッド 127 | 128 | procedure TRandom32XOS128x64.CalcNextSeed; 129 | const 130 | JUMP :array [ 0..4-1 ] of Int32u = ( $8764000b, 131 | $f542d2d3, 132 | $6fa035c3, 133 | $77f2db5b ); 134 | var 135 | S :TInt32u4D; 136 | I, B :Int32s; 137 | begin 138 | S := TInt32u4D.Create( 0, 0, 0, 0 ); 139 | 140 | for I := 0 to 4-1 do 141 | begin 142 | for B := 0 to 32 - 1 do 143 | begin 144 | if JUMP[ I ] and ( 1 shl B ) = 1 then 145 | begin 146 | with S do 147 | begin 148 | X := X xor _Seed.X; 149 | Y := Y xor _Seed.Y; 150 | Z := Z xor _Seed.Z; 151 | W := W xor _Seed.W; 152 | end; 153 | end; 154 | 155 | inherited CalcNextSeed; 156 | end; 157 | end; 158 | 159 | _Seed := S; 160 | end; 161 | 162 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 163 | 164 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128x64p 165 | 166 | { http://xoshiro.di.unimi.it/xoshiro128plus.c } 167 | 168 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 169 | 170 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 171 | 172 | /////////////////////////////////////////////////////////////////////// メソッド 173 | 174 | function TRandom32XOS128x64p.CalcRandInt32u :UInt32; 175 | begin 176 | with _Seed do Result := X + W; 177 | end; 178 | 179 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 180 | 181 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32XOS128x64ss 182 | 183 | { http://xoshiro.di.unimi.it/xoshiro128plus.c } 184 | 185 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 186 | 187 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 188 | 189 | /////////////////////////////////////////////////////////////////////// メソッド 190 | 191 | function TRandom32XOS128x64ss.CalcRandInt32u :UInt32; 192 | begin 193 | Result := rotl( _Seed.X * 5, 7 ) * 9; 194 | end; 195 | 196 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 197 | 198 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 199 | 200 | //############################################################################## □ 201 | 202 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 203 | 204 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 205 | 206 | end. //######################################################################### ■ 207 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/Xoshiro/B64/LUX.Random.Xoshiro.B64.P256.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.Xoshiro.B64.P256; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D2, LUX.D4, 6 | LUX.Random, 7 | LUX.Random.Xoshiro, 8 | LUX.Random.Xoshiro.B64; 9 | 10 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 11 | 12 | TRandom64XOS256p = class; 13 | TRandom64XOS256ss = class; 14 | TRandom64XOS256x128 = class; 15 | TRandom64XOS256x128p = class; 16 | TRandom64XOS256x128ss = class; 17 | 18 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 19 | 20 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 21 | 22 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS256p 23 | 24 | TRandom64XOS256p = class( TRandom64XOS256 ) 25 | private 26 | protected 27 | ///// メソッド 28 | function CalcRandInt64u :Int64u; override; 29 | public 30 | end; 31 | 32 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS256ss 33 | 34 | TRandom64XOS256ss = class( TRandom64XOS256 ) 35 | private 36 | protected 37 | ///// メソッド 38 | function CalcRandInt64u :Int64u; override; 39 | public 40 | end; 41 | 42 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS256x128 43 | 44 | TRandom64XOS256x128 = class( TRandom64XOS256 ) 45 | private 46 | protected 47 | ///// メソッド 48 | procedure CalcNextSeed; override; 49 | public 50 | end; 51 | 52 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS256x128p 53 | 54 | TRandom64XOS256x128p = class( TRandom64XOS256x128 ) 55 | private 56 | protected 57 | ///// メソッド 58 | function CalcRandInt64u :Int64u; override; 59 | public 60 | end; 61 | 62 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS256x128ss 63 | 64 | TRandom64XOS256x128ss = class( TRandom64XOS256x128 ) 65 | private 66 | protected 67 | ///// メソッド 68 | function CalcRandInt64u :Int64u; override; 69 | public 70 | end; 71 | 72 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 73 | 74 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 75 | 76 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 77 | 78 | implementation //############################################################### ■ 79 | 80 | uses System.SysUtils; 81 | 82 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 83 | 84 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 85 | 86 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS256p 87 | 88 | { http://xoshiro.di.unimi.it/xoshiro256plus.c } 89 | 90 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 91 | 92 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 93 | 94 | /////////////////////////////////////////////////////////////////////// メソッド 95 | 96 | function TRandom64XOS256p.CalcRandInt64u :Int64u; 97 | begin 98 | with _Seed do Result := X + W; 99 | end; 100 | 101 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 102 | 103 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS256ss 104 | 105 | { http://xoshiro.di.unimi.it/xoshiro256starstar.c } 106 | 107 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 108 | 109 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 110 | 111 | /////////////////////////////////////////////////////////////////////// メソッド 112 | 113 | function TRandom64XOS256ss.CalcRandInt64u :Int64u; 114 | begin 115 | Result := rotl( _Seed.Y * 5, 7 ) * 9; 116 | end; 117 | 118 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 119 | 120 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS256x128 121 | 122 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 123 | 124 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 125 | 126 | /////////////////////////////////////////////////////////////////////// メソッド 127 | 128 | procedure TRandom64XOS256x128.CalcNextSeed; 129 | const 130 | JUMP :array [ 0..4-1 ] of Int64u = ( $180ec6d33cfd0aba, 131 | $d5a61266f0c9392c, 132 | $a9582618e03fc9aa, 133 | $39abdc4529b1661c ); 134 | var 135 | S :TInt64u4D; 136 | I, B :Int64u; 137 | begin 138 | S := TInt64u4D.Create( 0, 0, 0, 0 ); 139 | 140 | for I := 0 to 4-1 do 141 | begin 142 | for B := 0 to 64-1 do 143 | begin 144 | if JUMP[ I ] and ( 1 shl B ) = 0 then 145 | begin 146 | with S do 147 | begin 148 | X := X xor _Seed.X; 149 | Y := Y xor _Seed.Y; 150 | Z := Z xor _Seed.Z; 151 | W := W xor _Seed.W; 152 | end; 153 | end; 154 | 155 | inherited CalcNextSeed; 156 | end; 157 | end; 158 | 159 | _Seed := S; 160 | end; 161 | 162 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 163 | 164 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS256x128p 165 | 166 | { http://xoshiro.di.unimi.it/xoshiro256plus.c } 167 | 168 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 169 | 170 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 171 | 172 | /////////////////////////////////////////////////////////////////////// メソッド 173 | 174 | function TRandom64XOS256x128p.CalcRandInt64u :Int64u; 175 | begin 176 | with _Seed do Result := X + W; 177 | end; 178 | 179 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 180 | 181 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64XOS256x128ss 182 | 183 | { http://xoshiro.di.unimi.it/xoshiro256starstar.c } 184 | 185 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 186 | 187 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 188 | 189 | /////////////////////////////////////////////////////////////////////// メソッド 190 | 191 | function TRandom64XOS256x128ss.CalcRandInt64u :Int64u; 192 | begin 193 | Result := rotl( _Seed.Y * 5, 7 ) * 9; 194 | end; 195 | 196 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 197 | 198 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 199 | 200 | //############################################################################## □ 201 | 202 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 203 | 204 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 205 | 206 | end. //######################################################################### ■ 207 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/SFMT/LUX.Random.SFMT.P2281.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.SFMT.P2281; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D3, LUX.D4, 6 | LUX.Random, 7 | LUX.Random.SFMT; 8 | 9 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 10 | 11 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT2281 16 | 17 | TRandom32SMT2281 = class( TRandom32SMT ) 18 | private const 19 | private 20 | protected 21 | ///// アクセス 22 | function GetSFMT_MEXP :Int32s; override; 23 | function GetSFMT_POS1 :Int32s; override; 24 | function GetSFMT_SL1 :Int32s; override; 25 | function GetSFMT_SL2 :Int32s; override; 26 | function GetSFMT_SR1 :Int32s; override; 27 | function GetSFMT_SR2 :Int32s; override; 28 | function GetSFMT_MSK1 :Int32u; override; 29 | function GetSFMT_MSK2 :Int32u; override; 30 | function GetSFMT_MSK3 :Int32u; override; 31 | function GetSFMT_MSK4 :Int32u; override; 32 | function GetSFMT_PARITY1 :Int32u; override; 33 | function GetSFMT_PARITY2 :Int32u; override; 34 | function GetSFMT_PARITY3 :Int32u; override; 35 | function GetSFMT_PARITY4 :Int32u; override; 36 | function GetSFMT_IDSTR :String; override; 37 | public 38 | end; 39 | 40 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT2281 41 | 42 | TRandom64SMT2281 = class( TRandom64SMT ) 43 | private const 44 | private 45 | protected 46 | ///// アクセス 47 | function GetSFMT_MEXP :Int32s; override; 48 | function GetSFMT_POS1 :Int32s; override; 49 | function GetSFMT_SL1 :Int32s; override; 50 | function GetSFMT_SL2 :Int32s; override; 51 | function GetSFMT_SR1 :Int32s; override; 52 | function GetSFMT_SR2 :Int32s; override; 53 | function GetSFMT_MSK1 :Int32u; override; 54 | function GetSFMT_MSK2 :Int32u; override; 55 | function GetSFMT_MSK3 :Int32u; override; 56 | function GetSFMT_MSK4 :Int32u; override; 57 | function GetSFMT_PARITY1 :Int32u; override; 58 | function GetSFMT_PARITY2 :Int32u; override; 59 | function GetSFMT_PARITY3 :Int32u; override; 60 | function GetSFMT_PARITY4 :Int32u; override; 61 | function GetSFMT_IDSTR :String; override; 62 | public 63 | end; 64 | 65 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 66 | 67 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 68 | 69 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 70 | 71 | implementation //############################################################### ■ 72 | 73 | uses System.SysUtils; 74 | 75 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 76 | 77 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 78 | 79 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT2281 80 | 81 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 82 | 83 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 84 | 85 | function TRandom32SMT2281.GetSFMT_MEXP :Int32s; 86 | begin 87 | Result := 2281; 88 | end; 89 | 90 | function TRandom32SMT2281.GetSFMT_POS1 :Int32s; 91 | begin 92 | Result := 12; 93 | end; 94 | 95 | function TRandom32SMT2281.GetSFMT_SL1 :Int32s; 96 | begin 97 | Result := 19; 98 | end; 99 | 100 | function TRandom32SMT2281.GetSFMT_SL2 :Int32s; 101 | begin 102 | Result := 1; 103 | end; 104 | 105 | function TRandom32SMT2281.GetSFMT_SR1 :Int32s; 106 | begin 107 | Result := 5; 108 | end; 109 | 110 | function TRandom32SMT2281.GetSFMT_SR2 :Int32s; 111 | begin 112 | Result := 1; 113 | end; 114 | 115 | function TRandom32SMT2281.GetSFMT_MSK1 :Int32u; 116 | begin 117 | Result := $bff7ffbf; 118 | end; 119 | 120 | function TRandom32SMT2281.GetSFMT_MSK2 :Int32u; 121 | begin 122 | Result := $fdfffffe; 123 | end; 124 | 125 | function TRandom32SMT2281.GetSFMT_MSK3 :Int32u; 126 | begin 127 | Result := $f7ffef7f; 128 | end; 129 | 130 | function TRandom32SMT2281.GetSFMT_MSK4 :Int32u; 131 | begin 132 | Result := $f2f7cbbf; 133 | end; 134 | 135 | function TRandom32SMT2281.GetSFMT_PARITY1 :Int32u; 136 | begin 137 | Result := $00000001; 138 | end; 139 | 140 | function TRandom32SMT2281.GetSFMT_PARITY2 :Int32u; 141 | begin 142 | Result := $00000000; 143 | end; 144 | 145 | function TRandom32SMT2281.GetSFMT_PARITY3 :Int32u; 146 | begin 147 | Result := $00000000; 148 | end; 149 | 150 | function TRandom32SMT2281.GetSFMT_PARITY4 :Int32u; 151 | begin 152 | Result := $41dfa600; 153 | end; 154 | 155 | function TRandom32SMT2281.GetSFMT_IDSTR :String; 156 | begin 157 | Result := 'SFMT-2281:12-19-1-5-1:bff7ffbf-fdfffffe-f7ffef7f-f2f7cbbf'; 158 | end; 159 | 160 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 161 | 162 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT2281 163 | 164 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 165 | 166 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 167 | 168 | function TRandom64SMT2281.GetSFMT_MEXP :Int32s; 169 | begin 170 | Result := 2281; 171 | end; 172 | 173 | function TRandom64SMT2281.GetSFMT_POS1 :Int32s; 174 | begin 175 | Result := 12; 176 | end; 177 | 178 | function TRandom64SMT2281.GetSFMT_SL1 :Int32s; 179 | begin 180 | Result := 19; 181 | end; 182 | 183 | function TRandom64SMT2281.GetSFMT_SL2 :Int32s; 184 | begin 185 | Result := 1; 186 | end; 187 | 188 | function TRandom64SMT2281.GetSFMT_SR1 :Int32s; 189 | begin 190 | Result := 5; 191 | end; 192 | 193 | function TRandom64SMT2281.GetSFMT_SR2 :Int32s; 194 | begin 195 | Result := 1; 196 | end; 197 | 198 | function TRandom64SMT2281.GetSFMT_MSK1 :Int32u; 199 | begin 200 | Result := $bff7ffbf; 201 | end; 202 | 203 | function TRandom64SMT2281.GetSFMT_MSK2 :Int32u; 204 | begin 205 | Result := $fdfffffe; 206 | end; 207 | 208 | function TRandom64SMT2281.GetSFMT_MSK3 :Int32u; 209 | begin 210 | Result := $f7ffef7f; 211 | end; 212 | 213 | function TRandom64SMT2281.GetSFMT_MSK4 :Int32u; 214 | begin 215 | Result := $f2f7cbbf; 216 | end; 217 | 218 | function TRandom64SMT2281.GetSFMT_PARITY1 :Int32u; 219 | begin 220 | Result := $00000001; 221 | end; 222 | 223 | function TRandom64SMT2281.GetSFMT_PARITY2 :Int32u; 224 | begin 225 | Result := $00000000; 226 | end; 227 | 228 | function TRandom64SMT2281.GetSFMT_PARITY3 :Int32u; 229 | begin 230 | Result := $00000000; 231 | end; 232 | 233 | function TRandom64SMT2281.GetSFMT_PARITY4 :Int32u; 234 | begin 235 | Result := $41dfa600; 236 | end; 237 | 238 | function TRandom64SMT2281.GetSFMT_IDSTR :String; 239 | begin 240 | Result := 'SFMT-2281:12-19-1-5-1:bff7ffbf-fdfffffe-f7ffef7f-f2f7cbbf'; 241 | end; 242 | 243 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 244 | 245 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 246 | 247 | //############################################################################## □ 248 | 249 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 250 | 251 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 252 | 253 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/SFMT/LUX.Random.SFMT.P4253.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.SFMT.P4253; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D3, LUX.D4, 6 | LUX.Random, 7 | LUX.Random.SFMT; 8 | 9 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 10 | 11 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT4253 16 | 17 | TRandom32SMT4253 = class( TRandom32SMT ) 18 | private const 19 | private 20 | protected 21 | ///// アクセス 22 | function GetSFMT_MEXP :Int32s; override; 23 | function GetSFMT_POS1 :Int32s; override; 24 | function GetSFMT_SL1 :Int32s; override; 25 | function GetSFMT_SL2 :Int32s; override; 26 | function GetSFMT_SR1 :Int32s; override; 27 | function GetSFMT_SR2 :Int32s; override; 28 | function GetSFMT_MSK1 :Int32u; override; 29 | function GetSFMT_MSK2 :Int32u; override; 30 | function GetSFMT_MSK3 :Int32u; override; 31 | function GetSFMT_MSK4 :Int32u; override; 32 | function GetSFMT_PARITY1 :Int32u; override; 33 | function GetSFMT_PARITY2 :Int32u; override; 34 | function GetSFMT_PARITY3 :Int32u; override; 35 | function GetSFMT_PARITY4 :Int32u; override; 36 | function GetSFMT_IDSTR :String; override; 37 | public 38 | end; 39 | 40 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT4253 41 | 42 | TRandom64SMT4253 = class( TRandom64SMT ) 43 | private const 44 | private 45 | protected 46 | ///// アクセス 47 | function GetSFMT_MEXP :Int32s; override; 48 | function GetSFMT_POS1 :Int32s; override; 49 | function GetSFMT_SL1 :Int32s; override; 50 | function GetSFMT_SL2 :Int32s; override; 51 | function GetSFMT_SR1 :Int32s; override; 52 | function GetSFMT_SR2 :Int32s; override; 53 | function GetSFMT_MSK1 :Int32u; override; 54 | function GetSFMT_MSK2 :Int32u; override; 55 | function GetSFMT_MSK3 :Int32u; override; 56 | function GetSFMT_MSK4 :Int32u; override; 57 | function GetSFMT_PARITY1 :Int32u; override; 58 | function GetSFMT_PARITY2 :Int32u; override; 59 | function GetSFMT_PARITY3 :Int32u; override; 60 | function GetSFMT_PARITY4 :Int32u; override; 61 | function GetSFMT_IDSTR :String; override; 62 | public 63 | end; 64 | 65 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 66 | 67 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 68 | 69 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 70 | 71 | implementation //############################################################### ■ 72 | 73 | uses System.SysUtils; 74 | 75 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 76 | 77 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 78 | 79 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT4253 80 | 81 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 82 | 83 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 84 | 85 | function TRandom32SMT4253.GetSFMT_MEXP :Int32s; 86 | begin 87 | Result := 4253; 88 | end; 89 | 90 | function TRandom32SMT4253.GetSFMT_POS1 :Int32s; 91 | begin 92 | Result := 17; 93 | end; 94 | 95 | function TRandom32SMT4253.GetSFMT_SL1 :Int32s; 96 | begin 97 | Result := 20; 98 | end; 99 | 100 | function TRandom32SMT4253.GetSFMT_SL2 :Int32s; 101 | begin 102 | Result := 1; 103 | end; 104 | 105 | function TRandom32SMT4253.GetSFMT_SR1 :Int32s; 106 | begin 107 | Result := 7; 108 | end; 109 | 110 | function TRandom32SMT4253.GetSFMT_SR2 :Int32s; 111 | begin 112 | Result := 1; 113 | end; 114 | 115 | function TRandom32SMT4253.GetSFMT_MSK1 :Int32u; 116 | begin 117 | Result := $9f7bffff; 118 | end; 119 | 120 | function TRandom32SMT4253.GetSFMT_MSK2 :Int32u; 121 | begin 122 | Result := $9fffff5f; 123 | end; 124 | 125 | function TRandom32SMT4253.GetSFMT_MSK3 :Int32u; 126 | begin 127 | Result := $3efffffb; 128 | end; 129 | 130 | function TRandom32SMT4253.GetSFMT_MSK4 :Int32u; 131 | begin 132 | Result := $fffff7bb; 133 | end; 134 | 135 | function TRandom32SMT4253.GetSFMT_PARITY1 :Int32u; 136 | begin 137 | Result := $a8000001; 138 | end; 139 | 140 | function TRandom32SMT4253.GetSFMT_PARITY2 :Int32u; 141 | begin 142 | Result := $af5390a3; 143 | end; 144 | 145 | function TRandom32SMT4253.GetSFMT_PARITY3 :Int32u; 146 | begin 147 | Result := $b740b3f8; 148 | end; 149 | 150 | function TRandom32SMT4253.GetSFMT_PARITY4 :Int32u; 151 | begin 152 | Result := $6c11486d; 153 | end; 154 | 155 | function TRandom32SMT4253.GetSFMT_IDSTR :String; 156 | begin 157 | Result := 'SFMT-4253:17-20-1-7-1:9f7bffff-9fffff5f-3efffffb-fffff7bb'; 158 | end; 159 | 160 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 161 | 162 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT4253 163 | 164 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 165 | 166 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 167 | 168 | function TRandom64SMT4253.GetSFMT_MEXP :Int32s; 169 | begin 170 | Result := 4253; 171 | end; 172 | 173 | function TRandom64SMT4253.GetSFMT_POS1 :Int32s; 174 | begin 175 | Result := 17; 176 | end; 177 | 178 | function TRandom64SMT4253.GetSFMT_SL1 :Int32s; 179 | begin 180 | Result := 20; 181 | end; 182 | 183 | function TRandom64SMT4253.GetSFMT_SL2 :Int32s; 184 | begin 185 | Result := 1; 186 | end; 187 | 188 | function TRandom64SMT4253.GetSFMT_SR1 :Int32s; 189 | begin 190 | Result := 7; 191 | end; 192 | 193 | function TRandom64SMT4253.GetSFMT_SR2 :Int32s; 194 | begin 195 | Result := 1; 196 | end; 197 | 198 | function TRandom64SMT4253.GetSFMT_MSK1 :Int32u; 199 | begin 200 | Result := $9f7bffff; 201 | end; 202 | 203 | function TRandom64SMT4253.GetSFMT_MSK2 :Int32u; 204 | begin 205 | Result := $9fffff5f; 206 | end; 207 | 208 | function TRandom64SMT4253.GetSFMT_MSK3 :Int32u; 209 | begin 210 | Result := $3efffffb; 211 | end; 212 | 213 | function TRandom64SMT4253.GetSFMT_MSK4 :Int32u; 214 | begin 215 | Result := $fffff7bb; 216 | end; 217 | 218 | function TRandom64SMT4253.GetSFMT_PARITY1 :Int32u; 219 | begin 220 | Result := $a8000001; 221 | end; 222 | 223 | function TRandom64SMT4253.GetSFMT_PARITY2 :Int32u; 224 | begin 225 | Result := $af5390a3; 226 | end; 227 | 228 | function TRandom64SMT4253.GetSFMT_PARITY3 :Int32u; 229 | begin 230 | Result := $b740b3f8; 231 | end; 232 | 233 | function TRandom64SMT4253.GetSFMT_PARITY4 :Int32u; 234 | begin 235 | Result := $6c11486d; 236 | end; 237 | 238 | function TRandom64SMT4253.GetSFMT_IDSTR :String; 239 | begin 240 | Result := 'SFMT-4253:17-20-1-7-1:9f7bffff-9fffff5f-3efffffb-fffff7bb'; 241 | end; 242 | 243 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 244 | 245 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 246 | 247 | //############################################################################## □ 248 | 249 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 250 | 251 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 252 | 253 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /MethodsFrame.pas: -------------------------------------------------------------------------------- 1 | unit MethodsFrame; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 7 | FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, 8 | System.Rtti, 9 | FMX.Grid.Style, FMX.Grid, FMX.Controls.Presentation, FMX.ScrollBox, 10 | LUX.Random; 11 | 12 | type 13 | TFrameM = class(TFrame) 14 | StringGridM: TStringGrid; 15 | StringColumnA: TStringColumn; 16 | StringColumnP: TStringColumn; 17 | StringColumnS: TStringColumn; 18 | StringColumnB: TStringColumn; 19 | procedure StringGridMSelectCell(Sender: TObject; const ACol, ARow: Integer; var CanSelect: Boolean); 20 | private 21 | _Methods :TArray; 22 | _Method :CRandom; 23 | ///// メソッド 24 | procedure AddRow( const A_:String; const P_,B_,S_:Uint32; const M_:CRandom ); 25 | public 26 | { public 宣言 } 27 | constructor Create( Owner_:TComponent ); override; 28 | destructor Destroy; override; 29 | ///// プロパティ 30 | property Method :CRandom read _Method; 31 | end; 32 | 33 | implementation //############################################################### ■ 34 | 35 | {$R *.fmx} 36 | 37 | uses LUX.Random.LCG, 38 | LUX.Random.Xorshift, 39 | LUX.Random.Xoshiro, 40 | LUX.Random.Xoshiro.B32, 41 | LUX.Random.Xoshiro.B32.P64, 42 | LUX.Random.Xoshiro.B32.P128, 43 | LUX.Random.Xoshiro.B64, 44 | LUX.Random.Xoshiro.B64.P128, 45 | LUX.Random.Xoshiro.B64.P256, 46 | LUX.Random.Xoshiro.B64.P512, 47 | LUX.Random.WELL, 48 | LUX.Random.WELL.P512, 49 | LUX.Random.WELL.P1024, 50 | LUX.Random.WELL.P19937, 51 | LUX.Random.WELL.P44497, 52 | LUX.Random.PCG, 53 | LUX.Random.PCG.B08, 54 | LUX.Random.PCG.B16, 55 | LUX.Random.PCG.B32, 56 | LUX.Random.PCG.B64, 57 | LUX.Random.SFMT, 58 | LUX.Random.SFMT.P607, 59 | LUX.Random.SFMT.P1279, 60 | LUX.Random.SFMT.P2281, 61 | LUX.Random.SFMT.P4253, 62 | LUX.Random.SFMT.P11213, 63 | LUX.Random.SFMT.P19937, 64 | LUX.Random.SFMT.P44497, 65 | LUX.Random.SFMT.P86243, 66 | LUX.Random.SFMT.P132049, 67 | LUX.Random.SFMT.P216091; 68 | 69 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 70 | 71 | /////////////////////////////////////////////////////////////////////// メソッド 72 | 73 | procedure TFrameM.AddRow( const A_:String; const P_,B_,S_:Uint32; const M_:CRandom ); 74 | var 75 | I :Integer; 76 | begin 77 | I := Length( _Methods ); 78 | 79 | with StringGridM do 80 | begin 81 | Cells[ 0, I ] := A_; 82 | Cells[ 1, I ] := P_.ToString; 83 | Cells[ 2, I ] := B_.ToString; 84 | Cells[ 3, I ] := S_.ToString; 85 | end; 86 | 87 | _Methods := _Methods + [ M_ ]; 88 | end; 89 | 90 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 91 | 92 | constructor TFrameM.Create( Owner_:TComponent ); 93 | begin 94 | inherited; 95 | 96 | AddRow( '-----' , 64, 64, 0, TRandomZero ); 97 | 98 | AddRow( 'LCG' , 32, 32, 0, TRandom32LCG32 ); 99 | AddRow( 'LCG' , 48, 48, 0, TRandom48LCG48 ); 100 | AddRow( 'LCG' , 64, 64, 0, TRandom64LCG64 ); 101 | 102 | AddRow( 'Xorshift' , 32, 32, 0, TRandom32XOR32 ); 103 | AddRow( 'Xorshift' , 64, 32, 0, TRandom32XOR64 ); 104 | AddRow( 'Xorshift' , 64, 64, 0, TRandom64XOR64 ); 105 | AddRow( 'Xorshift' , 96, 32, 0, TRandom32XOR96 ); 106 | AddRow( 'Xorshift' , 128, 32, 0, TRandom32XOR128 ); 107 | 108 | AddRow( 'xoroshiro*' , 64, 32, 0, TRandom32ROS64s ); 109 | AddRow( 'xoroshiro**', 64, 32, 0, TRandom32ROS64ss ); 110 | AddRow( 'xoshiro+' , 128, 32, 0, TRandom32XOS128p ); 111 | AddRow( 'xoshiro+' , 128, 32, 64, TRandom32XOS128x64p ); 112 | AddRow( 'xoshiro**' , 128, 32, 0, TRandom32XOS128ss ); 113 | AddRow( 'xoshiro**' , 128, 32, 64, TRandom32XOS128x64ss ); 114 | AddRow( 'xoroshiro+' , 128, 64, 0, TRandom64ROS128p ); 115 | AddRow( 'xoroshiro+' , 128, 64, 64, TRandom64ROS128x64p ); 116 | AddRow( 'xoroshiro*' , 128, 64, 0, TRandom64ROS128s ); 117 | AddRow( 'xoroshiro**', 128, 64, 0, TRandom64ROS128ss ); 118 | AddRow( 'xoroshiro**', 128, 64, 64, TRandom64ROS128x64ss ); 119 | AddRow( 'xoshiro+' , 256, 64, 0, TRandom64XOS256p ); 120 | AddRow( 'xoshiro+' , 256, 64, 128, TRandom64XOS256x128p ); 121 | AddRow( 'xoshiro**' , 256, 64, 0, TRandom64XOS256ss ); 122 | AddRow( 'xoshiro**' , 256, 64, 128, TRandom64XOS256x128ss ); 123 | AddRow( 'xoshiro+' , 512, 64, 0, TRandom64XOS512p ); 124 | AddRow( 'xoshiro**' , 512, 64, 0, TRandom64XOS512ss ); 125 | 126 | AddRow( 'WELL a' , 512, 32, 0, TRandom32WEL512a ); 127 | AddRow( 'WELL a' , 1024, 32, 0, TRandom32WEL1024a ); 128 | AddRow( 'WELL a' , 19937, 32, 0, TRandom32WEL19937a ); 129 | AddRow( 'WELL a_new' , 19937, 32, 0, TRandom32WEL19937anew ); 130 | AddRow( 'WELL c' , 19937, 32, 0, TRandom32WEL19937c ); 131 | AddRow( 'WELL a' , 44497, 32, 0, TRandom32WEL44497a ); 132 | AddRow( 'WELL a_new' , 44497, 32, 0, TRandom32WEL44497anew ); 133 | AddRow( 'WELL b' , 44497, 32, 0, TRandom32WEL44497b ); 134 | 135 | AddRow( 'PCG' , 8, 8, 0, TRandom08PCG08 ); 136 | AddRow( 'PCG' , 16, 16, 0, TRandom16PCG16 ); 137 | AddRow( 'PCG' , 32, 32, 0, TRandom32PCG32 ); 138 | AddRow( 'PCG' , 64, 64, 0, TRandom64PCG64 ); 139 | 140 | AddRow( 'SFMT' , 607, 32, 0, TRandom32SMT607 ); 141 | AddRow( 'SFMT' , 607, 64, 0, TRandom64SMT607 ); 142 | AddRow( 'SFMT' , 1279, 32, 0, TRandom32SMT1279 ); 143 | AddRow( 'SFMT' , 1279, 64, 0, TRandom64SMT1279 ); 144 | AddRow( 'SFMT' , 2281, 32, 0, TRandom32SMT2281 ); 145 | AddRow( 'SFMT' , 2281, 64, 0, TRandom64SMT2281 ); 146 | AddRow( 'SFMT' , 4253, 32, 0, TRandom32SMT4253 ); 147 | AddRow( 'SFMT' , 4253, 64, 0, TRandom64SMT4253 ); 148 | AddRow( 'SFMT' , 11213, 32, 0, TRandom32SMT11213 ); 149 | AddRow( 'SFMT' , 11213, 64, 0, TRandom64SMT11213 ); 150 | AddRow( 'SFMT' , 19937, 32, 0, TRandom32SMT19937 ); 151 | AddRow( 'SFMT' , 19937, 64, 0, TRandom64SMT19937 ); 152 | AddRow( 'SFMT' , 44497, 32, 0, TRandom32SMT44497 ); 153 | AddRow( 'SFMT' , 44497, 64, 0, TRandom64SMT44497 ); 154 | AddRow( 'SFMT' , 86243, 32, 0, TRandom32SMT86243 ); 155 | AddRow( 'SFMT' , 86243, 64, 0, TRandom64SMT86243 ); 156 | AddRow( 'SFMT' , 132049, 32, 0, TRandom32SMT132049 ); 157 | AddRow( 'SFMT' , 132049, 64, 0, TRandom64SMT132049 ); 158 | AddRow( 'SFMT' , 216091, 32, 0, TRandom32SMT216091 ); 159 | AddRow( 'SFMT' , 216091, 64, 0, TRandom64SMT216091 ); 160 | end; 161 | 162 | destructor TFrameM.Destroy; 163 | begin 164 | 165 | inherited; 166 | end; 167 | 168 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 169 | 170 | procedure TFrameM.StringGridMSelectCell(Sender: TObject; const ACol, ARow: Integer; var CanSelect: Boolean); 171 | begin 172 | _Method := _Methods[ ARow ]; 173 | end; 174 | 175 | end. //######################################################################### ■ 176 | -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/SFMT/LUX.Random.SFMT.P1279.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.SFMT.P1279; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D3, LUX.D4, 6 | LUX.Random, 7 | LUX.Random.SFMT; 8 | 9 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 10 | 11 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT1279 16 | 17 | TRandom32SMT1279 = class( TRandom32SMT ) 18 | private 19 | protected 20 | ///// アクセス 21 | function GetSFMT_MEXP :Int32s; override; 22 | function GetSFMT_POS1 :Int32s; override; 23 | function GetSFMT_SL1 :Int32s; override; 24 | function GetSFMT_SL2 :Int32s; override; 25 | function GetSFMT_SR1 :Int32s; override; 26 | function GetSFMT_SR2 :Int32s; override; 27 | function GetSFMT_MSK1 :Int32u; override; 28 | function GetSFMT_MSK2 :Int32u; override; 29 | function GetSFMT_MSK3 :Int32u; override; 30 | function GetSFMT_MSK4 :Int32u; override; 31 | function GetSFMT_PARITY1 :Int32u; override; 32 | function GetSFMT_PARITY2 :Int32u; override; 33 | function GetSFMT_PARITY3 :Int32u; override; 34 | function GetSFMT_PARITY4 :Int32u; override; 35 | function GetSFMT_IDSTR :String; override; 36 | public 37 | end; 38 | 39 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT1279 40 | 41 | TRandom64SMT1279 = class( TRandom64SMT ) 42 | private 43 | protected 44 | ///// アクセス 45 | function GetSFMT_MEXP :Int32s; override; 46 | function GetSFMT_POS1 :Int32s; override; 47 | function GetSFMT_SL1 :Int32s; override; 48 | function GetSFMT_SL2 :Int32s; override; 49 | function GetSFMT_SR1 :Int32s; override; 50 | function GetSFMT_SR2 :Int32s; override; 51 | function GetSFMT_MSK1 :Int32u; override; 52 | function GetSFMT_MSK2 :Int32u; override; 53 | function GetSFMT_MSK3 :Int32u; override; 54 | function GetSFMT_MSK4 :Int32u; override; 55 | function GetSFMT_PARITY1 :Int32u; override; 56 | function GetSFMT_PARITY2 :Int32u; override; 57 | function GetSFMT_PARITY3 :Int32u; override; 58 | function GetSFMT_PARITY4 :Int32u; override; 59 | function GetSFMT_IDSTR :String; override; 60 | public 61 | end; 62 | 63 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 64 | 65 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 66 | 67 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 68 | 69 | implementation //############################################################### ■ 70 | 71 | uses System.SysUtils; 72 | 73 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 74 | 75 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 76 | 77 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT1279 78 | 79 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 80 | 81 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 82 | 83 | /////////////////////////////////////////////////////////////////////// アクセス 84 | 85 | function TRandom32SMT1279.GetSFMT_MEXP :Int32s; 86 | begin 87 | Result := 1279; 88 | end; 89 | 90 | function TRandom32SMT1279.GetSFMT_POS1 :Int32s; 91 | begin 92 | Result := 7; 93 | end; 94 | 95 | function TRandom32SMT1279.GetSFMT_SL1 :Int32s; 96 | begin 97 | Result := 14; 98 | end; 99 | 100 | function TRandom32SMT1279.GetSFMT_SL2 :Int32s; 101 | begin 102 | Result := 3; 103 | end; 104 | 105 | function TRandom32SMT1279.GetSFMT_SR1 :Int32s; 106 | begin 107 | Result := 5; 108 | end; 109 | 110 | function TRandom32SMT1279.GetSFMT_SR2 :Int32s; 111 | begin 112 | Result := 1; 113 | end; 114 | 115 | function TRandom32SMT1279.GetSFMT_MSK1 :Int32u; 116 | begin 117 | Result := $f7fefffd; 118 | end; 119 | 120 | function TRandom32SMT1279.GetSFMT_MSK2 :Int32u; 121 | begin 122 | Result := $7fefcfff; 123 | end; 124 | 125 | function TRandom32SMT1279.GetSFMT_MSK3 :Int32u; 126 | begin 127 | Result := $aff3ef3f; 128 | end; 129 | 130 | function TRandom32SMT1279.GetSFMT_MSK4 :Int32u; 131 | begin 132 | Result := $b5ffff7f; 133 | end; 134 | 135 | function TRandom32SMT1279.GetSFMT_PARITY1 :Int32u; 136 | begin 137 | Result := $00000001; 138 | end; 139 | 140 | function TRandom32SMT1279.GetSFMT_PARITY2 :Int32u; 141 | begin 142 | Result := $00000000; 143 | end; 144 | 145 | function TRandom32SMT1279.GetSFMT_PARITY3 :Int32u; 146 | begin 147 | Result := $00000000; 148 | end; 149 | 150 | function TRandom32SMT1279.GetSFMT_PARITY4 :Int32u; 151 | begin 152 | Result := $20000000; 153 | end; 154 | 155 | function TRandom32SMT1279.GetSFMT_IDSTR :String; 156 | begin 157 | Result := 'SFMT-1279:7-14-3-5-1:f7fefffd-7fefcfff-aff3ef3f-b5ffff7f'; 158 | end; 159 | 160 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT1279 161 | 162 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 163 | 164 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 165 | 166 | /////////////////////////////////////////////////////////////////////// アクセス 167 | 168 | function TRandom64SMT1279.GetSFMT_MEXP :Int32s; 169 | begin 170 | Result := 1279; 171 | end; 172 | 173 | function TRandom64SMT1279.GetSFMT_POS1 :Int32s; 174 | begin 175 | Result := 7; 176 | end; 177 | 178 | function TRandom64SMT1279.GetSFMT_SL1 :Int32s; 179 | begin 180 | Result := 14; 181 | end; 182 | 183 | function TRandom64SMT1279.GetSFMT_SL2 :Int32s; 184 | begin 185 | Result := 3; 186 | end; 187 | 188 | function TRandom64SMT1279.GetSFMT_SR1 :Int32s; 189 | begin 190 | Result := 5; 191 | end; 192 | 193 | function TRandom64SMT1279.GetSFMT_SR2 :Int32s; 194 | begin 195 | Result := 1; 196 | end; 197 | 198 | function TRandom64SMT1279.GetSFMT_MSK1 :Int32u; 199 | begin 200 | Result := $f7fefffd; 201 | end; 202 | 203 | function TRandom64SMT1279.GetSFMT_MSK2 :Int32u; 204 | begin 205 | Result := $7fefcfff; 206 | end; 207 | 208 | function TRandom64SMT1279.GetSFMT_MSK3 :Int32u; 209 | begin 210 | Result := $aff3ef3f; 211 | end; 212 | 213 | function TRandom64SMT1279.GetSFMT_MSK4 :Int32u; 214 | begin 215 | Result := $b5ffff7f; 216 | end; 217 | 218 | function TRandom64SMT1279.GetSFMT_PARITY1 :Int32u; 219 | begin 220 | Result := $00000001; 221 | end; 222 | 223 | function TRandom64SMT1279.GetSFMT_PARITY2 :Int32u; 224 | begin 225 | Result := $00000000; 226 | end; 227 | 228 | function TRandom64SMT1279.GetSFMT_PARITY3 :Int32u; 229 | begin 230 | Result := $00000000; 231 | end; 232 | 233 | function TRandom64SMT1279.GetSFMT_PARITY4 :Int32u; 234 | begin 235 | Result := $20000000; 236 | end; 237 | 238 | function TRandom64SMT1279.GetSFMT_IDSTR :String; 239 | begin 240 | Result := 'SFMT-1279:7-14-3-5-1:f7fefffd-7fefcfff-aff3ef3f-b5ffff7f'; 241 | end; 242 | 243 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 244 | 245 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 246 | 247 | //############################################################################## □ 248 | 249 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 250 | 251 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 252 | 253 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/SFMT/LUX.Random.SFMT.P11213.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.SFMT.P11213; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D3, LUX.D4, 6 | LUX.Random, 7 | LUX.Random.SFMT; 8 | 9 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 10 | 11 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT11213 16 | 17 | TRandom32SMT11213 = class( TRandom32SMT ) 18 | private const 19 | private 20 | protected 21 | ///// アクセス 22 | function GetSFMT_MEXP :Int32s; override; 23 | function GetSFMT_POS1 :Int32s; override; 24 | function GetSFMT_SL1 :Int32s; override; 25 | function GetSFMT_SL2 :Int32s; override; 26 | function GetSFMT_SR1 :Int32s; override; 27 | function GetSFMT_SR2 :Int32s; override; 28 | function GetSFMT_MSK1 :Int32u; override; 29 | function GetSFMT_MSK2 :Int32u; override; 30 | function GetSFMT_MSK3 :Int32u; override; 31 | function GetSFMT_MSK4 :Int32u; override; 32 | function GetSFMT_PARITY1 :Int32u; override; 33 | function GetSFMT_PARITY2 :Int32u; override; 34 | function GetSFMT_PARITY3 :Int32u; override; 35 | function GetSFMT_PARITY4 :Int32u; override; 36 | function GetSFMT_IDSTR :String; override; 37 | public 38 | end; 39 | 40 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT11213 41 | 42 | TRandom64SMT11213 = class( TRandom64SMT ) 43 | private const 44 | private 45 | protected 46 | ///// アクセス 47 | function GetSFMT_MEXP :Int32s; override; 48 | function GetSFMT_POS1 :Int32s; override; 49 | function GetSFMT_SL1 :Int32s; override; 50 | function GetSFMT_SL2 :Int32s; override; 51 | function GetSFMT_SR1 :Int32s; override; 52 | function GetSFMT_SR2 :Int32s; override; 53 | function GetSFMT_MSK1 :Int32u; override; 54 | function GetSFMT_MSK2 :Int32u; override; 55 | function GetSFMT_MSK3 :Int32u; override; 56 | function GetSFMT_MSK4 :Int32u; override; 57 | function GetSFMT_PARITY1 :Int32u; override; 58 | function GetSFMT_PARITY2 :Int32u; override; 59 | function GetSFMT_PARITY3 :Int32u; override; 60 | function GetSFMT_PARITY4 :Int32u; override; 61 | function GetSFMT_IDSTR :String; override; 62 | public 63 | end; 64 | 65 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 66 | 67 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 68 | 69 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 70 | 71 | implementation //############################################################### ■ 72 | 73 | uses System.SysUtils; 74 | 75 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 76 | 77 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 78 | 79 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT11213 80 | 81 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 82 | 83 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 84 | 85 | function TRandom32SMT11213.GetSFMT_MEXP :Int32s; 86 | begin 87 | Result := 11213; 88 | end; 89 | 90 | function TRandom32SMT11213.GetSFMT_POS1 :Int32s; 91 | begin 92 | Result := 68; 93 | end; 94 | 95 | function TRandom32SMT11213.GetSFMT_SL1 :Int32s; 96 | begin 97 | Result := 14; 98 | end; 99 | 100 | function TRandom32SMT11213.GetSFMT_SL2 :Int32s; 101 | begin 102 | Result := 3; 103 | end; 104 | 105 | function TRandom32SMT11213.GetSFMT_SR1 :Int32s; 106 | begin 107 | Result := 7; 108 | end; 109 | 110 | function TRandom32SMT11213.GetSFMT_SR2 :Int32s; 111 | begin 112 | Result := 3; 113 | end; 114 | 115 | function TRandom32SMT11213.GetSFMT_MSK1 :Int32u; 116 | begin 117 | Result := $effff7fb; 118 | end; 119 | 120 | function TRandom32SMT11213.GetSFMT_MSK2 :Int32u; 121 | begin 122 | Result := $ffffffef; 123 | end; 124 | 125 | function TRandom32SMT11213.GetSFMT_MSK3 :Int32u; 126 | begin 127 | Result := $dfdfbfff; 128 | end; 129 | 130 | function TRandom32SMT11213.GetSFMT_MSK4 :Int32u; 131 | begin 132 | Result := $7fffdbfd; 133 | end; 134 | 135 | function TRandom32SMT11213.GetSFMT_PARITY1 :Int32u; 136 | begin 137 | Result := $00000001; 138 | end; 139 | 140 | function TRandom32SMT11213.GetSFMT_PARITY2 :Int32u; 141 | begin 142 | Result := $00000000; 143 | end; 144 | 145 | function TRandom32SMT11213.GetSFMT_PARITY3 :Int32u; 146 | begin 147 | Result := $e8148000; 148 | end; 149 | 150 | function TRandom32SMT11213.GetSFMT_PARITY4 :Int32u; 151 | begin 152 | Result := $d0c7afa3; 153 | end; 154 | 155 | function TRandom32SMT11213.GetSFMT_IDSTR :String; 156 | begin 157 | Result := 'SFMT-11213:68-14-3-7-3:effff7fb-ffffffef-dfdfbfff-7fffdbfd'; 158 | end; 159 | 160 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 161 | 162 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT11213 163 | 164 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 165 | 166 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 167 | 168 | function TRandom64SMT11213.GetSFMT_MEXP :Int32s; 169 | begin 170 | Result := 11213; 171 | end; 172 | 173 | function TRandom64SMT11213.GetSFMT_POS1 :Int32s; 174 | begin 175 | Result := 68; 176 | end; 177 | 178 | function TRandom64SMT11213.GetSFMT_SL1 :Int32s; 179 | begin 180 | Result := 14; 181 | end; 182 | 183 | function TRandom64SMT11213.GetSFMT_SL2 :Int32s; 184 | begin 185 | Result := 3; 186 | end; 187 | 188 | function TRandom64SMT11213.GetSFMT_SR1 :Int32s; 189 | begin 190 | Result := 7; 191 | end; 192 | 193 | function TRandom64SMT11213.GetSFMT_SR2 :Int32s; 194 | begin 195 | Result := 3; 196 | end; 197 | 198 | function TRandom64SMT11213.GetSFMT_MSK1 :Int32u; 199 | begin 200 | Result := $effff7fb; 201 | end; 202 | 203 | function TRandom64SMT11213.GetSFMT_MSK2 :Int32u; 204 | begin 205 | Result := $ffffffef; 206 | end; 207 | 208 | function TRandom64SMT11213.GetSFMT_MSK3 :Int32u; 209 | begin 210 | Result := $dfdfbfff; 211 | end; 212 | 213 | function TRandom64SMT11213.GetSFMT_MSK4 :Int32u; 214 | begin 215 | Result := $7fffdbfd; 216 | end; 217 | 218 | function TRandom64SMT11213.GetSFMT_PARITY1 :Int32u; 219 | begin 220 | Result := $00000001; 221 | end; 222 | 223 | function TRandom64SMT11213.GetSFMT_PARITY2 :Int32u; 224 | begin 225 | Result := $00000000; 226 | end; 227 | 228 | function TRandom64SMT11213.GetSFMT_PARITY3 :Int32u; 229 | begin 230 | Result := $e8148000; 231 | end; 232 | 233 | function TRandom64SMT11213.GetSFMT_PARITY4 :Int32u; 234 | begin 235 | Result := $d0c7afa3; 236 | end; 237 | 238 | function TRandom64SMT11213.GetSFMT_IDSTR :String; 239 | begin 240 | Result := 'SFMT-11213:68-14-3-7-3:effff7fb-ffffffef-dfdfbfff-7fffdbfd'; 241 | end; 242 | 243 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 244 | 245 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 246 | 247 | //############################################################################## □ 248 | 249 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 250 | 251 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 252 | 253 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/SFMT/LUX.Random.SFMT.P44497.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.SFMT.P44497; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D3, LUX.D4, 6 | LUX.Random, 7 | LUX.Random.SFMT; 8 | 9 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 10 | 11 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT44497 16 | 17 | TRandom32SMT44497 = class( TRandom32SMT ) 18 | private const 19 | private 20 | protected 21 | ///// アクセス 22 | function GetSFMT_MEXP :Int32s; override; 23 | function GetSFMT_POS1 :Int32s; override; 24 | function GetSFMT_SL1 :Int32s; override; 25 | function GetSFMT_SL2 :Int32s; override; 26 | function GetSFMT_SR1 :Int32s; override; 27 | function GetSFMT_SR2 :Int32s; override; 28 | function GetSFMT_MSK1 :Int32u; override; 29 | function GetSFMT_MSK2 :Int32u; override; 30 | function GetSFMT_MSK3 :Int32u; override; 31 | function GetSFMT_MSK4 :Int32u; override; 32 | function GetSFMT_PARITY1 :Int32u; override; 33 | function GetSFMT_PARITY2 :Int32u; override; 34 | function GetSFMT_PARITY3 :Int32u; override; 35 | function GetSFMT_PARITY4 :Int32u; override; 36 | function GetSFMT_IDSTR :String; override; 37 | public 38 | end; 39 | 40 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT44497 41 | 42 | TRandom64SMT44497 = class( TRandom64SMT ) 43 | private const 44 | private 45 | protected 46 | ///// アクセス 47 | function GetSFMT_MEXP :Int32s; override; 48 | function GetSFMT_POS1 :Int32s; override; 49 | function GetSFMT_SL1 :Int32s; override; 50 | function GetSFMT_SL2 :Int32s; override; 51 | function GetSFMT_SR1 :Int32s; override; 52 | function GetSFMT_SR2 :Int32s; override; 53 | function GetSFMT_MSK1 :Int32u; override; 54 | function GetSFMT_MSK2 :Int32u; override; 55 | function GetSFMT_MSK3 :Int32u; override; 56 | function GetSFMT_MSK4 :Int32u; override; 57 | function GetSFMT_PARITY1 :Int32u; override; 58 | function GetSFMT_PARITY2 :Int32u; override; 59 | function GetSFMT_PARITY3 :Int32u; override; 60 | function GetSFMT_PARITY4 :Int32u; override; 61 | function GetSFMT_IDSTR :String; override; 62 | public 63 | end; 64 | 65 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 66 | 67 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 68 | 69 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 70 | 71 | implementation //############################################################### ■ 72 | 73 | uses System.SysUtils; 74 | 75 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 76 | 77 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 78 | 79 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT44497 80 | 81 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 82 | 83 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 84 | 85 | function TRandom32SMT44497.GetSFMT_MEXP :Int32s; 86 | begin 87 | Result := 44497; 88 | end; 89 | 90 | function TRandom32SMT44497.GetSFMT_POS1 :Int32s; 91 | begin 92 | Result := 330; 93 | end; 94 | 95 | function TRandom32SMT44497.GetSFMT_SL1 :Int32s; 96 | begin 97 | Result := 5; 98 | end; 99 | 100 | function TRandom32SMT44497.GetSFMT_SL2 :Int32s; 101 | begin 102 | Result := 3; 103 | end; 104 | 105 | function TRandom32SMT44497.GetSFMT_SR1 :Int32s; 106 | begin 107 | Result := 9; 108 | end; 109 | 110 | function TRandom32SMT44497.GetSFMT_SR2 :Int32s; 111 | begin 112 | Result := 3; 113 | end; 114 | 115 | function TRandom32SMT44497.GetSFMT_MSK1 :Int32u; 116 | begin 117 | Result := $effffffb; 118 | end; 119 | 120 | function TRandom32SMT44497.GetSFMT_MSK2 :Int32u; 121 | begin 122 | Result := $dfbebfff; 123 | end; 124 | 125 | function TRandom32SMT44497.GetSFMT_MSK3 :Int32u; 126 | begin 127 | Result := $bfbf7bef; 128 | end; 129 | 130 | function TRandom32SMT44497.GetSFMT_MSK4 :Int32u; 131 | begin 132 | Result := $9ffd7bff; 133 | end; 134 | 135 | function TRandom32SMT44497.GetSFMT_PARITY1 :Int32u; 136 | begin 137 | Result := $00000001; 138 | end; 139 | 140 | function TRandom32SMT44497.GetSFMT_PARITY2 :Int32u; 141 | begin 142 | Result := $00000000; 143 | end; 144 | 145 | function TRandom32SMT44497.GetSFMT_PARITY3 :Int32u; 146 | begin 147 | Result := $a3ac4000; 148 | end; 149 | 150 | function TRandom32SMT44497.GetSFMT_PARITY4 :Int32u; 151 | begin 152 | Result := $ecc1327a; 153 | end; 154 | 155 | function TRandom32SMT44497.GetSFMT_IDSTR :String; 156 | begin 157 | Result := 'SFMT-44497:330-5-3-9-3:effffffb-dfbebfff-bfbf7bef-9ffd7bff'; 158 | end; 159 | 160 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 161 | 162 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT44497 163 | 164 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 165 | 166 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 167 | 168 | function TRandom64SMT44497.GetSFMT_MEXP :Int32s; 169 | begin 170 | Result := 44497; 171 | end; 172 | 173 | function TRandom64SMT44497.GetSFMT_POS1 :Int32s; 174 | begin 175 | Result := 330; 176 | end; 177 | 178 | function TRandom64SMT44497.GetSFMT_SL1 :Int32s; 179 | begin 180 | Result := 5; 181 | end; 182 | 183 | function TRandom64SMT44497.GetSFMT_SL2 :Int32s; 184 | begin 185 | Result := 3; 186 | end; 187 | 188 | function TRandom64SMT44497.GetSFMT_SR1 :Int32s; 189 | begin 190 | Result := 9; 191 | end; 192 | 193 | function TRandom64SMT44497.GetSFMT_SR2 :Int32s; 194 | begin 195 | Result := 3; 196 | end; 197 | 198 | function TRandom64SMT44497.GetSFMT_MSK1 :Int32u; 199 | begin 200 | Result := $effffffb; 201 | end; 202 | 203 | function TRandom64SMT44497.GetSFMT_MSK2 :Int32u; 204 | begin 205 | Result := $dfbebfff; 206 | end; 207 | 208 | function TRandom64SMT44497.GetSFMT_MSK3 :Int32u; 209 | begin 210 | Result := $bfbf7bef; 211 | end; 212 | 213 | function TRandom64SMT44497.GetSFMT_MSK4 :Int32u; 214 | begin 215 | Result := $9ffd7bff; 216 | end; 217 | 218 | function TRandom64SMT44497.GetSFMT_PARITY1 :Int32u; 219 | begin 220 | Result := $00000001; 221 | end; 222 | 223 | function TRandom64SMT44497.GetSFMT_PARITY2 :Int32u; 224 | begin 225 | Result := $00000000; 226 | end; 227 | 228 | function TRandom64SMT44497.GetSFMT_PARITY3 :Int32u; 229 | begin 230 | Result := $a3ac4000; 231 | end; 232 | 233 | function TRandom64SMT44497.GetSFMT_PARITY4 :Int32u; 234 | begin 235 | Result := $ecc1327a; 236 | end; 237 | 238 | function TRandom64SMT44497.GetSFMT_IDSTR :String; 239 | begin 240 | Result := 'SFMT-44497:330-5-3-9-3:effffffb-dfbebfff-bfbf7bef-9ffd7bff'; 241 | end; 242 | 243 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 244 | 245 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 246 | 247 | //############################################################################## □ 248 | 249 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 250 | 251 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 252 | 253 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/SFMT/LUX.Random.SFMT.P86243.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.SFMT.P86243; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D3, LUX.D4, 6 | LUX.Random, 7 | LUX.Random.SFMT; 8 | 9 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 10 | 11 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT86243 16 | 17 | TRandom32SMT86243 = class( TRandom32SMT ) 18 | private const 19 | private 20 | protected 21 | ///// アクセス 22 | function GetSFMT_MEXP :Int32s; override; 23 | function GetSFMT_POS1 :Int32s; override; 24 | function GetSFMT_SL1 :Int32s; override; 25 | function GetSFMT_SL2 :Int32s; override; 26 | function GetSFMT_SR1 :Int32s; override; 27 | function GetSFMT_SR2 :Int32s; override; 28 | function GetSFMT_MSK1 :Int32u; override; 29 | function GetSFMT_MSK2 :Int32u; override; 30 | function GetSFMT_MSK3 :Int32u; override; 31 | function GetSFMT_MSK4 :Int32u; override; 32 | function GetSFMT_PARITY1 :Int32u; override; 33 | function GetSFMT_PARITY2 :Int32u; override; 34 | function GetSFMT_PARITY3 :Int32u; override; 35 | function GetSFMT_PARITY4 :Int32u; override; 36 | function GetSFMT_IDSTR :String; override; 37 | public 38 | end; 39 | 40 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT86243 41 | 42 | TRandom64SMT86243 = class( TRandom64SMT ) 43 | private const 44 | private 45 | protected 46 | ///// アクセス 47 | function GetSFMT_MEXP :Int32s; override; 48 | function GetSFMT_POS1 :Int32s; override; 49 | function GetSFMT_SL1 :Int32s; override; 50 | function GetSFMT_SL2 :Int32s; override; 51 | function GetSFMT_SR1 :Int32s; override; 52 | function GetSFMT_SR2 :Int32s; override; 53 | function GetSFMT_MSK1 :Int32u; override; 54 | function GetSFMT_MSK2 :Int32u; override; 55 | function GetSFMT_MSK3 :Int32u; override; 56 | function GetSFMT_MSK4 :Int32u; override; 57 | function GetSFMT_PARITY1 :Int32u; override; 58 | function GetSFMT_PARITY2 :Int32u; override; 59 | function GetSFMT_PARITY3 :Int32u; override; 60 | function GetSFMT_PARITY4 :Int32u; override; 61 | function GetSFMT_IDSTR :String; override; 62 | public 63 | end; 64 | 65 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 66 | 67 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 68 | 69 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 70 | 71 | implementation //############################################################### ■ 72 | 73 | uses System.SysUtils; 74 | 75 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 76 | 77 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 78 | 79 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT86243 80 | 81 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 82 | 83 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 84 | 85 | function TRandom32SMT86243.GetSFMT_MEXP :Int32s; 86 | begin 87 | Result := 86243; 88 | end; 89 | 90 | function TRandom32SMT86243.GetSFMT_POS1 :Int32s; 91 | begin 92 | Result := 366; 93 | end; 94 | 95 | function TRandom32SMT86243.GetSFMT_SL1 :Int32s; 96 | begin 97 | Result := 6; 98 | end; 99 | 100 | function TRandom32SMT86243.GetSFMT_SL2 :Int32s; 101 | begin 102 | Result := 7; 103 | end; 104 | 105 | function TRandom32SMT86243.GetSFMT_SR1 :Int32s; 106 | begin 107 | Result := 19; 108 | end; 109 | 110 | function TRandom32SMT86243.GetSFMT_SR2 :Int32s; 111 | begin 112 | Result := 1; 113 | end; 114 | 115 | function TRandom32SMT86243.GetSFMT_MSK1 :Int32u; 116 | begin 117 | Result := $fdbffbff; 118 | end; 119 | 120 | function TRandom32SMT86243.GetSFMT_MSK2 :Int32u; 121 | begin 122 | Result := $bff7ff3f; 123 | end; 124 | 125 | function TRandom32SMT86243.GetSFMT_MSK3 :Int32u; 126 | begin 127 | Result := $fd77efff; 128 | end; 129 | 130 | function TRandom32SMT86243.GetSFMT_MSK4 :Int32u; 131 | begin 132 | Result := $bf9ff3ff; 133 | end; 134 | 135 | function TRandom32SMT86243.GetSFMT_PARITY1 :Int32u; 136 | begin 137 | Result := $00000001; 138 | end; 139 | 140 | function TRandom32SMT86243.GetSFMT_PARITY2 :Int32u; 141 | begin 142 | Result := $00000000; 143 | end; 144 | 145 | function TRandom32SMT86243.GetSFMT_PARITY3 :Int32u; 146 | begin 147 | Result := $00000000; 148 | end; 149 | 150 | function TRandom32SMT86243.GetSFMT_PARITY4 :Int32u; 151 | begin 152 | Result := $e9528d85; 153 | end; 154 | 155 | function TRandom32SMT86243.GetSFMT_IDSTR :String; 156 | begin 157 | Result := 'SFMT-86243:366-6-7-19-1:fdbffbff-bff7ff3f-fd77efff-bf9ff3ff'; 158 | end; 159 | 160 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 161 | 162 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT86243 163 | 164 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 165 | 166 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 167 | 168 | function TRandom64SMT86243.GetSFMT_MEXP :Int32s; 169 | begin 170 | Result := 86243; 171 | end; 172 | 173 | function TRandom64SMT86243.GetSFMT_POS1 :Int32s; 174 | begin 175 | Result := 366; 176 | end; 177 | 178 | function TRandom64SMT86243.GetSFMT_SL1 :Int32s; 179 | begin 180 | Result := 6; 181 | end; 182 | 183 | function TRandom64SMT86243.GetSFMT_SL2 :Int32s; 184 | begin 185 | Result := 7; 186 | end; 187 | 188 | function TRandom64SMT86243.GetSFMT_SR1 :Int32s; 189 | begin 190 | Result := 19; 191 | end; 192 | 193 | function TRandom64SMT86243.GetSFMT_SR2 :Int32s; 194 | begin 195 | Result := 1; 196 | end; 197 | 198 | function TRandom64SMT86243.GetSFMT_MSK1 :Int32u; 199 | begin 200 | Result := $fdbffbff; 201 | end; 202 | 203 | function TRandom64SMT86243.GetSFMT_MSK2 :Int32u; 204 | begin 205 | Result := $bff7ff3f; 206 | end; 207 | 208 | function TRandom64SMT86243.GetSFMT_MSK3 :Int32u; 209 | begin 210 | Result := $fd77efff; 211 | end; 212 | 213 | function TRandom64SMT86243.GetSFMT_MSK4 :Int32u; 214 | begin 215 | Result := $bf9ff3ff; 216 | end; 217 | 218 | function TRandom64SMT86243.GetSFMT_PARITY1 :Int32u; 219 | begin 220 | Result := $00000001; 221 | end; 222 | 223 | function TRandom64SMT86243.GetSFMT_PARITY2 :Int32u; 224 | begin 225 | Result := $00000000; 226 | end; 227 | 228 | function TRandom64SMT86243.GetSFMT_PARITY3 :Int32u; 229 | begin 230 | Result := $00000000; 231 | end; 232 | 233 | function TRandom64SMT86243.GetSFMT_PARITY4 :Int32u; 234 | begin 235 | Result := $e9528d85; 236 | end; 237 | 238 | function TRandom64SMT86243.GetSFMT_IDSTR :String; 239 | begin 240 | Result := 'SFMT-86243:366-6-7-19-1:fdbffbff-bff7ff3f-fd77efff-bf9ff3ff'; 241 | end; 242 | 243 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 244 | 245 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 246 | 247 | //############################################################################## □ 248 | 249 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 250 | 251 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 252 | 253 | end. //######################################################################### ■ -------------------------------------------------------------------------------- /_LIBRARY/LUXOPHIA/LUX/Random/SFMT/LUX.Random.SFMT.P19937.pas: -------------------------------------------------------------------------------- 1 | unit LUX.Random.SFMT.P19937; 2 | 3 | interface //#################################################################### ■ 4 | 5 | uses LUX, LUX.D3, LUX.D4, 6 | LUX.Random, 7 | LUX.Random.SFMT; 8 | 9 | type //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【型】 10 | 11 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 12 | 13 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 14 | 15 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT19937 16 | 17 | TRandom32SMT19937 = class( TRandom32SMT ) 18 | private const 19 | private 20 | protected 21 | ///// アクセス 22 | function GetSFMT_MEXP :Int32s; override; 23 | function GetSFMT_POS1 :Int32s; override; 24 | function GetSFMT_SL1 :Int32s; override; 25 | function GetSFMT_SL2 :Int32s; override; 26 | function GetSFMT_SR1 :Int32s; override; 27 | function GetSFMT_SR2 :Int32s; override; 28 | function GetSFMT_MSK1 :Int32u; override; 29 | function GetSFMT_MSK2 :Int32u; override; 30 | function GetSFMT_MSK3 :Int32u; override; 31 | function GetSFMT_MSK4 :Int32u; override; 32 | function GetSFMT_PARITY1 :Int32u; override; 33 | function GetSFMT_PARITY2 :Int32u; override; 34 | function GetSFMT_PARITY3 :Int32u; override; 35 | function GetSFMT_PARITY4 :Int32u; override; 36 | function GetSFMT_IDSTR :String; override; 37 | public 38 | end; 39 | 40 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT19937 41 | 42 | TRandom64SMT19937 = class( TRandom64SMT ) 43 | private const 44 | private 45 | protected 46 | ///// アクセス 47 | function GetSFMT_MEXP :Int32s; override; 48 | function GetSFMT_POS1 :Int32s; override; 49 | function GetSFMT_SL1 :Int32s; override; 50 | function GetSFMT_SL2 :Int32s; override; 51 | function GetSFMT_SR1 :Int32s; override; 52 | function GetSFMT_SR2 :Int32s; override; 53 | function GetSFMT_MSK1 :Int32u; override; 54 | function GetSFMT_MSK2 :Int32u; override; 55 | function GetSFMT_MSK3 :Int32u; override; 56 | function GetSFMT_MSK4 :Int32u; override; 57 | function GetSFMT_PARITY1 :Int32u; override; 58 | function GetSFMT_PARITY2 :Int32u; override; 59 | function GetSFMT_PARITY3 :Int32u; override; 60 | function GetSFMT_PARITY4 :Int32u; override; 61 | function GetSFMT_IDSTR :String; override; 62 | public 63 | end; 64 | 65 | //const //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【定数】 66 | 67 | //var //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【変数】 68 | 69 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 70 | 71 | implementation //############################################################### ■ 72 | 73 | uses System.SysUtils; 74 | 75 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【レコード】 76 | 77 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【クラス】 78 | 79 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom32SMT19937 80 | 81 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 82 | 83 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 84 | 85 | function TRandom32SMT19937.GetSFMT_MEXP :Int32s; 86 | begin 87 | Result := 19937; 88 | end; 89 | 90 | function TRandom32SMT19937.GetSFMT_POS1 :Int32s; 91 | begin 92 | Result := 122; 93 | end; 94 | 95 | function TRandom32SMT19937.GetSFMT_SL1 :Int32s; 96 | begin 97 | Result := 18; 98 | end; 99 | 100 | function TRandom32SMT19937.GetSFMT_SL2 :Int32s; 101 | begin 102 | Result := 1; 103 | end; 104 | 105 | function TRandom32SMT19937.GetSFMT_SR1 :Int32s; 106 | begin 107 | Result := 11; 108 | end; 109 | 110 | function TRandom32SMT19937.GetSFMT_SR2 :Int32s; 111 | begin 112 | Result := 1; 113 | end; 114 | 115 | function TRandom32SMT19937.GetSFMT_MSK1 :Int32u; 116 | begin 117 | Result := $dfffffef; 118 | end; 119 | 120 | function TRandom32SMT19937.GetSFMT_MSK2 :Int32u; 121 | begin 122 | Result := $ddfecb7f; 123 | end; 124 | 125 | function TRandom32SMT19937.GetSFMT_MSK3 :Int32u; 126 | begin 127 | Result := $bffaffff; 128 | end; 129 | 130 | function TRandom32SMT19937.GetSFMT_MSK4 :Int32u; 131 | begin 132 | Result := $bffffff6; 133 | end; 134 | 135 | function TRandom32SMT19937.GetSFMT_PARITY1 :Int32u; 136 | begin 137 | Result := $00000001; 138 | end; 139 | 140 | function TRandom32SMT19937.GetSFMT_PARITY2 :Int32u; 141 | begin 142 | Result := $00000000; 143 | end; 144 | 145 | function TRandom32SMT19937.GetSFMT_PARITY3 :Int32u; 146 | begin 147 | Result := $00000000; 148 | end; 149 | 150 | function TRandom32SMT19937.GetSFMT_PARITY4 :Int32u; 151 | begin 152 | Result := $13c9e684; 153 | end; 154 | 155 | function TRandom32SMT19937.GetSFMT_IDSTR :String; 156 | begin 157 | Result := 'SFMT-19937:122-18-1-11-1:dfffffef-ddfecb7f-bffaffff-bffffff6'; 158 | end; 159 | 160 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 161 | 162 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TRandom64SMT19937 163 | 164 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& private 165 | 166 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& protected 167 | 168 | function TRandom64SMT19937.GetSFMT_MEXP :Int32s; 169 | begin 170 | Result := 19937; 171 | end; 172 | 173 | function TRandom64SMT19937.GetSFMT_POS1 :Int32s; 174 | begin 175 | Result := 122; 176 | end; 177 | 178 | function TRandom64SMT19937.GetSFMT_SL1 :Int32s; 179 | begin 180 | Result := 18; 181 | end; 182 | 183 | function TRandom64SMT19937.GetSFMT_SL2 :Int32s; 184 | begin 185 | Result := 1; 186 | end; 187 | 188 | function TRandom64SMT19937.GetSFMT_SR1 :Int32s; 189 | begin 190 | Result := 11; 191 | end; 192 | 193 | function TRandom64SMT19937.GetSFMT_SR2 :Int32s; 194 | begin 195 | Result := 1; 196 | end; 197 | 198 | function TRandom64SMT19937.GetSFMT_MSK1 :Int32u; 199 | begin 200 | Result := $dfffffef; 201 | end; 202 | 203 | function TRandom64SMT19937.GetSFMT_MSK2 :Int32u; 204 | begin 205 | Result := $ddfecb7f; 206 | end; 207 | 208 | function TRandom64SMT19937.GetSFMT_MSK3 :Int32u; 209 | begin 210 | Result := $bffaffff; 211 | end; 212 | 213 | function TRandom64SMT19937.GetSFMT_MSK4 :Int32u; 214 | begin 215 | Result := $bffffff6; 216 | end; 217 | 218 | function TRandom64SMT19937.GetSFMT_PARITY1 :Int32u; 219 | begin 220 | Result := $00000001; 221 | end; 222 | 223 | function TRandom64SMT19937.GetSFMT_PARITY2 :Int32u; 224 | begin 225 | Result := $00000000; 226 | end; 227 | 228 | function TRandom64SMT19937.GetSFMT_PARITY3 :Int32u; 229 | begin 230 | Result := $00000000; 231 | end; 232 | 233 | function TRandom64SMT19937.GetSFMT_PARITY4 :Int32u; 234 | begin 235 | Result := $13c9e684; 236 | end; 237 | 238 | function TRandom64SMT19937.GetSFMT_IDSTR :String; 239 | begin 240 | Result := 'SFMT-19937:122-18-1-11-1:dfffffef-ddfecb7f-bffaffff-bffffff6'; 241 | end; 242 | 243 | //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& public 244 | 245 | //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$【ルーチン】 246 | 247 | //############################################################################## □ 248 | 249 | initialization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 初期化 250 | 251 | finalization //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 最終化 252 | 253 | end. //######################################################################### ■ --------------------------------------------------------------------------------