Esempio n. 1
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. 2
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. 3
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. 4
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);
        }
 public void Factorize(ref  SparseMatrix A, EnumSolver solver)
 {
     linearSolverPreFactorize = new LinearSystemLib(solver);
     linearSolverPreFactorize.Factorization(A);
 }
        public void Factorize(ref  SparseMatrix A)
        {

            linearSolverPreFactorize = new LinearSystemLib(LinearSystemInfo.SolverType);
            linearSolverPreFactorize.Factorization(A);
        }
Esempio n. 7
0
 public void Factorize(ref SparseMatrix A)
 {
     linearSolverPreFactorize = new LinearSystemLib(LinearSystemInfo.SolverType);
     linearSolverPreFactorize.Factorization(A);
 }
Esempio n. 8
0
 public void Factorize(ref SparseMatrix A, EnumSolver solver)
 {
     linearSolverPreFactorize = new LinearSystemLib(solver);
     linearSolverPreFactorize.Factorization(A);
 }
Esempio n. 9
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. 10
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;
        }