@@ -345,7 +345,7 @@ protected boolean initialise(final Result kickStarter) {
345
345
}
346
346
347
347
if (state .isFeasible ()) {
348
- this .resetActivator ();
348
+ this .resetActivator (! options . convex (). isExtendedPrecision () );
349
349
} else {
350
350
this .getSolutionX ().fillAll (ZERO );
351
351
}
@@ -400,8 +400,8 @@ protected boolean needsAnotherIteration() {
400
400
}
401
401
402
402
/**
403
- * Find the minimum (largest negative) lagrange multiplier - for the active inequalities - to
404
- * potentially deactivate.
403
+ * Find the minimum (largest negative) lagrange multiplier - for the active inequalities - to potentially
404
+ * deactivate.
405
405
*/
406
406
protected int suggestConstraintToExclude () {
407
407
@@ -468,8 +468,7 @@ protected int suggestConstraintToExclude() {
468
468
469
469
/**
470
470
* Find minimum (largest negative) slack - for the inactive inequalities - to potentially activate.
471
- * Negative slack means the constraint is violated. Need to make sure it is enforced by activating
472
- * it.
471
+ * Negative slack means the constraint is violated. Need to make sure it is enforced by activating it.
473
472
*/
474
473
protected int suggestConstraintToInclude () {
475
474
return this .getConstraintToInclude ();
@@ -652,35 +651,38 @@ void handleIterationResults(final boolean solved, final R064Store iterX, final i
652
651
653
652
}
654
653
655
- void resetActivator () {
654
+ void resetActivator (final boolean activate ) {
656
655
657
656
myActivator .excludeAll ();
658
657
myExcluded = null ;
659
658
myIncluded = null ;
660
659
661
- int nbInes = this .countInequalityConstraints ();
662
- int nbEqus = this .countEqualityConstraints ();
663
- int nbVars = this .countVariables ();
660
+ if (activate ) {
664
661
665
- int maxToInclude = nbVars - nbEqus ;
662
+ int nbInes = this .countInequalityConstraints ();
663
+ int nbEqus = this .countEqualityConstraints ();
664
+ int nbVars = this .countVariables ();
666
665
667
- if (this .isLogDebug () && maxToInclude < 0 ) {
668
- this .log ("Redundant contraints!" );
669
- }
666
+ int maxToInclude = nbVars - nbEqus ;
670
667
671
- if (nbInes > 0 && maxToInclude > 0 ) {
668
+ if (this .isLogDebug () && maxToInclude < 0 ) {
669
+ this .log ("Redundant contraints!" );
670
+ }
672
671
673
- MatrixStore < Double > ineqSlack = this . getSlackI ();
672
+ if ( nbInes > 0 && maxToInclude > 0 ) {
674
673
675
- for ( int i = 0 ; i < nbInes ; i ++) {
674
+ MatrixStore < Double > ineqSlack = this . getSlackI ();
676
675
677
- double slack = ineqSlack . doubleValue ( i );
676
+ for ( int i = 0 ; i < nbInes ; i ++) {
678
677
679
- if (slack >= ZERO && ACC .isZero (slack ) && this .countIncluded () < maxToInclude ) {
680
- if (this .isLogDebug ()) {
681
- this .log ("Will inlcude ineq {} with slack={}" , i , slack );
678
+ double slack = ineqSlack .doubleValue (i );
679
+
680
+ if (slack >= ZERO && ACC .isZero (slack ) && this .countIncluded () < maxToInclude ) {
681
+ if (this .isLogDebug ()) {
682
+ this .log ("Will inlcude ineq {} with slack={}" , i , slack );
683
+ }
684
+ this .include (i );
682
685
}
683
- this .include (i );
684
686
}
685
687
}
686
688
}
0 commit comments