diff --git a/gtsam_unstable/linear/QPSolver.cpp b/gtsam_unstable/linear/QPSolver.cpp index 377676a68..e951deb5e 100644 --- a/gtsam_unstable/linear/QPSolver.cpp +++ b/gtsam_unstable/linear/QPSolver.cpp @@ -243,7 +243,7 @@ GaussianFactorGraph QPSolver::buildDualGraph(const GaussianFactorGraph& graph, } //****************************************************************************** -pair QPSolver::findWorstViolatedActiveIneq( +pair QPSolver::identifyLeavingConstraint( const VectorValues& lambdas) const { int worstFactorIx = -1, worstSigmaIx = -1; // preset the maxLambda to 0.0: if lambda is <= 0.0, the constraint is either @@ -371,7 +371,7 @@ bool QPSolver::iterateInPlace(GaussianFactorGraph& workingGraph, lambdas.print("lambdas :"); int factorIx, sigmaIx; - boost::tie(factorIx, sigmaIx) = findWorstViolatedActiveIneq(lambdas); + boost::tie(factorIx, sigmaIx) = identifyLeavingConstraint(lambdas); if (debug) cout << "violated active ineq - factorIx, sigmaIx: " << factorIx << " " << sigmaIx << endl; diff --git a/gtsam_unstable/linear/QPSolver.h b/gtsam_unstable/linear/QPSolver.h index 8e9b7de76..196eeadc3 100644 --- a/gtsam_unstable/linear/QPSolver.h +++ b/gtsam_unstable/linear/QPSolver.h @@ -115,7 +115,7 @@ public: * And we want to remove the worst one with the largest lambda from the active set. * */ - std::pair findWorstViolatedActiveIneq( + std::pair identifyLeavingConstraint( const VectorValues& lambdas) const; /** diff --git a/gtsam_unstable/linear/tests/testQPSolver.cpp b/gtsam_unstable/linear/tests/testQPSolver.cpp index ec7edac60..d34a5aff6 100644 --- a/gtsam_unstable/linear/tests/testQPSolver.cpp +++ b/gtsam_unstable/linear/tests/testQPSolver.cpp @@ -77,14 +77,14 @@ TEST(QPSolver, constraintsAux) { VectorValues lambdas; lambdas.insert(constraintIx[0], (Vector(4) << -0.5, 0.0, 0.3, 0.1)); int factorIx, lambdaIx; - boost::tie(factorIx, lambdaIx) = solver.findWorstViolatedActiveIneq(lambdas); + boost::tie(factorIx, lambdaIx) = solver.identifyLeavingConstraint(lambdas); LONGS_EQUAL(1, factorIx); LONGS_EQUAL(2, lambdaIx); VectorValues lambdas2; lambdas2.insert(constraintIx[0], (Vector(4) << -0.5, 0.0, -0.3, -0.1)); int factorIx2, lambdaIx2; - boost::tie(factorIx2, lambdaIx2) = solver.findWorstViolatedActiveIneq( + boost::tie(factorIx2, lambdaIx2) = solver.identifyLeavingConstraint( lambdas2); LONGS_EQUAL(-1, factorIx2); LONGS_EQUAL(-1, lambdaIx2);