コード例 #1
0
        public static double[] Ctamer_Method(double [,] Array_A, double[] Array_B)
        {
            double[] Result = new double[Array_A.GetLength(0)];
            double   Det_A  = Determinat.Determinat_Method(Array_A);

            for (int i = 0; i < Result.GetLength(0); i++)
            {
                Result[i] = Determinat.Determinat_Method(Help_Cramer(i, Array_A, Array_B)) / Det_A;
            }
            return(Result);
        }
コード例 #2
0
 public static double MethodDeterminatFunc(_baseFunction[,] baseFunction, double[,] baseValue)
 {
     double[,] newMatrix = new double[baseFunction.GetLength(0), baseFunction.GetLength(1)];
     for (UInt16 i = 0; i < newMatrix.GetLength(0); ++i)
     {
         for (UInt16 j = 0; j < newMatrix.GetLength(1); ++j)
         {
             newMatrix[i, j] = baseFunction[i, j](baseValue[0, 0], baseValue[1, 0]);
         }
     }
     return(Determinat.Determinat_Method(newMatrix));
 }
コード例 #3
0
        public static double[,] InverseMatrixMethod(double[,] baseMatrix)
        {
            double[,] newMatrix = new double[baseMatrix.GetLength(0), baseMatrix.GetLength(1)];
            for (UInt16 i = 0; i < newMatrix.GetLength(0); ++i)
            {
                for (UInt16 j = 0; j < newMatrix.GetLength(1); ++j)
                {
                    double[,] temp = new double[newMatrix.GetLength(0) - 1, newMatrix.GetLength(1) - 1];
                    UInt16 iSpec = 0, jSpec = 0;
                    for (UInt16 it = 0; it < newMatrix.GetLength(0); ++it)
                    {
                        for (UInt16 jt = 0; jt < newMatrix.GetLength(1); ++jt)
                        {
                            if (i != it && j != jt)
                            {
                                temp[iSpec, jSpec] = baseMatrix[it, jt];
                                ++jSpec;
                                if (jSpec == temp.GetLength(1))
                                {
                                    jSpec = 0;
                                    ++iSpec;
                                }
                            }
                        }
                    }
                    newMatrix[i, j] = Math.Pow(-1f, i + j) * Determinat.Determinat_Method(temp);
                }
            }

            newMatrix = Transpose(newMatrix);

            double inverseDeterminat = 1f / Determinat.Determinat_Method(baseMatrix);

            for (UInt16 i = 0; i < newMatrix.GetLength(0); ++i)
            {
                for (UInt16 j = 0; j < newMatrix.GetLength(1); ++j)
                {
                    newMatrix[i, j] = newMatrix[i, j] * inverseDeterminat;
                }
            }
            return(newMatrix);
        }