Discrete Distribution. Sample Into Method
On this page
Sample Into( Span< Int32> )
Fills a span with random numbers from the distribution using the
default thread-safe random number generator.
Sample Into( IRandom Source, I List< Int32> )
Fills the provided list with random samples drawn from this
distribution.
Sample Into( IRandom Source, Span< Int32> )
Fills a span with random numbers from the distribution.
Sample Into( Random, I List< Int32> )
Fills the provided list with random samples drawn from this
distribution.
Sample Into( Random, Int32[] )
Fills a list with random numbers from the distribution.
Sample Into( Random, Span< Int32> )
Fills the given span with random samples drawn from this distribution.
Sample Into( IRandom Source, I List< Int32> , Int32, Int32)
Fills a range within a list with random samples drawn from this
distribution.
Sample Into( Random, I List< Int32> , Int32, Int32)
Fills a range within a list with random samples drawn from this
distribution.
Sample Into< TGenerator> (TGenerator , Span< Int32> ) Sample Into< TGenerator> (IRandomSource< TGenerator> , Span< Int32> )
Fills a span with random numbers from the distribution.
Sample Into< TGenerator> (TGenerator , IList< Int32> , Int32, Int32)
Fills a range within a list with random samples drawn from this
distribution.
Fills a span with random numbers from the distribution using the
default thread-safe random number generator.
public void SampleInto (
Span <int > samples
)
Public Sub SampleInto (
samples As Span (Of Integer )
)
public :
void SampleInto (
Span <int > samples
)
member SampleInto :
samples : Span <int > -> unit Parameters samples Span < Int32 > A Span< T> .
protected void SampleInto <TGenerator>(
ref TGenerator generator ,
Span <int > samples
)
where TGenerator : struct , new (), IRandomGenerator
Protected Sub SampleInto (Of TGenerator As {Structure , New , IRandomGenerator }) (
ByRef generator As TGenerator,
samples As Span (Of Integer )
)
protected :
generic <typename TGenerator>
where TGenerator : value class , gcnew (), IRandomGenerator
void SampleInto (
TGenerator% generator ,
Span <int > samples
)
member SampleInto :
generator : 'TGenerator byref *
samples : Span <int > -> unit when 'TGenerator : struct , new () and IRandomGenerator generator TGenerator samples Span < Int32 > TGenerator
SampleInto(IRandomSource, IList<Int32>)
Fills the provided list with random samples drawn from this
distribution.
public void SampleInto (
IRandomSource random ,
IList <int > samples
)
Public Sub SampleInto (
random As IRandomSource ,
samples As IList (Of Integer )
)
public :
void SampleInto (
IRandomSource ^ random ,
IList <int >^ samples
)
member SampleInto :
random : IRandomSource *
samples : IList <int > -> unit Parameters random IRandomSource The Random used to produce
uniform variates that are transformed to distribution samples. samples IList < Int32 > The destination list to receive generated samples.
If samples is an array, this method routes to the
span-based overload to avoid extra copying. Exceptions
SampleInto(IRandomSource, Span<Int32>)
Fills a span with random numbers from the distribution.
public void SampleInto (
IRandomSource random ,
Span <int > samples
)
Public Sub SampleInto (
random As IRandomSource ,
samples As Span (Of Integer )
)
public :
void SampleInto (
IRandomSource ^ random ,
Span <int > samples
)
member SampleInto :
random : IRandomSource *
samples : Span <int > -> unit Parameters random IRandomSource An IRandomSource to use as the uniform
random number generator. samples Span < Int32 > A Span< T> .
SampleInto<TGenerator>(IRandomSource<TGenerator>, Span<Int32>)
Fills a span with random numbers from the distribution.
public void SampleInto <TGenerator>(
IRandomSource <TGenerator> random ,
Span <int > samples
)
where TGenerator : struct , new (), IRandomGenerator
Public Sub SampleInto (Of TGenerator As {Structure , New , IRandomGenerator }) (
random As IRandomSource (Of TGenerator),
samples As Span (Of Integer )
)
public :
generic <typename TGenerator>
where TGenerator : value class , gcnew (), IRandomGenerator
void SampleInto (
IRandomSource <TGenerator>^ random ,
Span <int > samples
)
member SampleInto :
random : IRandomSource <'TGenerator> *
samples : Span <int > -> unit when 'TGenerator : struct , new () and IRandomGenerator Parameters random IRandomSource < TGenerator > An IRandomSource< TGenerator> to use as the uniform
random number generator. samples Span < Int32 > A Span< T> . Type Parameters TGenerator The underlying generator type of the random source,
used to enable optimizations like inlining.
SampleInto(Random, IList<Int32>)
Fills the provided list with random samples drawn from this
distribution.
public void SampleInto (
Random random ,
IList <int > samples
)
Public Sub SampleInto (
random As Random ,
samples As IList (Of Integer )
)
public :
void SampleInto (
Random ^ random ,
IList <int >^ samples
)
member SampleInto :
random : Random *
samples : IList <int > -> unit Parameters random Random The Random used to produce
uniform variates that are transformed to distribution samples. samples IList < Int32 > The destination list to receive generated samples.
If samples is an array, this method routes to the
span-based overload to avoid extra copying. Exceptions
SampleInto(Random, Int32[])
Fills a list with random numbers from the distribution.
public void SampleInto (
Random random ,
int [] samples
)
Public Sub SampleInto (
random As Random ,
samples As Integer ()
)
public :
void SampleInto (
Random ^ random ,
array <int >^ samples
)
member SampleInto :
random : Random *
samples : int [] -> unit Parameters random Random A Random object that specifies the
uniform random number generator that is to be used to generate the samples. samples Int32 [] An integer array. Remarks This method fills samples ,
with random samples from the distribution.
Exceptions
SampleInto(Random, Span<Int32>)
Fills the given span with random samples drawn from this distribution.
public virtual void SampleInto (
Random random ,
Span <int > samples
)
Public Overridable Sub SampleInto (
random As Random ,
samples As Span (Of Integer )
)
public :
virtual void SampleInto (
Random ^ random ,
Span <int > samples
)
abstract SampleInto :
random : Random *
samples : Span <int > -> unit
override SampleInto :
random : Random *
samples : Span <int > -> unit Parameters random Random The Random used to produce
uniform variates that are transformed into distribution samples. samples Span < Int32 > The destination span to write generated values into. Remarks The default implementation generates values by repeatedly
calling Sample(Random) . Derived classes may
override this method to provide a more efficient bulk-sampling
implementation.
Exceptions
Fills a range within a list with random samples drawn from this
distribution.
public virtual void SampleInto <TGenerator>(
ref TGenerator generator ,
IList <int > samples ,
int startIndex ,
int length
)
where TGenerator : struct , new (), IRandomGenerator
Public Overridable Sub SampleInto (Of TGenerator As {Structure , New , IRandomGenerator }) (
ByRef generator As TGenerator,
samples As IList (Of Integer ),
startIndex As Integer ,
length As Integer
)
public :
generic <typename TGenerator>
where TGenerator : value class , gcnew (), IRandomGenerator
virtual void SampleInto (
TGenerator% generator ,
IList <int >^ samples ,
int startIndex ,
int length
)
abstract SampleInto :
generator : 'TGenerator byref *
samples : IList <int > *
startIndex : int *
length : int -> unit when 'TGenerator : struct , new () and IRandomGenerator
override SampleInto :
generator : 'TGenerator byref *
samples : IList <int > *
startIndex : int *
length : int -> unit when 'TGenerator : struct , new () and IRandomGenerator generator TGenerator The random number generator used to generate
uniform variates. samples IList < Int32 > The destination list to receive generated values. startIndex Int32 The zero-based index at which to begin writing. length Int32 The number of samples to write. TGenerator If samples is an array, this method forwards to
the span-based implementation for better performance.
SampleInto(IRandomSource, IList<Int32>, Int32, Int32)
Fills a range within a list with random samples drawn from this
distribution.
public virtual void SampleInto (
IRandomSource random ,
IList <int > samples ,
int startIndex ,
int length
)
Public Overridable Sub SampleInto (
random As IRandomSource ,
samples As IList (Of Integer ),
startIndex As Integer ,
length As Integer
)
public :
virtual void SampleInto (
IRandomSource ^ random ,
IList <int >^ samples ,
int startIndex ,
int length
)
abstract SampleInto :
random : IRandomSource *
samples : IList <int > *
startIndex : int *
length : int -> unit
override SampleInto :
random : IRandomSource *
samples : IList <int > *
startIndex : int *
length : int -> unit Parameters random IRandomSource The Random used to generate
uniform variates. samples IList < Int32 > The destination list to receive generated values. startIndex Int32 The zero-based index at which to begin writing. length Int32 The number of samples to write. Remarks If samples is an array, this method forwards to
the span-based implementation for better performance.
Exceptions
SampleInto(Random, IList<Int32>, Int32, Int32)
Fills a range within a list with random samples drawn from this
distribution.
public virtual void SampleInto (
Random random ,
IList <int > samples ,
int startIndex ,
int length
)
Public Overridable Sub SampleInto (
random As Random ,
samples As IList (Of Integer ),
startIndex As Integer ,
length As Integer
)
public :
virtual void SampleInto (
Random ^ random ,
IList <int >^ samples ,
int startIndex ,
int length
)
abstract SampleInto :
random : Random *
samples : IList <int > *
startIndex : int *
length : int -> unit
override SampleInto :
random : Random *
samples : IList <int > *
startIndex : int *
length : int -> unit Parameters random Random The Random used to generate
uniform variates. samples IList < Int32 > The destination list to receive generated values. startIndex Int32 The zero-based index at which to begin writing. length Int32 The number of samples to write. Remarks If samples is an array, this method forwards to
the span-based implementation for better performance.
Exceptions