GetArrayCopy() public method

Make a copy of this matrix as an array.
public GetArrayCopy ( ) : double[][]
return double[][]
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;
 }
Example #2
0
 public Matrix Solve(Matrix b)
 {
     double[][] numArray;
     int cols;
     int num2;
     int num3;
     int num4;
     int num5;
     int num6;
     int num7;
     if (b.Rows == this.x57e9faf3ffdc07cc)
     {
         goto Label_027B;
     }
     throw new MatrixError("Matrix row dimensions must agree.");
     Label_0049:
     if (num6 < cols)
     {
         goto Label_006D;
     }
     num5--;
     Label_0054:
     if (num5 < 0)
     {
         return new Matrix(numArray);
     }
     Label_0068:
     num6 = 0;
     goto Label_0049;
     Label_006D:
     num7 = num5 + 1;
     while (num7 < this.x57e9faf3ffdc07cc)
     {
         numArray[num5][num6] -= numArray[num7][num6] * this.x9fc3ee03a439f6f0[num7][num5];
         num7++;
     }
     numArray[num5][num6] /= this.x9fc3ee03a439f6f0[num5][num5];
     num6++;
     goto Label_0049;
     Label_00A4:
     num2++;
     Label_00A8:
     if (num2 < this.x57e9faf3ffdc07cc)
     {
         goto Label_01AC;
     }
     num5 = this.x57e9faf3ffdc07cc - 1;
     goto Label_0054;
     Label_00CB:
     if (num4 < num2)
     {
         goto Label_012F;
     }
     if ((((uint) cols) - ((uint) num6)) < 0)
     {
         goto Label_01AC;
     }
     numArray[num2][num3] /= this.x9fc3ee03a439f6f0[num2][num2];
     num3++;
     Label_010E:
     if (num3 < cols)
     {
         num4 = 0;
         if ((((uint) num7) + ((uint) cols)) <= uint.MaxValue)
         {
             goto Label_016A;
         }
         goto Label_020C;
     }
     if ((((uint) num5) + ((uint) num3)) <= uint.MaxValue)
     {
         goto Label_00A4;
     }
     goto Label_00CB;
     Label_012F:
     numArray[num2][num3] -= numArray[num4][num3] * this.x9fc3ee03a439f6f0[num2][num4];
     if (8 != 0)
     {
         num4++;
         goto Label_00CB;
     }
     goto Label_00A4;
     Label_016A:
     if ((((uint) num6) - ((uint) num6)) < 0)
     {
         goto Label_006D;
     }
     goto Label_00CB;
     Label_01AC:
     num3 = 0;
     goto Label_010E;
     Label_020C:
     numArray = b.GetArrayCopy();
     cols = b.Cols;
     if ((((uint) cols) & 0) == 0)
     {
         if ((((uint) num4) | 15) == 0)
         {
             goto Label_012F;
         }
         if ((((uint) num7) - ((uint) num7)) < 0)
         {
             goto Label_010E;
         }
         if ((((uint) num5) - ((uint) num6)) < 0)
         {
             goto Label_0068;
         }
         num2 = 0;
         goto Label_00A8;
     }
     goto Label_016A;
     if ((((uint) num4) + ((uint) num2)) < 0)
     {
         goto Label_010E;
     }
     Label_027B:
     while (!this.xf8cb6c64791e1e69)
     {
         throw new MatrixError("Matrix is not symmetric positive definite.");
         if ((((uint) num5) + ((uint) cols)) <= uint.MaxValue)
         {
             break;
         }
     }
     goto Label_020C;
 }
