MCPcopy Create free account
hub / github.com/Gecode/gecode / postConstraints

Method postConstraints

gecode/flatzinc/flatzinc.cpp:1013–1030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1011 }
1012
1013 void
1014 FlatZincSpace::postConstraints(std::vector<ConExpr*>& ces) {
1015 ConExprOrder ceo;
1016 std::sort(ces.begin(), ces.end(), ceo);
1017
1018 for (unsigned int i=0; i<ces.size(); i++) {
1019 const ConExpr& ce = *ces[i];
1020 try {
1021 registry().post(*this, ce);
1022 } catch (Gecode::Exception& e) {
1023 throw FlatZinc::Error("Gecode", e.what(), ce.ann);
1024 } catch (AST::TypeError& e) {
1025 throw FlatZinc::Error("Type error", e.what(), ce.ann);
1026 }
1027 delete ces[i];
1028 ces[i] = nullptr;
1029 }
1030 }
1031
1032 void flattenAnnotations(AST::Array* ann, std::vector<AST::Node*>& out) {
1033 for (unsigned int i=0; i<ann->a.size(); i++) {

Callers 1

initfgFunction · 0.80

Calls 7

sortFunction · 0.85
ErrorFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
postMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected