345 lines
65 KiB
XML
345 lines
65 KiB
XML
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||
|
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.6">
|
||
|
<compounddef id="gcc_2dom_8hpp" kind="file">
|
||
|
<compoundname>dom.hpp</compoundname>
|
||
|
<includedby refid="gcc_8hh" local="no">/usr/include/gecode/int/gcc.hh</includedby>
|
||
|
<invincdepgraph>
|
||
|
<node id="11300">
|
||
|
<label>/usr/include/gecode/int/gcc.hh</label>
|
||
|
<link refid="gcc_8hh_source"/>
|
||
|
</node>
|
||
|
<node id="11299">
|
||
|
<label>/usr/include/gecode/int/gcc/dom.hpp</label>
|
||
|
<link refid="gcc/dom.hpp"/>
|
||
|
<childnode refid="11300" relation="include">
|
||
|
</childnode>
|
||
|
</node>
|
||
|
</invincdepgraph>
|
||
|
<innernamespace refid="namespaceGecode">Gecode</innernamespace>
|
||
|
<innernamespace refid="namespaceGecode_1_1Int">Gecode::Int</innernamespace>
|
||
|
<innernamespace refid="namespaceGecode_1_1Int_1_1GCC">Gecode::Int::GCC</innernamespace>
|
||
|
<briefdescription>
|
||
|
</briefdescription>
|
||
|
<detaileddescription>
|
||
|
</detaileddescription>
|
||
|
<programlisting>
|
||
|
<codeline lineno="1"><highlight class="comment">/*<sp/>-*-<sp/>mode:<sp/>C++;<sp/>c-basic-offset:<sp/>2;<sp/>indent-tabs-mode:<sp/>nil<sp/>-*-<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="comment">/*</highlight></codeline>
|
||
|
<codeline lineno="3"><highlight class="comment"><sp/>*<sp/><sp/>Main<sp/>authors:</highlight></codeline>
|
||
|
<codeline lineno="4"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>Patrick<sp/>Pekczynski<sp/><pekczynski@ps.uni-sb.de></highlight></codeline>
|
||
|
<codeline lineno="5"><highlight class="comment"><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="6"><highlight class="comment"><sp/>*<sp/><sp/>Contributing<sp/>authors:</highlight></codeline>
|
||
|
<codeline lineno="7"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>Christian<sp/>Schulte<sp/><schulte@gecode.org></highlight></codeline>
|
||
|
<codeline lineno="8"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>Guido<sp/>Tack<sp/><tack@gecode.org></highlight></codeline>
|
||
|
<codeline lineno="9"><highlight class="comment"><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="10"><highlight class="comment"><sp/>*<sp/><sp/>Copyright:</highlight></codeline>
|
||
|
<codeline lineno="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>Patrick<sp/>Pekczynski,<sp/>2004</highlight></codeline>
|
||
|
<codeline lineno="12"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>Christian<sp/>Schulte,<sp/>2009</highlight></codeline>
|
||
|
<codeline lineno="13"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>Guido<sp/>Tack,<sp/>2009</highlight></codeline>
|
||
|
<codeline lineno="14"><highlight class="comment"><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="15"><highlight class="comment"><sp/>*<sp/><sp/>Last<sp/>modified:</highlight></codeline>
|
||
|
<codeline lineno="16"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>$Date:<sp/>2012-09-07<sp/>17:31:22<sp/>+0200<sp/>(Fri,<sp/>07<sp/>Sep<sp/>2012)<sp/>$<sp/>by<sp/>$Author:<sp/>schulte<sp/>$</highlight></codeline>
|
||
|
<codeline lineno="17"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>$Revision:<sp/>13068<sp/>$</highlight></codeline>
|
||
|
<codeline lineno="18"><highlight class="comment"><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="19"><highlight class="comment"><sp/>*<sp/><sp/>This<sp/>file<sp/>is<sp/>part<sp/>of<sp/>Gecode,<sp/>the<sp/>generic<sp/>constraint</highlight></codeline>
|
||
|
<codeline lineno="20"><highlight class="comment"><sp/>*<sp/><sp/>development<sp/>environment:</highlight></codeline>
|
||
|
<codeline lineno="21"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>http://www.gecode.org</highlight></codeline>
|
||
|
<codeline lineno="22"><highlight class="comment"><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="23"><highlight class="comment"><sp/>*<sp/><sp/>Permission<sp/>is<sp/>hereby<sp/>granted,<sp/>free<sp/>of<sp/>charge,<sp/>to<sp/>any<sp/>person<sp/>obtaining</highlight></codeline>
|
||
|
<codeline lineno="24"><highlight class="comment"><sp/>*<sp/><sp/>a<sp/>copy<sp/>of<sp/>this<sp/>software<sp/>and<sp/>associated<sp/>documentation<sp/>files<sp/>(the</highlight></codeline>
|
||
|
<codeline lineno="25"><highlight class="comment"><sp/>*<sp/><sp/>"Software"),<sp/>to<sp/>deal<sp/>in<sp/>the<sp/>Software<sp/>without<sp/>restriction,<sp/>including</highlight></codeline>
|
||
|
<codeline lineno="26"><highlight class="comment"><sp/>*<sp/><sp/>without<sp/>limitation<sp/>the<sp/>rights<sp/>to<sp/>use,<sp/>copy,<sp/>modify,<sp/>merge,<sp/>publish,</highlight></codeline>
|
||
|
<codeline lineno="27"><highlight class="comment"><sp/>*<sp/><sp/>distribute,<sp/>sublicense,<sp/>and/or<sp/>sell<sp/>copies<sp/>of<sp/>the<sp/>Software,<sp/>and<sp/>to</highlight></codeline>
|
||
|
<codeline lineno="28"><highlight class="comment"><sp/>*<sp/><sp/>permit<sp/>persons<sp/>to<sp/>whom<sp/>the<sp/>Software<sp/>is<sp/>furnished<sp/>to<sp/>do<sp/>so,<sp/>subject<sp/>to</highlight></codeline>
|
||
|
<codeline lineno="29"><highlight class="comment"><sp/>*<sp/><sp/>the<sp/>following<sp/>conditions:</highlight></codeline>
|
||
|
<codeline lineno="30"><highlight class="comment"><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="31"><highlight class="comment"><sp/>*<sp/><sp/>The<sp/>above<sp/>copyright<sp/>notice<sp/>and<sp/>this<sp/>permission<sp/>notice<sp/>shall<sp/>be</highlight></codeline>
|
||
|
<codeline lineno="32"><highlight class="comment"><sp/>*<sp/><sp/>included<sp/>in<sp/>all<sp/>copies<sp/>or<sp/>substantial<sp/>portions<sp/>of<sp/>the<sp/>Software.</highlight></codeline>
|
||
|
<codeline lineno="33"><highlight class="comment"><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="34"><highlight class="comment"><sp/>*<sp/><sp/>THE<sp/>SOFTWARE<sp/>IS<sp/>PROVIDED<sp/>"AS<sp/>IS",<sp/>WITHOUT<sp/>WARRANTY<sp/>OF<sp/>ANY<sp/>KIND,</highlight></codeline>
|
||
|
<codeline lineno="35"><highlight class="comment"><sp/>*<sp/><sp/>EXPRESS<sp/>OR<sp/>IMPLIED,<sp/>INCLUDING<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO<sp/>THE<sp/>WARRANTIES<sp/>OF</highlight></codeline>
|
||
|
<codeline lineno="36"><highlight class="comment"><sp/>*<sp/><sp/>MERCHANTABILITY,<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>AND</highlight></codeline>
|
||
|
<codeline lineno="37"><highlight class="comment"><sp/>*<sp/><sp/>NONINFRINGEMENT.<sp/>IN<sp/>NO<sp/>EVENT<sp/>SHALL<sp/>THE<sp/>AUTHORS<sp/>OR<sp/>COPYRIGHT<sp/>HOLDERS<sp/>BE</highlight></codeline>
|
||
|
<codeline lineno="38"><highlight class="comment"><sp/>*<sp/><sp/>LIABLE<sp/>FOR<sp/>ANY<sp/>CLAIM,<sp/>DAMAGES<sp/>OR<sp/>OTHER<sp/>LIABILITY,<sp/>WHETHER<sp/>IN<sp/>AN<sp/>ACTION</highlight></codeline>
|
||
|
<codeline lineno="39"><highlight class="comment"><sp/>*<sp/><sp/>OF<sp/>CONTRACT,<sp/>TORT<sp/>OR<sp/>OTHERWISE,<sp/>ARISING<sp/>FROM,<sp/>OUT<sp/>OF<sp/>OR<sp/>IN<sp/>CONNECTION</highlight></codeline>
|
||
|
<codeline lineno="40"><highlight class="comment"><sp/>*<sp/><sp/>WITH<sp/>THE<sp/>SOFTWARE<sp/>OR<sp/>THE<sp/>USE<sp/>OR<sp/>OTHER<sp/>DEALINGS<sp/>IN<sp/>THE<sp/>SOFTWARE.</highlight></codeline>
|
||
|
<codeline lineno="41"><highlight class="comment"><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="42"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="43"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="44"><highlight class="normal"></highlight><highlight class="keyword">namespace<sp/></highlight><highlight class="normal">Gecode<sp/>{<sp/></highlight><highlight class="keyword">namespace<sp/></highlight><highlight class="normal">Int<sp/>{<sp/></highlight><highlight class="keyword">namespace<sp/></highlight><highlight class="normal">GCC<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="45"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="46"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*</highlight></codeline>
|
||
|
<codeline lineno="47"><highlight class="comment"><sp/><sp/><sp/>*<sp/>Analogously<sp/>to<sp/>"gcc/bnd.hpp"<sp/>we<sp/>split<sp/>the<sp/>algorithm</highlight></codeline>
|
||
|
<codeline lineno="48"><highlight class="comment"><sp/><sp/><sp/>*<sp/>in<sp/>two<sp/>parts:</highlight></codeline>
|
||
|
<codeline lineno="49"><highlight class="comment"><sp/><sp/><sp/>*<sp/><sp/><sp/>1)<sp/>the<sp/>UBC<sp/>(Upper<sp/>Bound<sp/>Constraint)<sp/>stating<sp/>that<sp/>there<sp/>are</highlight></codeline>
|
||
|
<codeline lineno="50"><highlight class="comment"><sp/><sp/><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>at<sp/>most<sp/>k[i].max()<sp/>occurences<sp/>of<sp/>the<sp/>value<sp/>v_i</highlight></codeline>
|
||
|
<codeline lineno="51"><highlight class="comment"><sp/><sp/><sp/>*<sp/><sp/><sp/>2)<sp/>the<sp/>LBC<sp/>(Lower<sp/>Bound<sp/>Constraint)<sp/>stating<sp/>that<sp/>there<sp/>are</highlight></codeline>
|
||
|
<codeline lineno="52"><highlight class="comment"><sp/><sp/><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/>at<sp/>least<sp/>k[i].min()<sp/>occurences<sp/>of<sp/>the<sp/>value<sp/>v_i</highlight></codeline>
|
||
|
<codeline lineno="53"><highlight class="comment"><sp/><sp/><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="54"><highlight class="comment"><sp/><sp/><sp/>*<sp/>The<sp/>algorithm<sp/>proceeds<sp/>in<sp/>5<sp/>STEPS:</highlight></codeline>
|
||
|
<codeline lineno="55"><highlight class="comment"><sp/><sp/><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="56"><highlight class="comment"><sp/><sp/><sp/>*<sp/>STEP<sp/>1:</highlight></codeline>
|
||
|
<codeline lineno="57"><highlight class="comment"><sp/><sp/><sp/>*<sp/><sp/><sp/><sp/>Build<sp/>the<sp/>bipartite<sp/>value-graph<sp/>G=(<X,D>,E),</highlight></codeline>
|
||
|
<codeline lineno="58"><highlight class="comment"><sp/><sp/><sp/>*<sp/><sp/><sp/><sp/>with<sp/>X<sp/>=<sp/>all<sp/>variable<sp/>nodes<sp/>(each<sp/>variable<sp/>forms<sp/>a<sp/>node)</highlight></codeline>
|
||
|
<codeline lineno="59"><highlight class="comment"><sp/><sp/><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>D<sp/>=<sp/>all<sp/>value<sp/>nodes<sp/>(union<sp/>over<sp/>all<sp/>domains<sp/>of<sp/>the<sp/>variables)</highlight></codeline>
|
||
|
<codeline lineno="60"><highlight class="comment"><sp/><sp/><sp/>*<sp/><sp/><sp/><sp/>and<sp/>(x_i,v)<sp/>is<sp/>an<sp/>edge<sp/>in<sp/>G<sp/>iff<sp/>value<sp/>v<sp/>is<sp/>in<sp/>the<sp/>domain<sp/>D_i<sp/>of<sp/>x_i</highlight></codeline>
|
||
|
<codeline lineno="61"><highlight class="comment"><sp/><sp/><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="62"><highlight class="comment"><sp/><sp/><sp/>*<sp/>STEP<sp/>2:<sp/><sp/><sp/>Compute<sp/>a<sp/>matching<sp/>in<sp/>the<sp/>value<sp/>graph.</highlight></codeline>
|
||
|
<codeline lineno="63"><highlight class="comment"><sp/><sp/><sp/>*<sp/>STEP<sp/>3:<sp/><sp/><sp/>Compute<sp/>all<sp/>even<sp/>alternating<sp/>paths<sp/>from<sp/>unmatched<sp/><sp/>nodes</highlight></codeline>
|
||
|
<codeline lineno="64"><highlight class="comment"><sp/><sp/><sp/>*<sp/>STEP<sp/>4:<sp/><sp/><sp/>Compute<sp/>strongly<sp/>connected<sp/>components<sp/>in<sp/>the<sp/>merged<sp/>graph</highlight></codeline>
|
||
|
<codeline lineno="65"><highlight class="comment"><sp/><sp/><sp/>*<sp/>STEP<sp/>5:<sp/><sp/><sp/>Update<sp/>the<sp/>Domains<sp/>according<sp/>to<sp/>the<sp/>computed<sp/>edges</highlight></codeline>
|
||
|
<codeline lineno="66"><highlight class="comment"><sp/><sp/><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="67"><highlight class="comment"><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="68"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="69"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>Card></highlight></codeline>
|
||
|
<codeline lineno="70"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="71" refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a17d8dba1730d2911a115229e6f256f9c" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a1df7bc5e84461de8b34afa35c5a35832" kindref="member">Dom<Card>::Dom</ref>(<ref refid="classGecode_1_1Home" kindref="compound">Home</ref><sp/>home,<sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<IntView></ref>&<sp/>x0,</highlight></codeline>
|
||
|
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<Card></ref>&<sp/>k0,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>cf)</highlight></codeline>
|
||
|
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/>:<sp/><ref refid="classGecode_1_1Propagator" kindref="compound">Propagator</ref>(home),<sp/>x(x0),<sp/><sp/>y(home,<sp/>x0),</highlight></codeline>
|
||
|
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>k(k0),<sp/>vvg(NULL),<sp/>card_fixed(cf){</highlight></codeline>
|
||
|
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>y<sp/>is<sp/>used<sp/>for<sp/>bounds<sp/>propagation<sp/>since<sp/>prop_bnd<sp/>needs<sp/>all<sp/>variables</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>values<sp/>within<sp/>the<sp/>domain<sp/>bounds</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a9f19b5b2c6a170739195d5446c9e5c99" kindref="member">x</ref>.<ref refid="classGecode_1_1ViewArray_1aa19fdfd766538312ff91e49735abec86" kindref="member">subscribe</ref>(home,<sp/>*</highlight><highlight class="keyword">this</highlight><highlight class="normal">,<sp/>PC_INT_DOM);</highlight></codeline>
|
||
|
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1ac1d06d6c8b09bb6305ad9bfed16f69eb" kindref="member">k</ref>.<ref refid="classGecode_1_1ViewArray_1aa19fdfd766538312ff91e49735abec86" kindref="member">subscribe</ref>(home,<sp/>*</highlight><highlight class="keyword">this</highlight><highlight class="normal">,<sp/>PC_INT_DOM);</highlight></codeline>
|
||
|
<codeline lineno="79"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="80"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="81"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>Card></highlight></codeline>
|
||
|
<codeline lineno="82"><highlight class="normal"><sp/><sp/>forceinline</highlight></codeline>
|
||
|
<codeline lineno="83" refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a1df7bc5e84461de8b34afa35c5a35832" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a1df7bc5e84461de8b34afa35c5a35832" kindref="member">Dom<Card>::Dom</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>share,<sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom" kindref="compound">Dom<Card></ref>&<sp/>p)</highlight></codeline>
|
||
|
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/>:<sp/><ref refid="classGecode_1_1Propagator" kindref="compound">Propagator</ref>(home,<sp/>share,<sp/>p),<sp/>vvg(NULL),<sp/>card_fixed(p.card_fixed)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a9f19b5b2c6a170739195d5446c9e5c99" kindref="member">x</ref>.<ref refid="classGecode_1_1ViewArray_1afe55a31688f656ab0b114f2342e9e313" kindref="member">update</ref>(home,<sp/>share,<sp/>p.<ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a9f19b5b2c6a170739195d5446c9e5c99" kindref="member">x</ref>);</highlight></codeline>
|
||
|
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a7e87822931e09550c8907098b170335d" kindref="member">y</ref>.<ref refid="classGecode_1_1ViewArray_1afe55a31688f656ab0b114f2342e9e313" kindref="member">update</ref>(home,<sp/>share,<sp/>p.<ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a7e87822931e09550c8907098b170335d" kindref="member">y</ref>);</highlight></codeline>
|
||
|
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1ac1d06d6c8b09bb6305ad9bfed16f69eb" kindref="member">k</ref>.<ref refid="classGecode_1_1ViewArray_1afe55a31688f656ab0b114f2342e9e313" kindref="member">update</ref>(home,<sp/>share,<sp/>p.<ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1ac1d06d6c8b09bb6305ad9bfed16f69eb" kindref="member">k</ref>);</highlight></codeline>
|
||
|
<codeline lineno="88"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="89"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="90"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>Card></highlight></codeline>
|
||
|
<codeline lineno="91"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="92" refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a12211357d36aba0ad4978ea485350342" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a12211357d36aba0ad4978ea485350342" kindref="member">Dom<Card>::dispose</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/>x.cancel(home,*</highlight><highlight class="keyword">this</highlight><highlight class="normal">,<sp/>PC_INT_DOM);</highlight></codeline>
|
||
|
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/>k.cancel(home,*</highlight><highlight class="keyword">this</highlight><highlight class="normal">,<sp/>PC_INT_DOM);</highlight></codeline>
|
||
|
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/>(void)<sp/><ref refid="classGecode_1_1Actor_1a143253b3eceda40f36834e38c8ac05d9" kindref="member">Propagator::dispose</ref>(home);</highlight></codeline>
|
||
|
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(*this);</highlight></codeline>
|
||
|
<codeline lineno="97"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="98"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="99"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>Card></highlight></codeline>
|
||
|
<codeline lineno="100"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Actor" kindref="compound">Actor</ref>*</highlight></codeline>
|
||
|
<codeline lineno="101" refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a2ad009c0b2cb997efec26f62501eff95" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a2ad009c0b2cb997efec26f62501eff95" kindref="member">Dom<Card>::copy</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>share)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>(home)<sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom" kindref="compound">Dom<Card></ref>(home,<sp/>share,<sp/>*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
||
|
<codeline lineno="103"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="104"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="105"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>Card></highlight></codeline>
|
||
|
<codeline lineno="106"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1PropCost" kindref="compound">PropCost</ref></highlight></codeline>
|
||
|
<codeline lineno="107" refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a1b4bc0418faf80b611428d3bbe6982e6" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a1b4bc0418faf80b611428d3bbe6982e6" kindref="member">Dom<Card>::cost</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1a129e41c1d037528010d7b6706495a560" kindref="member">ModEventDelta</ref>&)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
||
|
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1PropCost_1abc295e19d623ac3a577bef5b83254a25" kindref="member">PropCost::cubic</ref>(<ref refid="classGecode_1_1PropCost_1ad1bebae59ea373495c5bf51ffc249dcda29f70a7d7f550f3822568ddce422d861" kindref="member">PropCost::LO</ref>,<sp/>x.size());</highlight></codeline>
|
||
|
<codeline lineno="109"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="110"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="111"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>Card></highlight></codeline>
|
||
|
<codeline lineno="112"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref></highlight></codeline>
|
||
|
<codeline lineno="113" refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a1fd91050ac96ff3beccbffd8c9da52f7" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1a1fd91050ac96ff3beccbffd8c9da52f7" kindref="member">Dom<Card>::propagate</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1a129e41c1d037528010d7b6706495a560" kindref="member">ModEventDelta</ref>&)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Region" kindref="compound">Region</ref><sp/>r(home);</highlight></codeline>
|
||
|
<codeline lineno="115"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*<sp/><ref refid="group__TaskModelIntCount_1ga1ed6f089699260b994a25197199337a4" kindref="member">count</ref><sp/>=<sp/>r.<ref refid="classGecode_1_1Region_1a167cff2d16f08d890fff11f80e519233" kindref="member">alloc</ref><</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">>(k.size());</highlight></codeline>
|
||
|
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>k.size();<sp/>i--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>count[i]<sp/>=<sp/>0;</highlight></codeline>
|
||
|
<codeline lineno="119"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>total<sp/>number<sp/>of<sp/>assigned<sp/>views</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>noa<sp/>=<sp/>0;</highlight></codeline>
|
||
|
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>y.size();<sp/>i--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(y[i].assigned())<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>noa++;</highlight></codeline>
|
||
|
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>idx;</highlight></codeline>
|
||
|
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<ref refid="namespaceGecode_1_1Int_1_1GCC_1a612204ff798bc68b0fc03c9135739d52" kindref="member">lookupValue</ref>(k,y[i].val(),idx))</highlight></codeline>
|
||
|
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>count[idx]++;</highlight></codeline>
|
||
|
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Card::propagate<sp/>&&<sp/>(k[idx].max()<sp/>==<sp/>0))</highlight></codeline>
|
||
|
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="132"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(noa<sp/>==<sp/>y.size())<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>All<sp/>views<sp/>are<sp/>assigned</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>k.size();<sp/>i--;<sp/>)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((k[i].min()<sp/>><sp/>count[i])<sp/>||<sp/>(count[i]<sp/>><sp/>k[i].max()))</highlight></codeline>
|
||
|
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>the<sp/>solution<sp/>contains<sp/>ci<sp/>occurences<sp/>of<sp/>value<sp/>k[i].card();</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Card::propagate)</highlight></codeline>
|
||
|
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ME_CHECK(k[i].eq(home,<sp/>count[i]));</highlight></codeline>
|
||
|
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>home.<ref refid="group__TaskActorStatus_1gafc19cbf71ed90a9e0b414b875103f4c7" kindref="member">ES_SUBSUMED</ref>(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
||
|
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="144"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>before<sp/>propagation<sp/>performs<sp/>inferences<sp/>on<sp/>cardinality<sp/>variables:</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Card::propagate)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(noa<sp/>><sp/>0)</highlight></codeline>
|
||
|
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>k.size();<sp/>i--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!k[i].assigned())<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ME_CHECK(k[i].lq(home,<sp/>y.size()<sp/>-<sp/>(noa<sp/>-<sp/>count[i])));</highlight></codeline>
|
||
|
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ME_CHECK(k[i].gq(home,<sp/>count[i]));</highlight></codeline>
|
||
|
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="153"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(prop_card<Card>(home,y,k));</highlight></codeline>
|
||
|
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!card_consistent<Card>(y,k))</highlight></codeline>
|
||
|
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="158"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x.size()<sp/>==<sp/>0)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j<sp/>=<sp/>k.size();<sp/>j--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((k[j].min()<sp/>><sp/>k[j].counter())<sp/>||<sp/>(k[j].max()<sp/><<sp/>k[j].counter()))</highlight></codeline>
|
||
|
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>home.<ref refid="group__TaskActorStatus_1gafc19cbf71ed90a9e0b414b875103f4c7" kindref="member">ES_SUBSUMED</ref>(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
||
|
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((x.size()<sp/>==<sp/>1)<sp/>&&<sp/>(x[0].assigned()))<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>idx;</highlight></codeline>
|
||
|
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<ref refid="namespaceGecode_1_1Int_1_1GCC_1a612204ff798bc68b0fc03c9135739d52" kindref="member">lookupValue</ref>(k,x[0].val(),idx))</highlight></codeline>
|
||
|
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ME_CHECK(k[idx].inc());</highlight></codeline>
|
||
|
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j<sp/>=<sp/>k.size();<sp/>j--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((k[j].min()<sp/>><sp/>k[j].counter())<sp/>||<sp/>(k[j].max()<sp/><<sp/>k[j].counter()))</highlight></codeline>
|
||
|
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>home.<ref refid="group__TaskActorStatus_1gafc19cbf71ed90a9e0b414b875103f4c7" kindref="member">ES_SUBSUMED</ref>(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
||
|
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="174"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(vvg<sp/>==<sp/>NULL)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>smin<sp/>=<sp/>0;</highlight></codeline>
|
||
|
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>smax<sp/>=<sp/>0;</highlight></codeline>
|
||
|
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=k.size();<sp/>i--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(k[i].counter()<sp/>><sp/>k[i].max()<sp/>)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
||
|
<codeline lineno="182"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>smax<sp/>+=<sp/>(k[i].max()<sp/>-<sp/>k[i].counter());</highlight></codeline>
|
||
|
<codeline lineno="183"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(k[i].counter()<sp/><<sp/>k[i].min())</highlight></codeline>
|
||
|
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>smin<sp/>+=<sp/>(k[i].min()<sp/>-<sp/>k[i].counter());</highlight></codeline>
|
||
|
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="186"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="187"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((x.size()<sp/><<sp/>smin)<sp/>||<sp/>(smax<sp/><<sp/>x.size()))</highlight></codeline>
|
||
|
<codeline lineno="188"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="189"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="190"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>vvg<sp/>=<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>(home)<sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1VarValGraph" kindref="compound">VarValGraph<Card></ref>(home,<sp/>x,<sp/>k,<sp/>smin,<sp/>smax);</highlight></codeline>
|
||
|
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(vvg->min_require(home,x,k));</highlight></codeline>
|
||
|
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(vvg->template<sp/>maximum_matching<UBC>(home));</highlight></codeline>
|
||
|
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!card_fixed)</highlight></codeline>
|
||
|
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(vvg->template<sp/>maximum_matching<LBC>(home));</highlight></codeline>
|
||
|
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
||
|
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(vvg->sync(home,x,k));</highlight></codeline>
|
||
|
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="198"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/>vvg->template<sp/>free_alternating_paths<UBC>(home);</highlight></codeline>
|
||
|
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/>vvg->template<sp/>strongly_connected_components<UBC>(home);</highlight></codeline>
|
||
|
<codeline lineno="201"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(vvg->template<sp/>narrow<UBC>(home,x,k));</highlight></codeline>
|
||
|
<codeline lineno="203"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!card_fixed)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Card::propagate)</highlight></codeline>
|
||
|
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(vvg->sync(home,x,k));</highlight></codeline>
|
||
|
<codeline lineno="207"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>vvg->template<sp/>free_alternating_paths<LBC>(home);</highlight></codeline>
|
||
|
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>vvg->template<sp/>strongly_connected_components<LBC>(home);</highlight></codeline>
|
||
|
<codeline lineno="210"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(vvg->template<sp/>narrow<LBC>(home,x,k));</highlight></codeline>
|
||
|
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="213"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="214"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
|
||
|
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>card_assigned<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Card::propagate)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(prop_card<Card>(home,<sp/>y,<sp/>k));</highlight></codeline>
|
||
|
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>card_assigned<sp/>=<sp/>k.assigned();</highlight></codeline>
|
||
|
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
|
||
|
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(card_assigned)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x.size()<sp/>==<sp/>0)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j=k.size();<sp/>j--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((k[j].min()<sp/>><sp/>k[j].counter())<sp/>||<sp/></highlight></codeline>
|
||
|
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(k[j].max()<sp/><<sp/>k[j].counter()))</highlight></codeline>
|
||
|
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>home.<ref refid="group__TaskActorStatus_1gafc19cbf71ed90a9e0b414b875103f4c7" kindref="member">ES_SUBSUMED</ref>(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
||
|
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((x.size()<sp/>==<sp/>1)<sp/>&&<sp/>x[0].assigned())<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>idx;</highlight></codeline>
|
||
|
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<ref refid="namespaceGecode_1_1Int_1_1GCC_1a612204ff798bc68b0fc03c9135739d52" kindref="member">lookupValue</ref>(k,x[0].val(),idx))</highlight></codeline>
|
||
|
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ME_CHECK(k[idx].inc());</highlight></codeline>
|
||
|
<codeline lineno="233"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
|
||
|
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j<sp/>=<sp/>k.size();<sp/>j--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((k[j].min()<sp/>><sp/>k[j].counter())<sp/>||<sp/></highlight></codeline>
|
||
|
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(k[j].max()<sp/><<sp/>k[j].counter()))</highlight></codeline>
|
||
|
<codeline lineno="237"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>home.<ref refid="group__TaskActorStatus_1gafc19cbf71ed90a9e0b414b875103f4c7" kindref="member">ES_SUBSUMED</ref>(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
||
|
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="242"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>k.size();<sp/>i--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>count[i]<sp/>=<sp/>0;</highlight></codeline>
|
||
|
<codeline lineno="245"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>all_assigned<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>total<sp/>number<sp/>of<sp/>assigned<sp/>views</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>y.size();<sp/>i--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="249"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(y[i].assigned())<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>idx;</highlight></codeline>
|
||
|
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<ref refid="namespaceGecode_1_1Int_1_1GCC_1a612204ff798bc68b0fc03c9135739d52" kindref="member">lookupValue</ref>(k,y[i].val(),idx))</highlight></codeline>
|
||
|
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>count[idx]++;</highlight></codeline>
|
||
|
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Card::propagate<sp/>&&<sp/>(k[idx].max()<sp/>==<sp/>0))</highlight></codeline>
|
||
|
<codeline lineno="255"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="256"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
||
|
<codeline lineno="257"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>all_assigned<sp/>=<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="259"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Card::propagate)</highlight></codeline>
|
||
|
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(prop_card<Card>(home,<sp/>y,<sp/>k));</highlight></codeline>
|
||
|
<codeline lineno="262"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(all_assigned)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>k.size();<sp/>i--;<sp/>)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="265"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((k[i].min()<sp/>><sp/>count[i])<sp/>||<sp/>(count[i]<sp/>><sp/>k[i].max()))</highlight></codeline>
|
||
|
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>the<sp/>solution<sp/>contains<sp/>count[i]<sp/>occurences<sp/>of<sp/>value<sp/>k[i].card();</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Card::propagate)</highlight></codeline>
|
||
|
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ME_CHECK(k[i].eq(home,count[i]));</highlight></codeline>
|
||
|
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>home.<ref refid="group__TaskActorStatus_1gafc19cbf71ed90a9e0b414b875103f4c7" kindref="member">ES_SUBSUMED</ref>(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
||
|
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="273"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(Card::propagate)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ysmax<sp/>=<sp/>y.size();</highlight></codeline>
|
||
|
<codeline lineno="276"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=k.size();<sp/>i--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ysmax<sp/>-=<sp/>k[i].max();</highlight></codeline>
|
||
|
<codeline lineno="278"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>smax<sp/>=<sp/>0;</highlight></codeline>
|
||
|
<codeline lineno="279"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>card_ass<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
<codeline lineno="280"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>k.size();<sp/>i--;<sp/>)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="281"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ME_CHECK(k[i].gq(home,<sp/>ysmax<sp/>+<sp/>k[i].max()));</highlight></codeline>
|
||
|
<codeline lineno="282"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>smax<sp/>+=<sp/>k[i].max();</highlight></codeline>
|
||
|
<codeline lineno="283"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ME_CHECK(k[i].lq(home,<sp/>y.size()<sp/>+<sp/>k[i].min()));</highlight></codeline>
|
||
|
<codeline lineno="284"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!k[i].assigned())</highlight></codeline>
|
||
|
<codeline lineno="285"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>card_ass<sp/>=<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
<codeline lineno="286"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="287"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(card_ass<sp/>&&<sp/>(smax<sp/>!=<sp/>y.size()))</highlight></codeline>
|
||
|
<codeline lineno="288"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a839b40c2e7ccebb2e61e92e274833089" kindref="member">ES_FAILED</ref>;</highlight></codeline>
|
||
|
<codeline lineno="289"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="290"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>Card::propagate<sp/>?<sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5ac32341b682bca52b8617a8ad004023ef" kindref="member">ES_NOFIX</ref><sp/>:<sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a13bb69056fb9293e8df98c0e347ba634" kindref="member">ES_FIX</ref>;</highlight></codeline>
|
||
|
<codeline lineno="292"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="293"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="294"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>Card></highlight></codeline>
|
||
|
<codeline lineno="295"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref></highlight></codeline>
|
||
|
<codeline lineno="296" refid="classGecode_1_1Int_1_1GCC_1_1Dom_1af6c88f32c2ca7160c896b129f6bdf80d" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom_1af6c88f32c2ca7160c896b129f6bdf80d" kindref="member">Dom<Card>::post</ref>(<ref refid="classGecode_1_1Home" kindref="compound">Home</ref><sp/>home,<sp/></highlight></codeline>
|
||
|
<codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<IntView></ref>&<sp/>x,<sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<Card></ref>&<sp/>k)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="298"><highlight class="normal"><sp/><sp/><sp/><sp/>GECODE_ES_CHECK((postSideConstraints<Card>(home,x,k)));</highlight></codeline>
|
||
|
<codeline lineno="299"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="300"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(isDistinct<Card>(home,<sp/>x,<sp/>k))</highlight></codeline>
|
||
|
<codeline lineno="301"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Dom_1a089150d8f67be8224d74697d7bfbe99c" kindref="member">Distinct::Dom<IntView>::post</ref>(home,x);</highlight></codeline>
|
||
|
<codeline lineno="302"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="303"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>cardfix<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
<codeline lineno="304"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>k.<ref refid="classGecode_1_1ViewArray_1a65940b23e2457e97607475f8bd8f4ac6" kindref="member">size</ref>();<sp/>i--;<sp/>)</highlight></codeline>
|
||
|
<codeline lineno="305"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!k[i].assigned())<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="306"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cardfix<sp/>=<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
|
||
|
<codeline lineno="307"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="308"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="309"><highlight class="normal"><sp/><sp/><sp/><sp/>(void)<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>(home)<sp/><ref refid="classGecode_1_1Int_1_1GCC_1_1Dom" kindref="compound">Dom<Card></ref>(home,x,k,cardfix);</highlight></codeline>
|
||
|
<codeline lineno="310"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a01d6fb1ec70479e8e413d5ecfd63e303" kindref="member">ES_OK</ref>;</highlight></codeline>
|
||
|
<codeline lineno="311"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="312"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="313"><highlight class="normal">}}}</highlight></codeline>
|
||
|
<codeline lineno="314"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="315"><highlight class="normal"></highlight><highlight class="comment">//<sp/>STATISTICS:<sp/>int-prop</highlight><highlight class="normal"></highlight></codeline>
|
||
|
</programlisting>
|
||
|
<location file="/usr/include/gecode/int/gcc/dom.hpp"/>
|
||
|
</compounddef>
|
||
|
</doxygen>
|