public IEnumerable<IterativeResult> SolveSystems( IEnumerable<ISystemEquations> systemEquations, IterativeMethod iterativeMethod, double eps = 0.001) { return systemEquations.Select(systemEquation => SolveSystem(systemEquation, iterativeMethod, eps)); }
public IterativeResult SolveSystem(ISystemEquations systemEquations, IterativeMethod method, double eps = 0.001) { switch (method) { case IterativeMethod.SimpleIterations: // todo выполнить проверку на возможность приведения к типу return new SimpleIterationsMethod(systemEquations, eps).Solve(); case IterativeMethod.Seidel: return new SeidelMethod(systemEquations, eps).Solve(); default: return null; } }
public double Get(int iterations, string modelToUse) { IterativeMethod pi = null; switch (modelToUse) { case "Gregory-Leibniz": pi = new Gregory_Leibniz(); break; case "Nilikantha": pi = new Nilikantha(); break; default: throw new System.Exception($"Could not find [{modelToUse}] model."); } pi.NumberOfIterations = iterations; return(pi.Calculate()); }