Exemplo 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;
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo n.º 5
0
 public void Factorize(ref  SparseMatrix A, EnumSolver solver)
 {
     linearSolverPreFactorize = new LinearSystemLib(solver);
     linearSolverPreFactorize.Factorization(A);
 }
Exemplo n.º 6
0
        public void Factorize(ref  SparseMatrix A)
        {

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