Example #3
0
 public QRDecomposition(Matrix A)
 {
     int num;
     double num2;
     int num3;
     int num4;
     int num5;
     double num6;
     int num7;
     int num8;
     goto Label_02FC;
     Label_000B:
     if (num < this.x57e9faf3ffdc07cc)
     {
         num2 = 0.0;
         num3 = num;
         while (num3 < this.x6088325dec1baa2a)
         {
             num2 = EncogMath.Hypot(num2, this.x1e2b930239385f93[num3][num]);
             num3++;
         }
         if (num2 != 0.0)
         {
             if (this.x1e2b930239385f93[num][num] >= 0.0)
             {
                 goto Label_025B;
             }
         }
         else
         {
             if (((uint) num) < 0)
             {
                 goto Label_0073;
             }
             goto Label_0069;
         }
         goto Label_029E;
     }
     if ((((uint) num8) & 0) == 0)
     {
         goto Label_0092;
     }
     Label_002B:
     if ((((uint) num4) - ((uint) num)) < 0)
     {
         goto Label_015B;
     }
     Label_0069:
     this.x5f131619608f051b[num] = -num2;
     Label_0073:
     num++;
     if ((((uint) num7) + ((uint) num)) >= 0)
     {
         goto Label_000B;
     }
     Label_0092:
     if ((((uint) num2) - ((uint) num4)) >= 0)
     {
         if ((((uint) num6) & 0) == 0)
         {
             return;
         }
         if (((uint) num) >= 0)
         {
             goto Label_02FC;
         }
         goto Label_019F;
     }
     Label_00AA:
     while (num8 < this.x6088325dec1baa2a)
     {
         this.x1e2b930239385f93[num8][num5] += num6 * this.x1e2b930239385f93[num8][num];
         if ((((uint) num4) - ((uint) num3)) >= 0)
         {
             goto Label_00FD;
         }
     }
     num5++;
     Label_00BA:
     if (num5 < this.x57e9faf3ffdc07cc)
     {
         num6 = 0.0;
         if ((((uint) num3) + ((uint) num5)) > uint.MaxValue)
         {
             goto Label_01C2;
         }
         num7 = num;
         if ((((uint) num8) - ((uint) num6)) < 0)
         {
             goto Label_0069;
         }
         goto Label_015B;
     }
     goto Label_002B;
     Label_00FD:
     num8++;
     goto Label_00AA;
     Label_015B:
     while (num7 < this.x6088325dec1baa2a)
     {
         num6 += this.x1e2b930239385f93[num7][num] * this.x1e2b930239385f93[num7][num5];
         num7++;
     }
     num6 = -num6 / this.x1e2b930239385f93[num][num];
     num8 = num;
     goto Label_00AA;
     Label_019F:
     this.x1e2b930239385f93[num][num]++;
     Label_01C2:
     num5 = num + 1;
     goto Label_00BA;
     Label_0250:
     while (num4 < this.x6088325dec1baa2a)
     {
         this.x1e2b930239385f93[num4][num] /= num2;
         num4++;
         if ((((uint) num2) + ((uint) num5)) < 0)
         {
             goto Label_029E;
         }
     }
     goto Label_019F;
     Label_025B:
     num4 = num;
     if ((((uint) num7) & 0) != 0)
     {
         goto Label_00FD;
     }
     goto Label_0250;
     Label_029E:
     num2 = -num2;
     if ((((uint) num5) - ((uint) num5)) < 0)
     {
         goto Label_0250;
     }
     goto Label_025B;
     Label_02FC:
     this.x1e2b930239385f93 = A.GetArrayCopy();
     this.x6088325dec1baa2a = A.Rows;
     this.x57e9faf3ffdc07cc = A.Cols;
     this.x5f131619608f051b = new double[this.x57e9faf3ffdc07cc];
     num = 0;
     goto Label_000B;
 }
