numl.Math.LinearAlgebra.Matrix.ToArray C# (CSharp) Метод

ToArray() приватный Метод

Performs a deep copy of the underlying matrix and returns a 2D array.
private ToArray ( ) : double[][]
Результат double[][]
        private double[][] ToArray()
        {
            if (_asTransposeRef)
            {
                return ToTransposeArray();
            }

            return _matrix.Select(s => s.ToArray()).ToArray();
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Performs an element wise operation on the input Matrix.
        /// </summary>
        /// <param name="m">Matrix.</param>
        /// <param name="fnElementWiseOp">Function to update each cell specified by the value and cell coordinates.</param>
        /// <returns>A Matrix.</returns>
        public static Matrix Each(Matrix m, Func <double, int, int, double> fnElementWiseOp)
        {
            var copy = m.ToArray();

            for (int i = 0; i < m.Rows; i++)
            {
                for (int j = 0; j < m.Cols; j++)
                {
                    copy[i][j] = fnElementWiseOp(copy[i][j], i, j);
                }
            }
            return(copy);
        }
All Usage Examples Of numl.Math.LinearAlgebra.Matrix::ToArray