Numworks Epsilon  1.4.1
Graphing Calculator Operating System
store.h
Go to the documentation of this file.
1 #ifndef REGRESSION_STORE_H
2 #define REGRESSION_STORE_H
3 
4 #include "../shared/interactive_curve_view_range.h"
5 #include "../shared/float_pair_store.h"
6 
7 namespace Regression {
8 
10 public:
11  Store();
12  // Dots
13  /* Return the closest dot to x above the regression curve if direction > 0,
14  * below otherwise*/
15  int closestVerticalDot(int direction, float x);
16  /* Return the closest dot to dot given on the right if direction > 0,
17  * on the left otherwise*/
18  int nextDot(int direction, int dot);
19 
20  // Window
21  void setDefault() override;
22 
23  // Calculation
24  double numberOfPairs();
25  double squaredValueSumOfColumn(int i);
26  double columnProductSum();
27  double meanOfColumn(int i);
28  double varianceOfColumn(int i);
29  double standardDeviationOfColumn(int i);
30  double covariance();
31  double slope();
32  double yIntercept();
33  double yValueForXValue(double x);
34  double xValueForYValue(double y);
35  double correlationCoefficient();
37 private:
38  constexpr static float k_displayTopMarginRatio = 0.12f;
39  constexpr static float k_displayRightMarginRatio = 0.05f;
40  constexpr static float k_displayBottomMarginRatio = 0.5f;
41  constexpr static float k_displayLeftMarginRatio = 0.05f;
42  InteractiveCurveViewRangeDelegate::Range computeYRange(InteractiveCurveViewRange * interactiveCurveViewRange) override;
43  float addMargin(float x, float range, bool isMin) override;
44  float maxValueOfColumn(int i);
45  float minValueOfColumn(int i);
46 };
47 
48 typedef double (Store::*ArgCalculPointer)(int);
49 typedef double (Store::*CalculPointer)();
50 typedef void (Store::*RangeMethodPointer)();
51 
52 }
53 
54 #endif
double squaredCorrelationCoefficient()
Definition: store.cpp:210
double columnProductSum()
Definition: store.cpp:154
double standardDeviationOfColumn(int i)
Definition: store.cpp:174
int closestVerticalDot(int direction, float x)
Definition: store.cpp:19
double meanOfColumn(int i)
Definition: store.cpp:162
double(Store::* CalculPointer)()
Definition: store.h:49
void(Store::* RangeMethodPointer)()
Definition: store.h:50
double correlationCoefficient()
Definition: store.cpp:201
double varianceOfColumn(int i)
Definition: store.cpp:169
double(Store::* ArgCalculPointer)(int)
Definition: store.h:48
int nextDot(int direction, int dot)
Definition: store.cpp:51
double yIntercept()
Definition: store.cpp:186
double xValueForYValue(double y)
Definition: store.cpp:194
InteractiveCurveViewRange(CurveViewCursor *cursor, InteractiveCurveViewRangeDelegate *delegate=nullptr)
void setDefault() override
Definition: store.cpp:111
double squaredValueSumOfColumn(int i)
Definition: store.cpp:146
double yValueForXValue(double x)
Definition: store.cpp:190
double numberOfPairs()
Definition: store.cpp:122
double slope()
Definition: store.cpp:182
double covariance()
Definition: store.cpp:178