Esempio n. 1
0
 public double[] SolveByPreFactorize(ref double[] rightB)
 {
     if (linearSolverPreFactorize == null)
     {
         throw (new Exception("Please Prefactorize Matrix!!!"));
     }
     double[] unknow = new double[rightB.Length];
     linearSolverPreFactorize.SolveLinerSystem(ref rightB, ref unknow);
     return(unknow);
 }
Esempio n. 2
0
        public double[] SloveSquare(ref SparseMatrix A, ref double[] rightB)
        {
            double[] unknown = new double[rightB.Length];

            LinearSystemLib linearSolver = new LinearSystemLib(EnumSolver.UmfpackLU);
            linearSolver.Factorization(A);
            linearSolver.SolveLinerSystem(ref rightB, ref unknown);
            linearSolver.FreeSolver();
            return unknown;
        }
Esempio n. 3
0
        public double[] SloveSymmetric(ref SparseMatrix A, ref double[] rightB)
        {
            double[] unknown = new double[rightB.Length];

            LinearSystemLib linearSolver = new LinearSystemLib(EnumSolver.UmfpackLU);

            linearSolver.Factorization(A);
            linearSolver.SolveLinerSystem(ref rightB, ref unknown);
            linearSolver.FreeSolver();
            return(unknown);
        }
Esempio n. 4
0
        public double[] SlovePositiveDefinite(ref SparseMatrix A, ref double[] rightB)
        {
            double[] unknown = new double[rightB.Length];

            LinearSystemLib linearSolver = new LinearSystemLib(EnumSolver.CholmodCholesky);

            linearSolver.Factorization(A);
            linearSolver.SolveLinerSystem(ref rightB, ref unknown);
            linearSolver.FreeSolver();
            return(unknown);
        }
Esempio n. 5
0
        public double[] SloveLeastSquare(ref SparseMatrix L, ref double[] b)
        {
            double[] result = new double[L.ColumnSize];

            LinearSystemLib linearSolver = new LinearSystemLib();

            linearSolver.SolverType = EnumSolver.SPQRLeastSqure;
            linearSolver.Factorization(L);
            linearSolver.SolveLinerSystem(ref b, ref result);
            linearSolver.FreeSolver();

            return(result);
        }
Esempio n. 6
0
        public double[] SlovePositiveDefinite(ref SparseMatrix A, ref double[] rightB)
        {
            double[] unknown = new double[rightB.Length];

            LinearSystemLib linearSolver = new LinearSystemLib(EnumSolver.CholmodCholesky);
            linearSolver.Factorization(A);
            linearSolver.SolveLinerSystem(ref rightB, ref unknown);
            linearSolver.FreeSolver();
            return unknown;
        }
Esempio n. 7
0
        public double[] SloveLeastNormal(ref SparseMatrix L, ref double[] b)
        {
            double[] result = new double[L.ColumnSize];


            LinearSystemLib linearSolver = new LinearSystemLib();
            linearSolver.SolverType = EnumSolver.SPQRLeastNormal;
            linearSolver.Factorization(L.Transpose());
            linearSolver.SolveLinerSystem(ref b,ref result);
            linearSolver.FreeSolver();
         
            return result;
        }