diff --git a/src/leastsquares.cpp b/src/leastsquares.cpp index 9566d1ac..0e35bbdd 100644 --- a/src/leastsquares.cpp +++ b/src/leastsquares.cpp @@ -757,7 +757,7 @@ bool LeastSquares::iterate(bool invert, COMPUTE_TYPE compute_type) m_interrupted = true; //std::cout<outputConversion(); - project->updateEllipsoids(); + m_calculusError = m_calculusError || !project->updateEllipsoids(); return !m_calculusError; } @@ -936,7 +936,10 @@ bool LeastSquares::iterate(bool invert, COMPUTE_TYPE compute_type) if (!m_calculusError) { project->outputConversion(); - if (invert) project->updateEllipsoids(); + if (invert) + { + m_calculusError = m_calculusError || !project->updateEllipsoids(); + } } return !m_calculusError; } diff --git a/src/leastsquares.h b/src/leastsquares.h index 4b945ea2..b89a3aaa 100644 --- a/src/leastsquares.h +++ b/src/leastsquares.h @@ -120,6 +120,7 @@ class LeastSquares bool m_interrupted;//0 protected: bool prepareSolve(spSolver &solver); @@ -134,7 +135,6 @@ class LeastSquares bool testStability(spSolver &solver); #endif - bool computeKernel();//returns true if dim(kern)>0 void kernelMessage(); MatrixOrdering matrixOrdering; std::vector > ICobs;//internal constraints obs diff --git a/src/point.cpp b/src/point.cpp index 97242936..70f91b00 100644 --- a/src/point.cpp +++ b/src/point.cpp @@ -80,7 +80,7 @@ std::string Point::toString() const if (ellipsoid.isSet()) { oss<<" var:"; - for (int i=0;ilsquares.sigma_0); + for (int i=0;i<3;i++) + { + if (!std::isfinite(ellipsoid.get_ellipsAxe(i))) + return false; + if (!std::isfinite(ellipsoid.get_variance(i))) + return false; + } + return true; } void Point::create_coordinates_constraits() diff --git a/src/point.h b/src/point.h index a1475ca9..0bc22198 100644 --- a/src/point.h +++ b/src/point.h @@ -116,7 +116,7 @@ class Point STATION_CREATION_MODE creation_mode=STATION_CREATION_MODE::ST_CREAT_ALLOWED);//where to add new observations bool initCoordinates(); - void set_posteriori_variance(const MatX &Qxx); + bool set_posteriori_variance(const MatX &Qxx); //< return false if error std::string toString() const; std::vector pointsMeasured() const;//warning(INFO_LS,1, + QT_TRANSLATE_NOOP("QObject","Error on output sigmas of point %s: %s"), + point.name.c_str(), point.ellipsoid.sigmasToString(lsquares.sigma_0).c_str()); + lsquares.computeKernel(); + return false; + } + } int nbrEllipsTooBig = 0; Point *ptbig = nullptr; @@ -1478,7 +1488,9 @@ void Project::updateEllipsoids() Project::theInfo()->warning(INFO_LS,1, QT_TRANSLATE_NOOP("QObject","and sigma0 = %.3f"), lsquares.sigma_0); + lsquares.computeKernel(); } + return true; } bool Project::computation(bool invert, bool saveNew) diff --git a/src/project.h b/src/project.h index 7ade5f02..cb2fa0ec 100644 --- a/src/project.h +++ b/src/project.h @@ -66,7 +66,7 @@ class Project bool exportSightMatrix(const std::string &filename); bool computation(bool invert, bool saveNew); - void updateEllipsoids(); + bool updateEllipsoids(); //< return false if error bool saveasJSON();