[apps/sequence][apps/graph] fix behaviour when deleting functions

Change-Id: Ieccc85887fa0077446aaf57fee105b7fd2f3bff9
This commit is contained in:
Émilie Feral
2017-05-10 13:24:47 +02:00
parent 4e0e285501
commit 32d48fb94b
5 changed files with 18 additions and 1 deletions

View File

@@ -223,6 +223,17 @@ bool Sequence::isDefined() {
}
}
bool Sequence::isEmpty() {
switch (m_type) {
case Type::Explicite:
return Function::isEmpty();
case Type::SingleRecurrence:
return Function::isEmpty() && strlen(m_firstInitialConditionText) == 0;
default:
return Function::isEmpty() && strlen(m_firstInitialConditionText) == 0 && strlen(m_secondInitialConditionText) == 0;
}
}
float Sequence::evaluateAtAbscissa(float x, Poincare::Context * context) const {
float n = roundf(x);
switch (m_type) {