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

Method printDiff

gecode/flatzinc/flatzinc.cpp:2863–2912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2861 }
2862
2863 void
2864 Printer::printDiff(std::ostream& out,
2865 const Gecode::IntVarArray& iv1,
2866 const Gecode::IntVarArray& iv2,
2867 const Gecode::BoolVarArray& bv1,
2868 const Gecode::BoolVarArray& bv2
2869#ifdef GECODE_HAS_SET_VARS
2870 ,
2871 const Gecode::SetVarArray& sv1,
2872 const Gecode::SetVarArray& sv2
2873#endif
2874#ifdef GECODE_HAS_FLOAT_VARS
2875 ,
2876 const Gecode::FloatVarArray& fv1,
2877 const Gecode::FloatVarArray& fv2
2878#endif
2879 ) const {
2880 if (_output == nullptr)
2881 return;
2882 for (unsigned int i=0; i< _output->a.size(); i++) {
2883 AST::Node* ai = _output->a[i];
2884 if (ai->isArray()) {
2885 AST::Array* aia = ai->getArray();
2886 int size = aia->a.size();
2887 out << "[";
2888 for (int j=0; j<size; j++) {
2889 printElemDiff(out,aia->a[j],iv1,iv2,bv1,bv2
2890#ifdef GECODE_HAS_SET_VARS
2891 ,sv1,sv2
2892#endif
2893#ifdef GECODE_HAS_FLOAT_VARS
2894 ,fv1,fv2
2895#endif
2896 );
2897 if (j<size-1)
2898 out << ", ";
2899 }
2900 out << "]";
2901 } else {
2902 printElemDiff(out,ai,iv1,iv2,bv1,bv2
2903#ifdef GECODE_HAS_SET_VARS
2904 ,sv1,sv2
2905#endif
2906#ifdef GECODE_HAS_FLOAT_VARS
2907 ,fv1,fv2
2908#endif
2909 );
2910 }
2911 }
2912 }
2913
2914 void
2915 Printer::addIntVarName(const std::string& n) {

Callers 1

compareMethod · 0.80

Calls 3

isArrayMethod · 0.80
getArrayMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected