Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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));
        }