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

GetArrayCopy() public method

Make a copy of this matrix as an array.
public GetArrayCopy ( ) : double[][]
return double[][]
        public double[][] GetArrayCopy()
        {
            var result = new double[Rows][];
            for (int row = 0; row < Rows; row++)
            {
                result[row] = new double[Cols];
                for (int col = 0; col < Cols; col++)
                {
                    result[row][col] = matrix[row][col];
                }
            }
            return result;
        }

Usage Example

Example #1
0
 public Matrix Solve(Matrix B)
 {
     int num;
     double[][] numArray;
     int num2;
     int num3;
     double num4;
     int num5;
     int num6;
     int num7;
     int num9;
     int num10;
     if ((B.Rows != this.x6088325dec1baa2a) && ((((uint) num7) + ((uint) num)) <= uint.MaxValue))
     {
         throw new MatrixError("Matrix row dimensions must agree.");
     }
     if (!this.IsFullRank())
     {
         throw new MatrixError("Matrix is rank deficient.");
     }
     goto Label_0275;
     Label_00E2:
     num7 = this.x57e9faf3ffdc07cc - 1;
     Label_0016:
     if (num7 >= 0)
     {
         int index = 0;
         while (index < num)
         {
             numArray[num7][index] /= this.x5f131619608f051b[num7];
             index++;
         }
         num9 = 0;
     Label_002E:
         if (num9 < num7)
         {
             num10 = 0;
             if ((((uint) index) - ((uint) num7)) <= uint.MaxValue)
             {
                 while (num10 < num)
                 {
                     numArray[num9][num10] -= numArray[num7][num10] * this.x1e2b930239385f93[num9][num7];
                     if (((uint) num3) < 0)
                     {
                         goto Label_00E2;
                     }
                     num10++;
                 }
                 num9++;
                 goto Label_002E;
             }
             goto Label_0016;
         }
         num7--;
     }
     else
     {
         return new Matrix(numArray).GetMatrix(0, this.x57e9faf3ffdc07cc - 1, 0, num - 1);
     }
     if (((uint) num2) <= uint.MaxValue)
     {
         goto Label_0016;
     }
     goto Label_0139;
     Label_0108:
     if (num3 < num)
     {
         num4 = 0.0;
         if ((((uint) num9) - ((uint) num10)) > uint.MaxValue)
         {
             goto Label_0127;
         }
         num5 = num2;
         while (true)
         {
             if (num5 >= this.x6088325dec1baa2a)
             {
                 num4 = -num4 / this.x1e2b930239385f93[num2][num2];
                 num6 = num2;
                 goto Label_013F;
             }
             num4 += this.x1e2b930239385f93[num5][num2] * numArray[num5][num3];
             num5++;
             if ((((uint) num10) | 0xff) == 0)
             {
                 goto Label_0275;
             }
         }
     }
     if ((((uint) num3) - ((uint) num9)) <= uint.MaxValue)
     {
     }
     Label_0127:
     num2++;
     Label_012B:
     if (num2 < this.x57e9faf3ffdc07cc)
     {
         num3 = 0;
         goto Label_0108;
     }
     goto Label_00E2;
     Label_0139:
     num6++;
     Label_013F:
     if (num6 < this.x6088325dec1baa2a)
     {
         numArray[num6][num3] += num4 * this.x1e2b930239385f93[num6][num2];
         if ((((uint) num2) + ((uint) num6)) <= uint.MaxValue)
         {
             goto Label_0139;
         }
     }
     else
     {
         num3++;
         if (((uint) num2) >= 0)
         {
             if ((((uint) num5) & 0) != 0)
             {
                 goto Label_012B;
             }
             goto Label_0108;
         }
         goto Label_00E2;
     }
     Label_0260:
     numArray = B.GetArrayCopy();
     num2 = 0;
     goto Label_012B;
     Label_0275:
     num = B.Cols;
     goto Label_0260;
 }
All Usage Examples Of Encog.MathUtil.Matrices.Matrix::GetArrayCopy