identifyLeavingConstraint
							parent
							
								
									9ca2ba9b66
								
							
						
					
					
						commit
						4871202664
					
				|  | @ -243,7 +243,7 @@ GaussianFactorGraph QPSolver::buildDualGraph(const GaussianFactorGraph& graph, | |||
| } | ||||
| 
 | ||||
| //******************************************************************************
 | ||||
| pair<int, int> QPSolver::findWorstViolatedActiveIneq( | ||||
| pair<int, int> 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; | ||||
|  |  | |||
|  | @ -115,7 +115,7 @@ public: | |||
|    * And we want to remove the worst one with the largest lambda from the active set. | ||||
|    * | ||||
|    */ | ||||
|   std::pair<int, int> findWorstViolatedActiveIneq( | ||||
|   std::pair<int, int> identifyLeavingConstraint( | ||||
|       const VectorValues& lambdas) const; | ||||
| 
 | ||||
|   /**
 | ||||
|  |  | |||
|  | @ -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); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue