Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method FreezeVariableUpperBound ( 
 | 
  MPVariable var, 
 | 
  Real upperbound, 
 | 
  Boolean isfreezewithslack 
 | 
) const 
 | 
{ 
 | 
  Description: 'Set upper bound of the variable, with scaling factor influence' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // soh yee Mar-15-2015 (created) 
 | 
     
 | 
    upperbound := this.ScaleVariable( var, upperbound );   // scale the upper bound 
 | 
     
 | 
    // (12110) Haikal Pribadi 
 | 
    // Freeze small values (1e-6) to zero, but give a warning for us to eventually debug when we can reproduce 
 | 
    cplexaccuracy := this.SmallestFeasibilityTolerance();  
 | 
    if( abs( upperbound ) <= cplexaccuracy ) 
 | 
    { 
 | 
      if( 0.0 < abs( upperbound ) ) 
 | 
      { 
 | 
        info( "WARNING: Variable '", var.Name(), "' has encountered an upper bound value <= ", cplexaccuracy,", rounding to 0.0" ); 
 | 
      } 
 | 
      upperbound := 0.0; 
 | 
    } 
 | 
     
 | 
    // If this is optimizer output, we have to add a small epsilon to prevent infeasibilities 
 | 
    if( isfreezewithslack ) 
 | 
    { 
 | 
      upperbound := upperbound + 1e-4; 
 | 
    } 
 | 
     
 | 
    var.UpperBound( upperbound ); 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |