public Ramdomize ( double min, double max ) : void | ||
min | double | The minimum value for the random numbers. |
max | double | The maximum value for the random numbers. |
return | void |
public void Ramdomize(double min, double max)
{
for (int r = 0; r < Rows; r++)
{
for (int c = 0; c < Cols; c++)
{
matrix[r][c] = (ThreadSafeRandom.NextDouble()*(max - min)) + min;
}
}
}
public void Randomize() { const double min = 1.0; const double max = 10.0; var matrix = new Matrix(10, 10); matrix.Ramdomize(min, max); var array = matrix.ToPackedArray(); foreach (double t in array) { if (t < min || t > max) { Assert.IsFalse(true); } } }