Example #4
0
 public LUDecomposition(Matrix A)
 {
     int num;
     double[] numArray;
     double[] numArray2;
     int num2;
     int num3;
     int num4;
     int num5;
     double num6;
     int num7;
     int num8;
     int num9;
     int num10;
     double num11;
     int num12;
     int num13;
     double num14;
     goto Label_03A9;
     Label_000B:
     if ((num2 < this.x6088325dec1baa2a) & (this.x6f7a05b81c35b16c[num2][num2] != 0.0))
     {
         num13 = num2 + 1;
         if ((((uint) num4) | 0x80000000) != 0)
         {
             goto Label_0070;
         }
         goto Label_03A9;
     }
     if ((((uint) num10) + ((uint) num5)) < 0)
     {
         goto Label_005C;
     }
     Label_004A:
     num2++;
     Label_004E:
     if (num2 < this.x57e9faf3ffdc07cc)
     {
         num3 = 0;
         goto Label_02C7;
     }
     return;
     Label_005C:
     num13++;
     Label_0062:
     if (num13 < this.x6088325dec1baa2a)
     {
         this.x6f7a05b81c35b16c[num13][num2] /= this.x6f7a05b81c35b16c[num2][num2];
         goto Label_005C;
     }
     goto Label_004A;
     Label_0070:
     if ((((uint) num10) - ((uint) num5)) > uint.MaxValue)
     {
         goto Label_0372;
     }
     goto Label_0062;
     Label_0120:
     while (num10 < this.x57e9faf3ffdc07cc)
     {
         num11 = this.x6f7a05b81c35b16c[num8][num10];
         this.x6f7a05b81c35b16c[num8][num10] = this.x6f7a05b81c35b16c[num2][num10];
         this.x6f7a05b81c35b16c[num2][num10] = num11;
         num10++;
     }
     if (((uint) num14) <= uint.MaxValue)
     {
         num12 = this.xf4c1900fcf4a6b03[num8];
         this.xf4c1900fcf4a6b03[num8] = this.xf4c1900fcf4a6b03[num2];
         this.xf4c1900fcf4a6b03[num2] = num12;
         this.xa0cac978920221b7 = -this.xa0cac978920221b7;
         goto Label_000B;
     }
     Label_0167:
     num9++;
     Label_016D:
     if (num9 < this.x6088325dec1baa2a)
     {
         if (Math.Abs(numArray2[num9]) > Math.Abs(numArray2[num8]))
         {
             goto Label_01C7;
         }
         goto Label_0167;
     }
     if (num8 != num2)
     {
         num10 = 0;
         goto Label_0120;
     }
     goto Label_000B;
     Label_01C7:
     num8 = num9;
     goto Label_0260;
     Label_01CD:
     num8 = num2;
     num9 = num2 + 1;
     goto Label_016D;
     Label_0207:
     if (num4 < this.x6088325dec1baa2a)
     {
         numArray = this.x6f7a05b81c35b16c[num4];
         num5 = Math.Min(num4, num2);
         goto Label_0291;
     }
     if ((((uint) num7) & 0) == 0)
     {
         goto Label_01CD;
     }
     if ((((uint) num7) - ((uint) num7)) >= 0)
     {
         goto Label_01C7;
     }
     Label_0260:
     if ((((uint) num8) - ((uint) num10)) >= 0)
     {
         if ((((uint) num8) - ((uint) num11)) >= 0)
         {
             if ((((uint) num11) & 0) == 0)
             {
                 goto Label_0167;
             }
             goto Label_0070;
         }
         if ((((uint) num14) + ((uint) num9)) < 0)
         {
             goto Label_004E;
         }
         if (0 != 0)
         {
             goto Label_0291;
         }
         goto Label_02F4;
     }
     goto Label_0207;
     Label_0291:
     num6 = 0.0;
     num7 = 0;
     Label_01DA:
     if (num7 < num5)
     {
         num6 += numArray[num7] * numArray2[num7];
         num7++;
         if (-2147483648 != 0)
         {
             goto Label_01DA;
         }
         goto Label_0260;
     }
     numArray[num2] = numArray2[num4] -= num6;
     if (0 != 0)
     {
         goto Label_01CD;
     }
     num4++;
     goto Label_0207;
     Label_02C7:
     if (num3 >= this.x6088325dec1baa2a)
     {
         num4 = 0;
         goto Label_0207;
     }
     Label_02F4:
     numArray2[num3] = this.x6f7a05b81c35b16c[num3][num2];
     if ((((uint) num12) - ((uint) num5)) > uint.MaxValue)
     {
         goto Label_0120;
     }
     if ((((uint) num11) - ((uint) num9)) <= uint.MaxValue)
     {
         num3++;
         goto Label_02C7;
     }
     goto Label_0207;
     Label_0372:
     while (num < this.x6088325dec1baa2a)
     {
         this.xf4c1900fcf4a6b03[num] = num;
         num++;
     }
     if (((uint) num8) > uint.MaxValue)
     {
         goto Label_0120;
     }
     this.xa0cac978920221b7 = 1;
     numArray2 = new double[this.x6088325dec1baa2a];
     num2 = 0;
     goto Label_004E;
     Label_03A9:
     this.x6f7a05b81c35b16c = A.GetArrayCopy();
     this.x6088325dec1baa2a = A.Rows;
     this.x57e9faf3ffdc07cc = A.Cols;
     this.xf4c1900fcf4a6b03 = new int[this.x6088325dec1baa2a];
     num = 0;
     goto Label_0372;
 }