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

Method encodeCostFunction

src/engine/MILPEncoder.cpp:758–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756}
757
758void MILPEncoder::encodeCostFunction( GurobiWrapper &gurobi, const LinearExpression &cost )
759{
760 List<GurobiWrapper::Term> terms;
761 for ( const auto &pair : cost._addends )
762 {
763 terms.append( GurobiWrapper::Term( pair.second, Stringf( "x%u", pair.first ) ) );
764 }
765 gurobi.setCost( terms, cost._constant );
766}

Callers 1

Calls 4

StringfClass · 0.85
TermClass · 0.50
appendMethod · 0.45
setCostMethod · 0.45

Tested by

no test coverage detected