Documentation
¶
Overview ¶
Package rand_go_gx are Go bindings to the GX package: rand.
Automatically generated by gx/golang/binder/gobindings/bindings.go.tmpl.
Index ¶
- type Factory
- type MethodRandBool
- type MethodRandFloat32
- type MethodRandFloat32MinMax
- type MethodRandFloat64
- type MethodRandFloat64MinMax
- type MethodRandInt32
- type MethodRandInt64
- type MethodRandUint32
- type MethodRandUint64
- type New
- type NewPhilox
- type NewSource
- type Package
- func (cmpl *Package) AppendOptions(options ...options.PackageOptionFactory)
- func (cmpl *Package) MarshalPhilox(val values.Value) (s *Philox, err error)
- func (cmpl *Package) MarshalRand(val values.Value) (s *Rand, err error)
- func (cmpl *Package) MarshalbootstrapGenerator(val values.Value) (s *bootstrapGenerator, err error)
- type PackageIR
- type Philox
- type Rand
- func (s Rand) Bool() *MethodRandBool
- func (s *Rand) Bridge() types.Bridge
- func (s Rand) Float32() *MethodRandFloat32
- func (s Rand) Float32MinMax() *MethodRandFloat32MinMax
- func (s Rand) Float64() *MethodRandFloat64
- func (s Rand) Float64MinMax() *MethodRandFloat64MinMax
- func (s Rand) Int32() *MethodRandInt32
- func (s Rand) Int64() *MethodRandInt64
- func (s Rand) String() string
- func (s Rand) Uint32() *MethodRandUint32
- func (s Rand) Uint64() *MethodRandUint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
Package *Package
}
Factory create new instance of types used in the package. The compiler associated with the factory defines on what device and with which options methods of the instances created by the factory are compiled for.
func (*Factory) NewbootstrapGenerator ¶
func (fac *Factory) NewbootstrapGenerator() *bootstrapGenerator
NewbootstrapGenerator returns a handle on named type bootstrapGenerator.
type MethodRandBool ¶
type MethodRandBool struct {
// contains filtered or unexported fields
}
MethodRandBool compiles and runs the GX function Bool for a device. Bool returns pseudo-random boolean values as an array of bool.
func (*MethodRandBool) Run ¶
func (f *MethodRandBool) Run(arg0 *types.Slice[types.Atom[ir.Int]]) (_ *Rand, _ types.Array[bool], err error)
Run first compiles Bool for a given device and the given arguments. Once compiled, the function is then run with these same arguments. If the shape of the arguments change, the function will panic.
func (*MethodRandBool) String ¶
func (f *MethodRandBool) String() string
type MethodRandFloat32 ¶
type MethodRandFloat32 struct {
// contains filtered or unexported fields
}
MethodRandFloat32 compiles and runs the GX function Float32 for a device. Float32 returns pseudo-random values as an array of float32 uniformly distributed from [0.0, 1.0) (1.0 being excluded).
func (*MethodRandFloat32) Run ¶
func (f *MethodRandFloat32) Run(arg0 *types.Slice[types.Atom[ir.Int]]) (_ *Rand, _ types.Array[float32], err error)
Run first compiles Float32 for a given device and the given arguments. Once compiled, the function is then run with these same arguments. If the shape of the arguments change, the function will panic.
func (*MethodRandFloat32) String ¶
func (f *MethodRandFloat32) String() string
type MethodRandFloat32MinMax ¶
type MethodRandFloat32MinMax struct {
// contains filtered or unexported fields
}
MethodRandFloat32MinMax compiles and runs the GX function Float32MinMax for a device. Float32MinMax samples uniform pseudo-random values in [min, max).
func (*MethodRandFloat32MinMax) Run ¶
func (f *MethodRandFloat32MinMax) Run(arg0 types.Atom[float32], arg1 types.Atom[float32], arg2 *types.Slice[types.Atom[ir.Int]]) (_ *Rand, _ types.Array[float32], err error)
Run first compiles Float32MinMax for a given device and the given arguments. Once compiled, the function is then run with these same arguments. If the shape of the arguments change, the function will panic.
func (*MethodRandFloat32MinMax) String ¶
func (f *MethodRandFloat32MinMax) String() string
type MethodRandFloat64 ¶
type MethodRandFloat64 struct {
// contains filtered or unexported fields
}
MethodRandFloat64 compiles and runs the GX function Float64 for a device. Float64 returns pseudo-random values as an array of float64 uniformly distributed from [0.0, 1.0) (1.0 being excluded).
func (*MethodRandFloat64) Run ¶
func (f *MethodRandFloat64) Run(arg0 *types.Slice[types.Atom[ir.Int]]) (_ *Rand, _ types.Array[float64], err error)
Run first compiles Float64 for a given device and the given arguments. Once compiled, the function is then run with these same arguments. If the shape of the arguments change, the function will panic.
func (*MethodRandFloat64) String ¶
func (f *MethodRandFloat64) String() string
type MethodRandFloat64MinMax ¶
type MethodRandFloat64MinMax struct {
// contains filtered or unexported fields
}
MethodRandFloat64MinMax compiles and runs the GX function Float64MinMax for a device. Float64MinMax samples uniform pseudo-random values in [min, max).
func (*MethodRandFloat64MinMax) Run ¶
func (f *MethodRandFloat64MinMax) Run(arg0 types.Atom[float64], arg1 types.Atom[float64], arg2 *types.Slice[types.Atom[ir.Int]]) (_ *Rand, _ types.Array[float64], err error)
Run first compiles Float64MinMax for a given device and the given arguments. Once compiled, the function is then run with these same arguments. If the shape of the arguments change, the function will panic.
func (*MethodRandFloat64MinMax) String ¶
func (f *MethodRandFloat64MinMax) String() string
type MethodRandInt32 ¶
type MethodRandInt32 struct {
// contains filtered or unexported fields
}
MethodRandInt32 compiles and runs the GX function Int32 for a device. Int32 returns pseudo-random 32-bit values as an array of int32.
func (*MethodRandInt32) Run ¶
func (f *MethodRandInt32) Run(arg0 *types.Slice[types.Atom[ir.Int]]) (_ *Rand, _ types.Array[int32], err error)
Run first compiles Int32 for a given device and the given arguments. Once compiled, the function is then run with these same arguments. If the shape of the arguments change, the function will panic.
func (*MethodRandInt32) String ¶
func (f *MethodRandInt32) String() string
type MethodRandInt64 ¶
type MethodRandInt64 struct {
// contains filtered or unexported fields
}
MethodRandInt64 compiles and runs the GX function Int64 for a device. Int64 returns pseudo-random 64-bit values as an array of int64.
func (*MethodRandInt64) Run ¶
func (f *MethodRandInt64) Run(arg0 *types.Slice[types.Atom[ir.Int]]) (_ *Rand, _ types.Array[int64], err error)
Run first compiles Int64 for a given device and the given arguments. Once compiled, the function is then run with these same arguments. If the shape of the arguments change, the function will panic.
func (*MethodRandInt64) String ¶
func (f *MethodRandInt64) String() string
type MethodRandUint32 ¶
type MethodRandUint32 struct {
// contains filtered or unexported fields
}
MethodRandUint32 compiles and runs the GX function Uint32 for a device. Uint32 returns pseudo-random 32-bit values as an array of uint32.
func (*MethodRandUint32) Run ¶
func (f *MethodRandUint32) Run(arg0 *types.Slice[types.Atom[ir.Int]]) (_ *Rand, _ types.Array[uint32], err error)
Run first compiles Uint32 for a given device and the given arguments. Once compiled, the function is then run with these same arguments. If the shape of the arguments change, the function will panic.
func (*MethodRandUint32) String ¶
func (f *MethodRandUint32) String() string
type MethodRandUint64 ¶
type MethodRandUint64 struct {
// contains filtered or unexported fields
}
MethodRandUint64 compiles and runs the GX function Uint64 for a device. Uint64 returns pseudo-random 64-bit values as an array of uint64.
func (*MethodRandUint64) Run ¶
func (f *MethodRandUint64) Run(arg0 *types.Slice[types.Atom[ir.Int]]) (_ *Rand, _ types.Array[uint64], err error)
Run first compiles Uint64 for a given device and the given arguments. Once compiled, the function is then run with these same arguments. If the shape of the arguments change, the function will panic.
func (*MethodRandUint64) String ¶
func (f *MethodRandUint64) String() string
type New ¶
type New struct {
// contains filtered or unexported fields
}
New compiles and runs the GX function New for a device. New returns random values by transforming random values generated by src.
type NewPhilox ¶
type NewPhilox struct {
// contains filtered or unexported fields
}
NewPhilox compiles and runs the GX function NewPhilox for a device. NewPhilox returns a new Philox source seeded with the given values.
type NewSource ¶
type NewSource struct {
// contains filtered or unexported fields
}
NewSource compiles and runs the GX function NewSource for a device. NewSource returns a new source for a random generator using a seed.
type Package ¶
type Package struct { Package *PackageIR Device *api.Device Factory *Factory NewPhilox NewPhilox New New NewSource NewSource // contains filtered or unexported fields }
Package is a GX package for a given device. Functions and methods are compiled specifically for that device.
func BuildFor ¶
BuildFor loads the GX package rand then returns that package for a given device and options.
func (*Package) AppendOptions ¶
func (cmpl *Package) AppendOptions(options ...options.PackageOptionFactory)
AppendOptions appends options to the compiler.
func (*Package) MarshalPhilox ¶
MarshalPhilox populates the receiver fields with device handles.
func (*Package) MarshalRand ¶
MarshalRand populates the receiver fields with device handles.
type PackageIR ¶
PackageIR is the GX package intermediate representation built for a given runtime, but not yet for a specific device.
type Philox ¶
type Philox struct {
// contains filtered or unexported fields
}
Philox stores the handle of Philox on a device.
type Rand ¶
type Rand struct {
// contains filtered or unexported fields
}
Rand stores the handle of Rand on a device.
func (Rand) Bool ¶
func (s Rand) Bool() *MethodRandBool
Bool returns a handle to compile method Bool for a device.
func (Rand) Float32 ¶
func (s Rand) Float32() *MethodRandFloat32
Float32 returns a handle to compile method Float32 for a device.
func (Rand) Float32MinMax ¶
func (s Rand) Float32MinMax() *MethodRandFloat32MinMax
Float32MinMax returns a handle to compile method Float32MinMax for a device.
func (Rand) Float64 ¶
func (s Rand) Float64() *MethodRandFloat64
Float64 returns a handle to compile method Float64 for a device.
func (Rand) Float64MinMax ¶
func (s Rand) Float64MinMax() *MethodRandFloat64MinMax
Float64MinMax returns a handle to compile method Float64MinMax for a device.
func (Rand) Int32 ¶
func (s Rand) Int32() *MethodRandInt32
Int32 returns a handle to compile method Int32 for a device.
func (Rand) Int64 ¶
func (s Rand) Int64() *MethodRandInt64
Int64 returns a handle to compile method Int64 for a device.
func (Rand) Uint32 ¶
func (s Rand) Uint32() *MethodRandUint32
Uint32 returns a handle to compile method Uint32 for a device.
func (Rand) Uint64 ¶
func (s Rand) Uint64() *MethodRandUint64
Uint64 returns a handle to compile method Uint64 for a device.