Encog.MathUtil.Matrices.Matrix.Matrix C# (CSharp) Method

Matrix() public method

Construct a matrix from a 2D boolean array. Translate true to 1, false to -1.
public Matrix ( bool sourceMatrix ) : System
sourceMatrix bool A 2D array to construcat the matrix from.
return System
        public Matrix(bool[][] sourceMatrix)
        {
            matrix = new double[sourceMatrix.Length][];
            for (int r = 0; r < Rows; r++)
            {
                matrix[r] = new double[sourceMatrix[r].Length];
                for (int c = 0; c < Cols; c++)
                {
                    if (sourceMatrix[r][c])
                    {
                        matrix[r][c] = 1;
                    }
                    else
                    {
                        matrix[r][c] = -1;
                    }
                }
            }
        }

Same methods

Matrix::Matrix ( double sourceMatrix ) : System
Matrix::Matrix ( int rows, int cols ) : System