MCPcopy Create free account
hub / github.com/NeuralNetworkVerification/Marabou / encodeEquation

Method encodeEquation

src/engine/MILPEncoder.cpp:128–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void MILPEncoder::encodeEquation( GurobiWrapper &gurobi, const Equation &equation )
129{
130 List<GurobiWrapper::Term> terms;
131 double scalar = equation._scalar;
132 for ( const auto &term : equation._addends )
133 terms.append( GurobiWrapper::Term( term._coefficient, Stringf( "x%u", term._variable ) ) );
134 switch ( equation._type )
135 {
136 case Equation::EQ:
137 gurobi.addEqConstraint( terms, scalar );
138 break;
139 case Equation::LE:
140 gurobi.addLeqConstraint( terms, scalar );
141 break;
142 case Equation::GE:
143 gurobi.addGeqConstraint( terms, scalar );
144 break;
145 default:
146 break;
147 }
148}
149
150void MILPEncoder::encodeReLUConstraint( GurobiWrapper &gurobi, ReluConstraint *relu, bool relax )
151{

Callers

nothing calls this directly

Calls 6

StringfClass · 0.85
TermClass · 0.50
appendMethod · 0.45
addEqConstraintMethod · 0.45
addLeqConstraintMethod · 0.45
addGeqConstraintMethod · 0.45

Tested by

no test coverage detected