| 126 | } |
| 127 | |
| 128 | void 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 | |
| 150 | void MILPEncoder::encodeReLUConstraint( GurobiWrapper &gurobi, ReluConstraint *relu, bool relax ) |
| 151 | { |
nothing calls this directly
no test coverage detected