[apps/shared] Move sumBetweenBounds from controller (SumGraphController)

to the models (Sequence or CartesianFunction) and
CartesianFunction::sumBetweenBounds takes into account the function
domain
This commit is contained in:
Émilie Feral
2019-09-09 11:41:11 +02:00
parent 8185656870
commit f38c6ed3d1
11 changed files with 21 additions and 17 deletions

View File

@@ -1,6 +1,5 @@
#include "term_sum_controller.h"
#include "../../shared/text_field_delegate.h"
#include <poincare/sum.h>
#include <poincare/code_point_layout.h>
#include <poincare/horizontal_layout.h>
#include <poincare/vertical_offset_layout.h>
@@ -54,8 +53,4 @@ Layout TermSumController::createFunctionLayout(Shared::ExpiringPointer<Shared::F
return sequence->nameLayout();
}
Poincare::Expression TermSumController::sumBetweenBounds(Shared::ExpiringPointer<Shared::Function> function, double start, double end, Poincare::Context * context) const {
return Poincare::Sum::Builder(function->expressionReduced(context).clone(), Poincare::Symbol::Builder(UCodePointUnknownX), Poincare::Float<double>::Builder(start), Poincare::Float<double>::Builder(end)); // Sum takes ownership of args
}
}