mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[apps/regression] Add a method to data model
Change-Id: Ic08de61e87a0886dfb2520bf9292ba1176b3d84a
This commit is contained in:
@@ -177,6 +177,10 @@ float Data::yIntercept() {
|
||||
return yMean() - slope()*xMean();
|
||||
}
|
||||
|
||||
float Data::yValueForXValue(float x) {
|
||||
return slope()*x+yIntercept();
|
||||
}
|
||||
|
||||
float Data::maxXValue() {
|
||||
float max = -FLT_MAX;
|
||||
for (int k = 0; k < m_numberOfPairs; k++) {
|
||||
@@ -219,6 +223,7 @@ float Data::minYValue() {
|
||||
|
||||
void Data::initCursorPosition() {
|
||||
m_xCursorPosition = (m_xMin+m_xMax)/2.0f;
|
||||
m_yCursorPosition = yValueForXValue(m_xCursorPosition);
|
||||
}
|
||||
|
||||
void Data::initWindowParameters() {
|
||||
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
float covariance();
|
||||
float slope();
|
||||
float yIntercept();
|
||||
float yValueForXValue(float x);
|
||||
|
||||
constexpr static int k_maxNumberOfPairs = 500;
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user