Ramdomize() public method

Fill the matrix with random values in the specified range.
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
Beispiel #1
0
        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);
                }
            }
        }
 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);
     }
 }