mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/reg] Do not show "Yprediction given x" if not available
This commit is contained in:
@@ -32,10 +32,19 @@ double ExponentialModel::evaluate(double * modelCoefficients, double x) const {
|
||||
return a*exp(b*x);
|
||||
}
|
||||
|
||||
bool ExponentialModel::levelSetAvailable(double * modelCoefficients) const {
|
||||
double a = modelCoefficients[0];
|
||||
double b = modelCoefficients[1];
|
||||
if (a == 0 || b == 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
double ExponentialModel::levelSet(double * modelCoefficients, double y) const {
|
||||
double a = modelCoefficients[0];
|
||||
double b = modelCoefficients[1];
|
||||
if (a == 0 || b == 0 || y/a <= 0) {
|
||||
if (!levelSetAvailable(modelCoefficients) || y/a <= 0) {
|
||||
return NAN;
|
||||
}
|
||||
return log(y/a)/b;
|
||||
|
||||
Reference in New Issue
Block a user