Minotaur 0.4.1
Docs for developers
Public Types | Public Member Functions | List of all members
Minotaur::McCormick Class Reference

#include <CxQuadHandler.h>

Public Types

enum  Sense { LT , GT , EQ }
 LT: x0x1 <= y; GT: x0x1 >= y; EQ: x0x1 = y.
 

Public Member Functions

 McCormick (VariablePtr x0, VariablePtr x1, Sense sense)
 Default constructor.
 
 ~McCormick ()
 Destroy.
 
void setAux (VariablePtr y)
 
void setC0 (ConstraintPtr c)
 Set the zeroth constraint: $ y \geq l_0x_1 + l_1x_0 - l_1l_0 $.
 
void setC1 (ConstraintPtr c)
 Set the first constraint: $ y \geq u_0x_1 + u_1x_0 - u_1u_0 $.
 
void setC2 (ConstraintPtr c)
 Set the third constrait: $ y \leq u_1x_0 + l_0x_1 - l_0u_1 $.
 
void setC3 (ConstraintPtr c)
 Set the third constrait: $ y \leq l_1x_0 + u_0x_1 - l_1u_0 $.
 
ConstraintPtr getC0 ()
 Get one of the four constraints.
 
ConstraintPtr getC1 ()
 
ConstraintPtr getC2 ()
 
ConstraintPtr getC3 ()
 
VariablePtr getAux ()
 Get the auxiliary variable.
 
VariablePtr getX0 ()
 Get $x_0$.
 
VariablePtr getX1 ()
 Get $x_1$.
 
VariablePtr getOtherX (ConstVariablePtr x) const
 Get the variable other than x, in the product.
 
Sense getSense ()
 Get the sense of the bilinear constraint: LT, EQ, GT.
 
void setSense (Sense sense)
 Set the sense of the bilinear constraint: LT, EQ, GT.
 
bool isViolated (const double *x, const double &tol) const
 Check if a bilinear constraint is violated at the current point x.
 
bool isViolated (const double &x0val, const double &x1val, const double &y0val, const double &tol) const
 

Detailed Description

A McCormick object stores some information about McCormick inequalities for the constraints of the form $x_0x_1 \leq y$ or $x_0x_1 \geq y $ or $x_0x_1 = y$.

Member Function Documentation

◆ isViolated()

bool McCormick::isViolated ( const double &  x0val,
const double &  x1val,
const double &  y0val,
const double &  tol 
) const

Check if a bilinear constraint is violated for the given values of $x_0, x_1, y$.

◆ setAux()

void Minotaur::McCormick::setAux ( VariablePtr  y)
inline

Set the auxiliary variable. If a bilinear term repeats itself, all such terms must share the same auxiliary variable.


The documentation for this class was generated from the following files:

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025