mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph] Fixed cache step quirks
Change-Id: I5b630301ab2a4b17a5a4d77c7d9a05120449e55e
This commit is contained in:
committed by
Émilie Feral
parent
1bee23cf4f
commit
beb228fa78
@@ -1,6 +1,7 @@
|
||||
#ifndef SHARED_CONTINUOUS_FUNCTION_CACHE_H
|
||||
#define SHARED_CONTINUOUS_FUNCTION_CACHE_H
|
||||
|
||||
#include "../graph/graph/graph_view.h"
|
||||
#include <ion/display.h>
|
||||
#include <poincare/context.h>
|
||||
#include <poincare/coordinate_2D.h>
|
||||
@@ -10,10 +11,13 @@ namespace Shared {
|
||||
class ContinuousFunction;
|
||||
|
||||
class ContinuousFunctionCache {
|
||||
public:
|
||||
private:
|
||||
/* The size of the cache is chosen to optimize the display of cartesian
|
||||
* function */
|
||||
* functions */
|
||||
static constexpr int k_sizeOfCache = Ion::Display::Width;
|
||||
public:
|
||||
static constexpr int k_numberOfAvailableCaches = 2;
|
||||
static constexpr int k_parametricStepFactor = k_sizeOfCache / int(Graph::GraphView::k_graphStepDenominator);
|
||||
|
||||
static void PrepareForCaching(void * fun, ContinuousFunctionCache * cache, float tMin, float tStep);
|
||||
|
||||
@@ -23,13 +27,8 @@ public:
|
||||
void clear();
|
||||
Poincare::Coordinate2D<float> valueForParameter(const ContinuousFunction * function, Poincare::Context * context, float t);
|
||||
private:
|
||||
/* The size of the cache is chosen to optimize the display of cartesian
|
||||
* function */
|
||||
static constexpr int k_sizeOfCache = Ion::Display::Width;
|
||||
static constexpr float k_cacheHitTolerance = 1e-3;
|
||||
|
||||
static float StepFactor(ContinuousFunction * function);
|
||||
|
||||
void invalidateBetween(int iInf, int iSup);
|
||||
void setRange(ContinuousFunction * function, float tMin, float tStep);
|
||||
int indexForParameter(const ContinuousFunction * function, float t) const;
|
||||
|
||||
Reference in New Issue
Block a user