mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-26 01:00:50 +01:00
[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:
@@ -4,6 +4,7 @@
|
||||
#include <poincare/layout_helper.h>
|
||||
#include <poincare/serialization_helper.h>
|
||||
#include <poincare/code_point_layout.h>
|
||||
#include <poincare/sum.h>
|
||||
#include <poincare/vertical_offset_layout.h>
|
||||
#include <poincare/integer.h>
|
||||
#include "../shared/poincare_helpers.h"
|
||||
@@ -190,6 +191,10 @@ T Sequence::approximateToNextRank(int n, SequenceContext * sqctx) const {
|
||||
}
|
||||
}
|
||||
|
||||
Expression Sequence::sumBetweenBounds(double start, double end, Poincare::Context * context) const {
|
||||
return Poincare::Sum::Builder(expressionReduced(context).clone(), Poincare::Symbol::Builder(UCodePointUnknownX), Poincare::Float<double>::Builder(start), Poincare::Float<double>::Builder(end)); // Sum takes ownership of args
|
||||
}
|
||||
|
||||
Sequence::SequenceRecordDataBuffer * Sequence::recordData() const {
|
||||
assert(!isNull());
|
||||
Ion::Storage::Record::Data d = value();
|
||||
|
||||
Reference in New Issue
Block a user