Exemple #1
0
        public static Matrix <T> Random(ICalculator <T> calc, int rows, int columns, IValueGenerator <T> rng)
        {
            var ts = new T[rows, columns];

            for (var row = 0; row < ts.GetLength(0); row++)
            {
                for (var col = 0; col < ts.GetLength(1); col++)
                {
                    ts[row, col] = rng.Next();
                }
            }
            return(new Matrix <T>(calc, ts));
        }