예제 #1
0
파일: Solver.cs 프로젝트: Sequenta/MathMate
        public Vector<double> Solve(EquationsSystem system)
        {
            var simplifiedSystem = Simplify(system);
            var systemMatrix = simplifiedSystem.GetMatrix();
            var freeTerms = simplifiedSystem.GetFreeTermsVector();
            if (systemMatrix.IsSquare())
            {
                if (systemMatrix.RowCount<3)
                {
                    strategy = new CramersMethod();
                }
                else
                {
                    strategy = new MatrixMethod();
                }

            }
            return strategy.Solve(systemMatrix,freeTerms);
        }
예제 #2
0
파일: Solver.cs 프로젝트: Sequenta/MathMate
        public Vector <double> Solve(EquationsSystem system)
        {
            var simplifiedSystem = Simplify(system);
            var systemMatrix     = simplifiedSystem.GetMatrix();
            var freeTerms        = simplifiedSystem.GetFreeTermsVector();

            if (systemMatrix.IsSquare())
            {
                if (systemMatrix.RowCount < 3)
                {
                    strategy = new CramersMethod();
                }
                else
                {
                    strategy = new MatrixMethod();
                }
            }
            return(strategy.Solve(systemMatrix, freeTerms));
        }
예제 #3
0
파일: Solver.cs 프로젝트: Sequenta/MathMate
 private EquationsSystem Simplify(EquationsSystem system)
 {
     var simplifiedEquations = system.Equations.Select(x => x.Simplify());
     return new EquationsSystem(simplifiedEquations);
 }
예제 #4
0
파일: Solver.cs 프로젝트: Sequenta/MathMate
        private EquationsSystem Simplify(EquationsSystem system)
        {
            var simplifiedEquations = system.Equations.Select(x => x.Simplify());

            return(new EquationsSystem(simplifiedEquations));
        }