From fe08cf8fb7a2cb1ed486135cd493ca751aa64f21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Vallv=C3=A9=20Navarro?= <jvallve@iri.upc.edu>
Date: Mon, 27 May 2019 11:32:09 +0200
Subject: [PATCH] disable changing loss function for now (it's not handled by
 the solver)

---
 include/core/factor/factor_base.h |  2 +-
 src/factor/factor_base.cpp        | 19 +++++--------------
 2 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/include/core/factor/factor_base.h b/include/core/factor/factor_base.h
index be2ae385f..42089e0e5 100644
--- a/include/core/factor/factor_base.h
+++ b/include/core/factor/factor_base.h
@@ -136,7 +136,7 @@ class FactorBase : public NodeBase, public std::enable_shared_from_this<FactorBa
 
         /** \brief Gets the apply loss function flag
          */
-        void setApplyLossFunction(const bool _apply);
+        //void setApplyLossFunction(const bool _apply);
 
         /** \brief Returns a pointer to the frame constrained to
          **/
diff --git a/src/factor/factor_base.cpp b/src/factor/factor_base.cpp
index 23c0140c1..bd5751fa8 100644
--- a/src/factor/factor_base.cpp
+++ b/src/factor/factor_base.cpp
@@ -131,20 +131,11 @@ void FactorBase::setStatus(FactorStatus _status)
     status_ = _status;
 }
 
-void FactorBase::setApplyLossFunction(const bool _apply)
-{
-    if (apply_loss_function_ != _apply)
-    {
-        if (getProblem() == nullptr)
-            std::cout << "factor not linked with Problem, apply loss function change not notified" << std::endl;
-        else
-        {
-            FactorBasePtr this_c = shared_from_this();
-            getProblem()->removeFactor(this_c);
-            getProblem()->addFactor(this_c);
-        }
-    }
-}
+//void FactorBase::setApplyLossFunction(const bool _apply)
+//{
+//    apply_loss_function_ = _apply;
+//}
+
 void FactorBase::link(FeatureBasePtr _ftr_ptr)
 {
     if (this->getFeature() != _ftr_ptr)
-- 
GitLab