|
VectorSample Method (Int32, UInt16)
|
Returns a vector of the specified sampleSize containing
non-repeating indices in the range [0, populationSize) in random order.
Namespace:
Accord.Math
Assembly:
Accord.Math (in Accord.Math.dll) Version: 3.8.0
Syntax public static ushort[] Sample(
int sampleSize,
ushort populationSize
)
Public Shared Function Sample (
sampleSize As Integer,
populationSize As UShort
) As UShort()
Request Example
View SourceParameters
- sampleSize
- Type: SystemInt32
The size of the sample vector to be generated. - populationSize
- Type: SystemUInt16
The non-inclusive maximum number an index can have.
Return Value
Type:
UInt16Remarks
In other words, this return a sample of size k from a population
of size N, where k is the parameter sampleSize
and N is the parameter populationSize.
Examples var a = Vector.Sample(3, 10);
var b = Vector.Sample(10, 10);
foreach (var i in Vector.Sample(5, 6))
{
}
See Also