mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps/reg] Fix non invertible matrix condition
This commit is contained in:
@@ -105,8 +105,8 @@ double Model::alphaPrimeCoefficient(Store * store, int series, double * modelCoe
|
||||
double result = 0.0;
|
||||
if (k == l) {
|
||||
result = alphaCoefficient(store, series, modelCoefficients, k, l)*(1.0+lambda);
|
||||
if (result == 0) {
|
||||
result = lambda;
|
||||
if (std::fabs(result) < Expression::epsilon<double>()) {
|
||||
result = 2*Expression::epsilon<double>();
|
||||
}
|
||||
} else {
|
||||
result = alphaCoefficient(store, series, modelCoefficients, l, k);
|
||||
|
||||
@@ -274,6 +274,9 @@ public:
|
||||
Coordinate2D nextMaximum(char symbol, double start, double step, double max, Context & context) const;
|
||||
double nextRoot(char symbol, double start, double step, double max, Context & context) const;
|
||||
Coordinate2D nextIntersection(char symbol, double start, double step, double max, Context & context, const Expression * expression) const;
|
||||
|
||||
/* Evaluation engine */
|
||||
template<typename T> static T epsilon();
|
||||
protected:
|
||||
/* Constructor */
|
||||
Expression() : m_parent(nullptr) {}
|
||||
@@ -282,7 +285,6 @@ protected:
|
||||
/* Evaluation Engine */
|
||||
typedef float SinglePrecision;
|
||||
typedef double DoublePrecision;
|
||||
template<typename T> static T epsilon();
|
||||
constexpr static int k_maxNumberOfSteps = 10000;
|
||||
|
||||
/* Simplification */
|
||||
|
||||
Reference in New Issue
Block a user