numl.Math.LinearAlgebra.Matrix.Copy C# (CSharp) Method

Copy() public method

create deep copy of matrix.
public Copy ( ) : Matrix
return Matrix
        public Matrix Copy()
        {
            return ToArray();
        }

Usage Example

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.Copy();

            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::Copy