[apps/graph] Move function min and max computation from the controller

to the model CartesianFunction and take into account function domain
This commit is contained in:
Émilie Feral
2019-09-09 10:59:34 +02:00
parent 901cce9e67
commit 37fd6f4d76
3 changed files with 15 additions and 12 deletions

View File

@@ -274,6 +274,14 @@ Coordinate2D<T> CartesianFunction::templatedApproximateAtParameter(T t, Poincare
PoincareHelpers::ApproximateWithValueForSymbol(e.childAtIndex(1), unknown, t, context));
}
Coordinate2D<double> CartesianFunction::nextMinimumFrom(double start, double step, double max, Context * context) const {
return nextPointOfInterestFrom(start, step, max, context, [](Expression e, char * symbol, double start, double step, double max, Context * context) { return PoincareHelpers::NextMinimum(e, symbol, start, step, max, context); });
}
Coordinate2D<double> CartesianFunction::nextMaximumFrom(double start, double step, double max, Context * context) const {
return nextPointOfInterestFrom(start, step, max, context, [](Expression e, char * symbol, double start, double step, double max, Context * context) { return PoincareHelpers::NextMaximum(e, symbol, start, step, max, context); });
}
Coordinate2D<double> CartesianFunction::nextRootFrom(double start, double step, double max, Context * context) const {
return nextPointOfInterestFrom(start, step, max, context, [](Expression e, char * symbol, double start, double step, double max, Context * context) { return Coordinate2D<double>(PoincareHelpers::NextRoot(e, symbol, start, step, max, context), 0.0); });
}