[solver] Fix bug: when the number of solutions is infinite, do not try

to find the solution layouts
This commit is contained in:
Émilie Feral
2018-12-22 10:25:33 +01:00
committed by Léa Saviot
parent 87391d65ee
commit 05ef7008dc

View File

@@ -174,7 +174,7 @@ EquationStore::Error EquationStore::exactSolve(Poincare::Context * context) {
}
/* Turn the results in layouts */
int solutionIndex = 0;
int initialNumberOfSolutions = m_numberOfSolutions;
int initialNumberOfSolutions = m_numberOfSolutions <= k_maxNumberOfExactSolutions ? m_numberOfSolutions : -1;
// We iterate through the solutions and the potential delta
for (int i = 0; i < initialNumberOfSolutions+1; i++) {
if (!exactSolutions[i].isUninitialized()) {