[apps] Graph: first version of a function minimum finding algorithm

This commit is contained in:
Émilie Feral
2018-01-12 10:49:42 +01:00
committed by EmilieNumworks
parent 7077cb4f58
commit 03ebffa09d
2 changed files with 105 additions and 0 deletions

View File

@@ -13,8 +13,17 @@ public:
void setDisplayDerivative(bool display);
double approximateDerivative(double x, Poincare::Context * context) const;
double sumBetweenBounds(double start, double end, Poincare::Context * context) const override;
struct Point {
double abscissa;
double value;
};
Point mininimumBetweenBounds(double start, double end, Poincare::Context * context) const;
char symbol() const override;
private:
constexpr static double k_sqrtEps = 1.4901161193847656E-8; // sqrt(DBL_EPSILON)
constexpr static double k_goldenRatio = 0.381966011250105151795413165634361882279690820194237137864; // (3-sqrt(5))/2
double bracketFunction(double x, double z, Poincare::Context * context);
Point brentAlgorithm(double ax, double bx, Poincare::Context * context) const;
bool m_displayDerivative;
};