548 lines
93 KiB
XML
548 lines
93 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="distinct_2bnd_8hpp" kind="file">
|
|
<compoundname>bnd.hpp</compoundname>
|
|
<includedby refid="int_2distinct_8hh" local="no">/usr/include/gecode/int/distinct.hh</includedby>
|
|
<invincdepgraph>
|
|
<node id="13306">
|
|
<label>/usr/include/gecode/int/nvalues/int-base.hpp</label>
|
|
<link refid="nvalues_2int-base_8hpp_source"/>
|
|
<childnode refid="13307" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="13304">
|
|
<label>/usr/include/gecode/int/gcc/post.hpp</label>
|
|
<link refid="int_2gcc_2post_8hpp_source"/>
|
|
<childnode refid="13305" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="13301">
|
|
<label>/usr/include/gecode/int/distinct.hh</label>
|
|
<link refid="int_2distinct_8hh_source"/>
|
|
<childnode refid="13302" relation="include">
|
|
</childnode>
|
|
<childnode refid="13303" relation="include">
|
|
</childnode>
|
|
<childnode refid="13304" relation="include">
|
|
</childnode>
|
|
<childnode refid="13306" relation="include">
|
|
</childnode>
|
|
<childnode refid="13308" relation="include">
|
|
</childnode>
|
|
<childnode refid="13309" relation="include">
|
|
</childnode>
|
|
<childnode refid="13310" relation="include">
|
|
</childnode>
|
|
<childnode refid="13311" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="13309">
|
|
<label>/usr/include/gecode/int/nvalues/int-gq.hpp</label>
|
|
<link refid="nvalues_2int-gq_8hpp_source"/>
|
|
<childnode refid="13307" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="13310">
|
|
<label>/usr/include/gecode/int/nvalues/int-lq.hpp</label>
|
|
<link refid="nvalues_2int-lq_8hpp_source"/>
|
|
<childnode refid="13307" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="13302">
|
|
<label>/usr/include/gecode/int/channel.hh</label>
|
|
<link refid="int_2channel_8hh_source"/>
|
|
</node>
|
|
<node id="13307">
|
|
<label>/usr/include/gecode/int/nvalues.hh</label>
|
|
<link refid="nvalues_8hh_source"/>
|
|
</node>
|
|
<node id="13311">
|
|
<label>/usr/include/gecode/int/sorted/propagate.hpp</label>
|
|
<link refid="sorted_2propagate_8hpp_source"/>
|
|
<childnode refid="13312" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="13305">
|
|
<label>/usr/include/gecode/int/gcc.hh</label>
|
|
<link refid="gcc_8hh_source"/>
|
|
</node>
|
|
<node id="13312">
|
|
<label>/usr/include/gecode/int/sorted.hh</label>
|
|
<link refid="sorted_8hh_source"/>
|
|
</node>
|
|
<node id="13308">
|
|
<label>/usr/include/gecode/int/nvalues/int-eq.hpp</label>
|
|
<link refid="nvalues_2int-eq_8hpp_source"/>
|
|
<childnode refid="13307" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="13300">
|
|
<label>/usr/include/gecode/int/distinct/bnd.hpp</label>
|
|
<link refid="distinct/bnd.hpp"/>
|
|
<childnode refid="13301" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="13303">
|
|
<label>/usr/include/gecode/int/circuit.hh</label>
|
|
<link refid="circuit_8hh_source"/>
|
|
</node>
|
|
</invincdepgraph>
|
|
<innerclass refid="classGecode_1_1Int_1_1Distinct_1_1Rank" prot="public">Gecode::Int::Distinct::Rank</innerclass>
|
|
<innerclass refid="classGecode_1_1Int_1_1Distinct_1_1MaxIncIdx" prot="public">Gecode::Int::Distinct::MaxIncIdx</innerclass>
|
|
<innerclass refid="classGecode_1_1Int_1_1Distinct_1_1MinIncIdx" prot="public">Gecode::Int::Distinct::MinIncIdx</innerclass>
|
|
<innerclass refid="classGecode_1_1Int_1_1Distinct_1_1MinInc" prot="public">Gecode::Int::Distinct::MinInc</innerclass>
|
|
<innerclass refid="classGecode_1_1Int_1_1Distinct_1_1HallInfo" prot="public">Gecode::Int::Distinct::HallInfo</innerclass>
|
|
<innernamespace refid="namespaceGecode">Gecode</innernamespace>
|
|
<innernamespace refid="namespaceGecode_1_1Int">Gecode::Int</innernamespace>
|
|
<innernamespace refid="namespaceGecode_1_1Int_1_1Distinct">Gecode::Int::Distinct</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/>Christian<sp/>Schulte<sp/><schulte@gecode.org></highlight></codeline>
|
|
<codeline lineno="5"><highlight class="comment"><sp/>*</highlight></codeline>
|
|
<codeline lineno="6"><highlight class="comment"><sp/>*<sp/><sp/>Copyright:</highlight></codeline>
|
|
<codeline lineno="7"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>Christian<sp/>Schulte,<sp/>2003</highlight></codeline>
|
|
<codeline lineno="8"><highlight class="comment"><sp/>*</highlight></codeline>
|
|
<codeline lineno="9"><highlight class="comment"><sp/>*<sp/><sp/>Last<sp/>modified:</highlight></codeline>
|
|
<codeline lineno="10"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>$Date:<sp/>2012-10-08<sp/>03:57:23<sp/>+0200<sp/>(Mon,<sp/>08<sp/>Oct<sp/>2012)<sp/>$<sp/>by<sp/>$Author:<sp/>tack<sp/>$</highlight></codeline>
|
|
<codeline lineno="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>$Revision:<sp/>13143<sp/>$</highlight></codeline>
|
|
<codeline lineno="12"><highlight class="comment"><sp/>*</highlight></codeline>
|
|
<codeline lineno="13"><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="14"><highlight class="comment"><sp/>*<sp/><sp/>development<sp/>environment:</highlight></codeline>
|
|
<codeline lineno="15"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>http://www.gecode.org</highlight></codeline>
|
|
<codeline lineno="16"><highlight class="comment"><sp/>*</highlight></codeline>
|
|
<codeline lineno="17"><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="18"><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="19"><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="20"><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="21"><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="22"><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="23"><highlight class="comment"><sp/>*<sp/><sp/>the<sp/>following<sp/>conditions:</highlight></codeline>
|
|
<codeline lineno="24"><highlight class="comment"><sp/>*</highlight></codeline>
|
|
<codeline lineno="25"><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="26"><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="27"><highlight class="comment"><sp/>*</highlight></codeline>
|
|
<codeline lineno="28"><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="29"><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="30"><highlight class="comment"><sp/>*<sp/><sp/>MERCHANTABILITY,<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>AND</highlight></codeline>
|
|
<codeline lineno="31"><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="32"><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="33"><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="34"><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="35"><highlight class="comment"><sp/>*</highlight></codeline>
|
|
<codeline lineno="36"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="37"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="38" refid="namespaceGecode_1_1Int_1_1Distinct" refkind="compound"><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">Distinct<sp/>{</highlight></codeline>
|
|
<codeline lineno="39"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="40"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>View></highlight></codeline>
|
|
<codeline lineno="41"><highlight class="normal"><sp/><sp/>forceinline</highlight></codeline>
|
|
<codeline lineno="42" refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ac201c4b0b34eeea81491e0e48591b478" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ac201c4b0b34eeea81491e0e48591b478" kindref="member">Bnd<View>::Bnd</ref>(<ref refid="classGecode_1_1Home" kindref="compound">Home</ref><sp/>home,<sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<View></ref>&<sp/>x0)</highlight></codeline>
|
|
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/>:<sp/><ref refid="classGecode_1_1Propagator" kindref="compound">Propagator</ref>(home),<sp/>x(x0),<sp/>y(home,x0)<sp/>{</highlight></codeline>
|
|
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Both<sp/>x<sp/>and<sp/>y<sp/>initially<sp/>contain<sp/>the<sp/>same<sp/>variables</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/><sp/>-<sp/>x<sp/>is<sp/>used<sp/>for<sp/>bounds<sp/>propagation</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/><sp/>-<sp/>y<sp/>is<sp/>used<sp/>for<sp/>performing<sp/>singleton<sp/>propagation</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>They<sp/>can<sp/>not<sp/>be<sp/>shared<sp/>as<sp/>singleton<sp/>propagation<sp/>removes</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>determined<sp/>variables<sp/>still<sp/>required<sp/>for<sp/>bounds<sp/>propagation.</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1aa23cd7302c2532c0187f90c759ca0d3b" kindref="member">y</ref>.subscribe(home,*</highlight><highlight class="keyword">this</highlight><highlight class="normal">,PC_INT_BND);</highlight></codeline>
|
|
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>min<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ad9846c90df22541a688cf3e0e21bd5ed" kindref="member">x</ref>[<ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ad9846c90df22541a688cf3e0e21bd5ed" kindref="member">x</ref>.size()-1].min(),<sp/>max<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ad9846c90df22541a688cf3e0e21bd5ed" kindref="member">x</ref>[<ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ad9846c90df22541a688cf3e0e21bd5ed" kindref="member">x</ref>.size()-1].max();</highlight></codeline>
|
|
<codeline lineno="51"><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=<ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ad9846c90df22541a688cf3e0e21bd5ed" kindref="member">x</ref>.size()-1;<sp/>i--;<sp/>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>min<sp/>=<sp/><ref refid="group__TaskModelFloatArith_1ga121700708772a60191be6256c3c0d151" kindref="member">std::min</ref>(min,<ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ad9846c90df22541a688cf3e0e21bd5ed" kindref="member">x</ref>[i].min());</highlight></codeline>
|
|
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>max<sp/>=<sp/><ref refid="group__TaskModelFloatArith_1ga958cb25ae9754d6cc35c7c6e34ebc1e3" kindref="member">std::max</ref>(max,<ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ad9846c90df22541a688cf3e0e21bd5ed" kindref="member">x</ref>[i].max());</highlight></codeline>
|
|
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1aedc0a48dcdd2a3eedc7e8b52af0bb623" kindref="member">min_x</ref><sp/>=<sp/>min;<sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a1685ded374c200165cb50fdf3fcfdd7b" kindref="member">max_x</ref><sp/>=<sp/>max;</highlight></codeline>
|
|
<codeline lineno="56"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="57"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="58"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>View></highlight></codeline>
|
|
<codeline lineno="59"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="60" refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a3c91d6ef9545dc52df24955e2d997c59" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a3c91d6ef9545dc52df24955e2d997c59" kindref="member">Bnd<View>::dispose</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home)<sp/>{</highlight></codeline>
|
|
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/>y.cancel(home,*</highlight><highlight class="keyword">this</highlight><highlight class="normal">,PC_INT_BND);</highlight></codeline>
|
|
<codeline lineno="62"><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="63"><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="64"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="65"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="66"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>View></highlight></codeline>
|
|
<codeline lineno="67"><highlight class="normal"><sp/><sp/>forceinline</highlight></codeline>
|
|
<codeline lineno="68" refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a6534c08d71921af44b78957046ef153b" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ac201c4b0b34eeea81491e0e48591b478" kindref="member">Bnd<View>::Bnd</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_1Distinct_1_1Bnd" kindref="compound">Bnd<View></ref>&<sp/>p)</highlight></codeline>
|
|
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/>:<sp/><ref refid="classGecode_1_1Propagator" kindref="compound">Propagator</ref>(home,share,p),<sp/>min_x(p.min_x),<sp/>max_x(p.max_x)<sp/>{</highlight></codeline>
|
|
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ad9846c90df22541a688cf3e0e21bd5ed" kindref="member">x</ref>.update(home,share,p.<ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1ad9846c90df22541a688cf3e0e21bd5ed" kindref="member">x</ref>);</highlight></codeline>
|
|
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1aa23cd7302c2532c0187f90c759ca0d3b" kindref="member">y</ref>.update(home,share,p.<ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1aa23cd7302c2532c0187f90c759ca0d3b" kindref="member">y</ref>);</highlight></codeline>
|
|
<codeline lineno="72"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="73"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="74"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>View></highlight></codeline>
|
|
<codeline lineno="75"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Actor" kindref="compound">Actor</ref>*</highlight></codeline>
|
|
<codeline lineno="76" refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a935fe87b24ea30d13cf2d788e7973037" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a935fe87b24ea30d13cf2d788e7973037" kindref="member">Bnd<View>::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="77"><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_1Distinct_1_1Bnd" kindref="compound">Bnd<View></ref>(home,share,*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
|
<codeline lineno="78"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="79"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="80"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>View></highlight></codeline>
|
|
<codeline lineno="81"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1PropCost" kindref="compound">PropCost</ref></highlight></codeline>
|
|
<codeline lineno="82" refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a2ed4bcc8004d8f54f4e5fdc087f75d93" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a2ed4bcc8004d8f54f4e5fdc087f75d93" kindref="member">Bnd<View>::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>&<sp/>med)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
|
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(View::me(med)<sp/>==<sp/>ME_INT_VAL)</highlight></codeline>
|
|
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1PropCost_1a4a383a3772df2c1e49341813edc19b34" kindref="member">PropCost::linear</ref>(<ref refid="classGecode_1_1PropCost_1ad1bebae59ea373495c5bf51ffc249dcda29f70a7d7f550f3822568ddce422d861" kindref="member">PropCost::LO</ref>,<sp/>y.size());</highlight></codeline>
|
|
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1PropCost_1ab9758f7a6301e1f3e1010762465b085a" kindref="member">PropCost::quadratic</ref>(<ref refid="classGecode_1_1PropCost_1ad1bebae59ea373495c5bf51ffc249dcda29f70a7d7f550f3822568ddce422d861" kindref="member">PropCost::LO</ref>,<sp/>x.size());</highlight></codeline>
|
|
<codeline lineno="87"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="88"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="89"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="91" refid="classGecode_1_1Int_1_1Distinct_1_1Rank" refkind="compound"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classGecode_1_1Int_1_1Distinct_1_1Rank" kindref="compound">Rank</ref><sp/>{</highlight></codeline>
|
|
<codeline lineno="92"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
|
|
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>min,<sp/>max;</highlight></codeline>
|
|
<codeline lineno="94"><highlight class="normal"><sp/><sp/>};</highlight></codeline>
|
|
<codeline lineno="95"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="97"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>View></highlight></codeline>
|
|
<codeline lineno="98" refid="classGecode_1_1Int_1_1Distinct_1_1MaxIncIdx" refkind="compound"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classGecode_1_1Int_1_1Distinct_1_1MaxIncIdx" kindref="compound">MaxIncIdx</ref><sp/>{</highlight></codeline>
|
|
<codeline lineno="99"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
|
|
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<View></ref><sp/>x;</highlight></codeline>
|
|
<codeline lineno="101"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
|
|
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/>forceinline</highlight></codeline>
|
|
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1MaxIncIdx" kindref="compound">MaxIncIdx</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<View></ref>&<sp/>x0)<sp/>:<sp/>x(x0)<sp/>{}</highlight></codeline>
|
|
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/>operator<sp/>()(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j)<sp/>{</highlight></codeline>
|
|
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>x[i].max()<sp/><<sp/>x[j].max();</highlight></codeline>
|
|
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="108"><highlight class="normal"><sp/><sp/>};</highlight></codeline>
|
|
<codeline lineno="109"><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/>View></highlight></codeline>
|
|
<codeline lineno="112" refid="classGecode_1_1Int_1_1Distinct_1_1MinIncIdx" refkind="compound"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classGecode_1_1Int_1_1Distinct_1_1MinIncIdx" kindref="compound">MinIncIdx</ref><sp/>{</highlight></codeline>
|
|
<codeline lineno="113"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">protected</highlight><highlight class="normal">:</highlight></codeline>
|
|
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<View></ref><sp/>x;</highlight></codeline>
|
|
<codeline lineno="115"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
|
|
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/>forceinline<sp/></highlight></codeline>
|
|
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1MinIncIdx" kindref="compound">MinIncIdx</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<View></ref>&<sp/>x0)<sp/>:<sp/>x(x0)<sp/>{}</highlight></codeline>
|
|
<codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/>operator<sp/>()(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j)<sp/>{</highlight></codeline>
|
|
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>x[i].min()<sp/><<sp/>x[j].min();</highlight></codeline>
|
|
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="122"><highlight class="normal"><sp/><sp/>};</highlight></codeline>
|
|
<codeline lineno="123"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="125"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>View></highlight></codeline>
|
|
<codeline lineno="126" refid="classGecode_1_1Int_1_1Distinct_1_1MinInc" refkind="compound"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classGecode_1_1Int_1_1Distinct_1_1MinInc" kindref="compound">MinInc</ref><sp/>{</highlight></codeline>
|
|
<codeline lineno="127"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
|
|
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/>operator<sp/>()(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>View&<sp/>x,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>View&<sp/>y)<sp/>{</highlight></codeline>
|
|
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>x.min()<sp/><<sp/>y.min();</highlight></codeline>
|
|
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="132"><highlight class="normal"><sp/><sp/>};</highlight></codeline>
|
|
<codeline lineno="133"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="135" refid="classGecode_1_1Int_1_1Distinct_1_1HallInfo" refkind="compound"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classGecode_1_1Int_1_1Distinct_1_1HallInfo" kindref="compound">HallInfo</ref><sp/>{</highlight></codeline>
|
|
<codeline lineno="136"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
|
|
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>bounds,<sp/>t,<sp/>d,<sp/>h;</highlight></codeline>
|
|
<codeline lineno="138"><highlight class="normal"><sp/><sp/>};</highlight></codeline>
|
|
<codeline lineno="139"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="140"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="141"><highlight class="normal"><sp/><sp/>pathset_t(<ref refid="classGecode_1_1Int_1_1Distinct_1_1HallInfo" kindref="compound">HallInfo</ref><sp/>hall[],<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>start,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>end,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>to)<sp/>{</highlight></codeline>
|
|
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>k,<sp/>l;</highlight></codeline>
|
|
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(l=start;<sp/>(k=l)<sp/>!=<sp/>end;<sp/>hall[k].t=to)<sp/>{</highlight></codeline>
|
|
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>l<sp/>=<sp/>hall[k].t;</highlight></codeline>
|
|
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="146"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="147"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="148"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="149"><highlight class="normal"><sp/><sp/>pathset_h(HallInfo<sp/>hall[],<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>start,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>end,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>to)<sp/>{</highlight></codeline>
|
|
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>k,<sp/>l;</highlight></codeline>
|
|
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(l=start;<sp/>(k=l)<sp/>!=<sp/>end;<sp/>hall[k].h=to)<sp/>{</highlight></codeline>
|
|
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>l<sp/>=<sp/>hall[k].h;</highlight></codeline>
|
|
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="154"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="155"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="156"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="157"><highlight class="normal"><sp/><sp/>pathmin_h(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>HallInfo<sp/>hall[],<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i)<sp/>{</highlight></codeline>
|
|
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(hall[i].h<sp/><<sp/>i)</highlight></codeline>
|
|
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>=<sp/>hall[i].h;</highlight></codeline>
|
|
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
|
|
<codeline lineno="161"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="162"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="163"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="164"><highlight class="normal"><sp/><sp/>pathmin_t(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>HallInfo<sp/>hall[],<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i)<sp/>{</highlight></codeline>
|
|
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(hall[i].t<sp/><<sp/>i)</highlight></codeline>
|
|
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>=<sp/>hall[i].t;</highlight></codeline>
|
|
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
|
|
<codeline lineno="168"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="169"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="170"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="171"><highlight class="normal"><sp/><sp/>pathmax_h(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>HallInfo<sp/>hall[],<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i)<sp/>{</highlight></codeline>
|
|
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(hall[i].h<sp/>><sp/>i)</highlight></codeline>
|
|
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>=<sp/>hall[i].h;</highlight></codeline>
|
|
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
|
|
<codeline lineno="175"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="176"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="177"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="178"><highlight class="normal"><sp/><sp/>pathmax_t(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>HallInfo<sp/>hall[],<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i)<sp/>{</highlight></codeline>
|
|
<codeline lineno="179"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(hall[i].t<sp/>><sp/>i)</highlight></codeline>
|
|
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>=<sp/>hall[i].t;</highlight></codeline>
|
|
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
|
|
<codeline lineno="182"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="183"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="184"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>View></highlight></codeline>
|
|
<codeline lineno="185"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref></highlight></codeline>
|
|
<codeline lineno="186" refid="namespaceGecode_1_1Int_1_1Distinct_1a20048792bef5d1044c68fab690f0ba88" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1_1Int_1_1Distinct_1a20048792bef5d1044c68fab690f0ba88" kindref="member">prop_bnd</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home,<sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<View></ref>&<sp/>x,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">&<sp/>min_x,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">&<sp/>max_x)<sp/>{</highlight></codeline>
|
|
<codeline lineno="187"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n<sp/>=<sp/>x.<ref refid="classGecode_1_1ViewArray_1a65940b23e2457e97607475f8bd8f4ac6" kindref="member">size</ref>();</highlight></codeline>
|
|
<codeline lineno="188"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="189"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Region" kindref="compound">Region</ref><sp/>r(home);</highlight></codeline>
|
|
<codeline lineno="190"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*<sp/>minsorted<sp/>=<sp/>r.<ref refid="classGecode_1_1Region_1a167cff2d16f08d890fff11f80e519233" kindref="member">alloc</ref><</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">>(n);</highlight></codeline>
|
|
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*<sp/>maxsorted<sp/>=<sp/>r.<ref refid="classGecode_1_1Region_1a167cff2d16f08d890fff11f80e519233" kindref="member">alloc</ref><</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">>(n);</highlight></codeline>
|
|
<codeline lineno="193"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>d<sp/>=<sp/></highlight><highlight class="keyword">static_cast<</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="keyword">></highlight><highlight class="normal">(max_x<sp/>-<sp/>min_x)<sp/>+<sp/>1;</highlight></codeline>
|
|
<codeline lineno="195"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(d<sp/><<sp/>static_cast<unsigned<sp/>int>(n))</highlight></codeline>
|
|
<codeline lineno="197"><highlight class="normal"><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="198"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(d<sp/>><sp/>2*static_cast<unsigned<sp/>int>(n))<sp/>{</highlight></codeline>
|
|
<codeline lineno="200"><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/>n;<sp/>i--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>minsorted[i]=maxsorted[i]=i;</highlight></codeline>
|
|
<codeline lineno="202"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1MinIncIdx" kindref="compound">MinIncIdx<View></ref><sp/>min_inc(x);</highlight></codeline>
|
|
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>Support::quicksort<int,MinIncIdx<View><sp/>>(minsorted,<sp/>n,<sp/>min_inc);</highlight></codeline>
|
|
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1MaxIncIdx" kindref="compound">MaxIncIdx<View></ref><sp/>max_inc(x);</highlight></codeline>
|
|
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>Support::quicksort<int,MaxIncIdx<View><sp/>>(maxsorted,<sp/>n,<sp/>max_inc);</highlight></codeline>
|
|
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
|
<codeline lineno="208"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*<sp/>minbucket<sp/>=<sp/>r.<ref refid="classGecode_1_1Region_1a167cff2d16f08d890fff11f80e519233" kindref="member">alloc</ref><</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">>(d);</highlight></codeline>
|
|
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*<sp/>maxbucket<sp/>=<sp/>r.<ref refid="classGecode_1_1Region_1a167cff2d16f08d890fff11f80e519233" kindref="member">alloc</ref><</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">>(d);</highlight></codeline>
|
|
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=d;<sp/>i--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>minbucket[i]=maxbucket[i]=0;</highlight></codeline>
|
|
<codeline lineno="213"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="214"><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=n;<sp/>i--;<sp/>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>minbucket[x[i].min()<sp/>-<sp/>min_x]++;</highlight></codeline>
|
|
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>maxbucket[x[i].max()<sp/>-<sp/>min_x]++;</highlight></codeline>
|
|
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="218"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>c_min<sp/>=<sp/>0,<sp/>c_max<sp/>=<sp/>0;</highlight></codeline>
|
|
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=0;<sp/>i<d;<sp/>i++)<sp/>{</highlight></codeline>
|
|
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t_min<sp/>=<sp/>minbucket[i];</highlight></codeline>
|
|
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t_max<sp/>=<sp/>maxbucket[i];</highlight></codeline>
|
|
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>minbucket[i]<sp/>=<sp/>c_min;<sp/>c_min<sp/>+=<sp/>t_min;</highlight></codeline>
|
|
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>maxbucket[i]<sp/>=<sp/>c_max;<sp/>c_max<sp/>+=<sp/>t_max;</highlight></codeline>
|
|
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>assert((c_min<sp/>==<sp/>n)<sp/>&&<sp/>(c_max<sp/>==<sp/>n));</highlight></codeline>
|
|
<codeline lineno="227"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="228"><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=n;<sp/>i--;<sp/>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>minsorted[minbucket[x[i].min()<sp/>-<sp/>min_x]++]<sp/>=<sp/>i;</highlight></codeline>
|
|
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>maxsorted[maxbucket[x[i].max()<sp/>-<sp/>min_x]++]<sp/>=<sp/>i;</highlight></codeline>
|
|
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="233"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Update<sp/>minimum<sp/>and<sp/>maximum<sp/>information</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/>min_x<sp/>=<sp/>x[minsorted[0]].min();</highlight></codeline>
|
|
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/>max_x<sp/>=<sp/>x[maxsorted[n-1]].max();</highlight></codeline>
|
|
<codeline lineno="237"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="238"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Setup<sp/>rank<sp/>and<sp/>bounds<sp/>info</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1HallInfo" kindref="compound">HallInfo</ref>*<sp/>hall<sp/>=<sp/>r.<ref refid="classGecode_1_1Region_1a167cff2d16f08d890fff11f80e519233" kindref="member">alloc</ref><<ref refid="classGecode_1_1Int_1_1Distinct_1_1HallInfo" kindref="compound">HallInfo</ref>>(2*n+2);</highlight></codeline>
|
|
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Rank" kindref="compound">Rank</ref>*<sp/>rank<sp/>=<sp/>r.<ref refid="classGecode_1_1Region_1a167cff2d16f08d890fff11f80e519233" kindref="member">alloc</ref><<ref refid="classGecode_1_1Int_1_1Distinct_1_1Rank" kindref="compound">Rank</ref>>(n);</highlight></codeline>
|
|
<codeline lineno="242"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nb<sp/>=<sp/>0;</highlight></codeline>
|
|
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
|
|
<codeline lineno="245"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>min<sp/><sp/>=<sp/>x[minsorted[0]].min();</highlight></codeline>
|
|
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>max<sp/><sp/>=<sp/>x[maxsorted[0]].max()<sp/>+<sp/>1;</highlight></codeline>
|
|
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>last<sp/>=<sp/>min<sp/>-<sp/>2;</highlight></codeline>
|
|
<codeline lineno="248"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="249"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>hall[0].bounds<sp/>=<sp/>last;</highlight></codeline>
|
|
<codeline lineno="250"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;</highlight></codeline>
|
|
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j<sp/>=<sp/>0;</highlight></codeline>
|
|
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keyword">true</highlight><highlight class="normal">)<sp/>{</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/>((i<sp/><<sp/>n)<sp/>&&<sp/>(min<sp/><<sp/>max))<sp/>{</highlight></codeline>
|
|
<codeline lineno="255"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(min<sp/>!=<sp/>last)</highlight></codeline>
|
|
<codeline lineno="256"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>hall[++nb].bounds<sp/>=<sp/>last<sp/>=<sp/>min;</highlight></codeline>
|
|
<codeline lineno="257"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rank[minsorted[i]].min<sp/>=<sp/>nb;</highlight></codeline>
|
|
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(++i<sp/><<sp/>n)</highlight></codeline>
|
|
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>min<sp/>=<sp/>x[minsorted[i]].min();</highlight></codeline>
|
|
<codeline lineno="260"><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="261"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(max<sp/>!=<sp/>last)</highlight></codeline>
|
|
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>hall[++nb].bounds<sp/>=<sp/>last<sp/>=<sp/>max;</highlight></codeline>
|
|
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rank[maxsorted[j]].max<sp/>=<sp/>nb;</highlight></codeline>
|
|
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(++j<sp/>==<sp/>n)</highlight></codeline>
|
|
<codeline lineno="265"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
|
|
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>max<sp/>=<sp/>x[maxsorted[j]].max()<sp/>+<sp/>1;</highlight></codeline>
|
|
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>hall[nb+1].bounds<sp/>=<sp/>hall[nb].bounds<sp/>+<sp/>2;</highlight></codeline>
|
|
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="271"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>tells<sp/>cross<sp/>holes,<sp/>we<sp/>do<sp/>not<sp/>compute<sp/>a<sp/>fixpoint</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref><sp/>es<sp/>=<sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a13bb69056fb9293e8df98c0e347ba634" kindref="member">ES_FIX</ref>;</highlight></codeline>
|
|
<codeline lineno="274"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Propagate<sp/>lower<sp/>bounds</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="276"><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=nb+2;<sp/>--i;)<sp/>{</highlight></codeline>
|
|
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>hall[i].t<sp/>=<sp/>hall[i].h<sp/>=<sp/>i-1;</highlight></codeline>
|
|
<codeline lineno="278"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>hall[i].d<sp/>=<sp/>hall[i].bounds<sp/>-<sp/>hall[i-1].bounds;</highlight></codeline>
|
|
<codeline lineno="279"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="280"><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=0;<sp/>i<n;<sp/>i++)<sp/>{<sp/></highlight><highlight class="comment">//<sp/>visit<sp/>intervals<sp/>in<sp/>increasing<sp/>max<sp/>order</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="281"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>x0<sp/>=<sp/>rank[maxsorted[i]].min;</highlight></codeline>
|
|
<codeline lineno="282"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>z<sp/>=<sp/>pathmax_t(hall,<sp/>x0+1);</highlight></codeline>
|
|
<codeline lineno="283"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j<sp/>=<sp/>hall[z].t;</highlight></codeline>
|
|
<codeline lineno="284"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(--hall[z].d<sp/>==<sp/>0)</highlight></codeline>
|
|
<codeline lineno="285"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>hall[z<sp/>=<sp/>pathmax_t(hall,<sp/>hall[z].t=z+1)].t<sp/>=<sp/>j;</highlight></codeline>
|
|
<codeline lineno="286"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>pathset_t(hall,<sp/>x0+1,<sp/>z,<sp/>z);<sp/></highlight><highlight class="comment">//<sp/>path<sp/>compression</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="287"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>y<sp/>=<sp/>rank[maxsorted[i]].max;</highlight></codeline>
|
|
<codeline lineno="288"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(hall[z].d<sp/><<sp/>hall[z].bounds-hall[y].bounds)</highlight></codeline>
|
|
<codeline lineno="289"><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="290"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(hall[x0].h<sp/>><sp/>x0)<sp/>{</highlight></codeline>
|
|
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>w<sp/>=<sp/>pathmax_h(hall,<sp/>hall[x0].h);</highlight></codeline>
|
|
<codeline lineno="292"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>m<sp/>=<sp/>hall[w].bounds;</highlight></codeline>
|
|
<codeline lineno="293"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__TaskVarMEPC_1gafa985ae465bd12df08e29252cdb7519b" kindref="member">ModEvent</ref><sp/>me<sp/>=<sp/>x[maxsorted[i]].gq(home,m);</highlight></codeline>
|
|
<codeline lineno="294"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="namespaceGecode_1a93e4dea4e5e021b4f58d0ccc78ac1523" kindref="member">me_failed</ref>(me))</highlight></codeline>
|
|
<codeline lineno="295"><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="296"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((me<sp/>==<sp/>ME_INT_VAL)<sp/>||</highlight></codeline>
|
|
<codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>((me<sp/>==<sp/>ME_INT_BND)<sp/>&&<sp/>(m<sp/>!=<sp/>x[maxsorted[i]].min())))</highlight></codeline>
|
|
<codeline lineno="298"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>es<sp/>=<sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5ac32341b682bca52b8617a8ad004023ef" kindref="member">ES_NOFIX</ref>;</highlight></codeline>
|
|
<codeline lineno="299"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pathset_h(hall,<sp/>x0,<sp/>w,<sp/>w);<sp/></highlight><highlight class="comment">//<sp/>path<sp/>compression</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="300"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="301"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(hall[z].d<sp/>==<sp/>hall[z].bounds-hall[y].bounds)<sp/>{</highlight></codeline>
|
|
<codeline lineno="302"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pathset_h(hall,<sp/>hall[y].h,<sp/>j-1,<sp/>y);<sp/></highlight><highlight class="comment">//<sp/>mark<sp/>hall<sp/>interval</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="303"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>hall[y].h<sp/>=<sp/>j-1;</highlight></codeline>
|
|
<codeline lineno="304"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="305"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="306"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="307"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Propagate<sp/>upper<sp/>bounds</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="308"><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=nb+1;<sp/>i--;)<sp/>{</highlight></codeline>
|
|
<codeline lineno="309"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>hall[i].t<sp/>=<sp/>hall[i].h<sp/>=<sp/>i+1;</highlight></codeline>
|
|
<codeline lineno="310"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>hall[i].d<sp/>=<sp/>hall[i+1].bounds<sp/>-<sp/>hall[i].bounds;</highlight></codeline>
|
|
<codeline lineno="311"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="312"><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=n;<sp/>--i>=0;<sp/>)<sp/>{<sp/></highlight><highlight class="comment">//<sp/>visit<sp/>intervals<sp/>in<sp/>decreasing<sp/>min<sp/>order</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="313"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>x0<sp/>=<sp/>rank[minsorted[i]].max;</highlight></codeline>
|
|
<codeline lineno="314"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>z<sp/>=<sp/>pathmin_t(hall,<sp/>x0-1);</highlight></codeline>
|
|
<codeline lineno="315"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j<sp/>=<sp/>hall[z].t;</highlight></codeline>
|
|
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(--hall[z].d<sp/>==<sp/>0)</highlight></codeline>
|
|
<codeline lineno="317"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>hall[z<sp/>=<sp/>pathmin_t(hall,<sp/>hall[z].t=z-1)].t<sp/>=<sp/>j;</highlight></codeline>
|
|
<codeline lineno="318"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>pathset_t(hall,<sp/>x0-1,<sp/>z,<sp/>z);</highlight></codeline>
|
|
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>y<sp/>=<sp/>rank[minsorted[i]].min;</highlight></codeline>
|
|
<codeline lineno="320"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(hall[z].d<sp/><<sp/>hall[y].bounds-hall[z].bounds)</highlight></codeline>
|
|
<codeline lineno="321"><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="322"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(hall[x0].h<sp/><<sp/>x0)<sp/>{</highlight></codeline>
|
|
<codeline lineno="323"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>w<sp/>=<sp/>pathmin_h(hall,<sp/>hall[x0].h);</highlight></codeline>
|
|
<codeline lineno="324"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>m<sp/>=<sp/>hall[w].bounds<sp/>-<sp/>1;</highlight></codeline>
|
|
<codeline lineno="325"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__TaskVarMEPC_1gafa985ae465bd12df08e29252cdb7519b" kindref="member">ModEvent</ref><sp/>me<sp/>=<sp/>x[minsorted[i]].lq(home,m);</highlight></codeline>
|
|
<codeline lineno="326"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="namespaceGecode_1a93e4dea4e5e021b4f58d0ccc78ac1523" kindref="member">me_failed</ref>(me))</highlight></codeline>
|
|
<codeline lineno="327"><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="328"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((me<sp/>==<sp/>ME_INT_VAL)<sp/>||</highlight></codeline>
|
|
<codeline lineno="329"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>((me<sp/>==<sp/>ME_INT_BND)<sp/>&&<sp/>(m<sp/>!=<sp/>x[maxsorted[i]].min())))</highlight></codeline>
|
|
<codeline lineno="330"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>es<sp/>=<sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5ac32341b682bca52b8617a8ad004023ef" kindref="member">ES_NOFIX</ref>;</highlight></codeline>
|
|
<codeline lineno="331"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pathset_h(hall,<sp/>x0,<sp/>w,<sp/>w);</highlight></codeline>
|
|
<codeline lineno="332"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="333"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(hall[z].d<sp/>==<sp/>hall[y].bounds-hall[z].bounds)<sp/>{</highlight></codeline>
|
|
<codeline lineno="334"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>pathset_h(hall,<sp/>hall[y].h,<sp/>j+1,<sp/>y);</highlight></codeline>
|
|
<codeline lineno="335"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>hall[y].h<sp/>=<sp/>j+1;</highlight></codeline>
|
|
<codeline lineno="336"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="337"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="338"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="339"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>es;</highlight></codeline>
|
|
<codeline lineno="340"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="341"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="342"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>View></highlight></codeline>
|
|
<codeline lineno="343"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref></highlight></codeline>
|
|
<codeline lineno="344" refid="namespaceGecode_1_1Int_1_1Distinct_1a191e2729d9f164b5cabf6d6da2f92f56" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1_1Int_1_1Distinct_1a20048792bef5d1044c68fab690f0ba88" kindref="member">prop_bnd</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home,<sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<View></ref>&<sp/>x)<sp/>{</highlight></codeline>
|
|
<codeline lineno="345"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>min<sp/>=<sp/>x[x.<ref refid="classGecode_1_1ViewArray_1a65940b23e2457e97607475f8bd8f4ac6" kindref="member">size</ref>()-1].min(),<sp/>max<sp/>=<sp/>x[x.<ref refid="classGecode_1_1ViewArray_1a65940b23e2457e97607475f8bd8f4ac6" kindref="member">size</ref>()-1].max();</highlight></codeline>
|
|
<codeline lineno="346"><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=x.<ref refid="classGecode_1_1ViewArray_1a65940b23e2457e97607475f8bd8f4ac6" kindref="member">size</ref>()-1;<sp/>i--;<sp/>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="347"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>min<sp/>=<sp/><ref refid="group__TaskModelFloatArith_1ga121700708772a60191be6256c3c0d151" kindref="member">std::min</ref>(min,x[i].min());</highlight></codeline>
|
|
<codeline lineno="348"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>max<sp/>=<sp/><ref refid="group__TaskModelFloatArith_1ga958cb25ae9754d6cc35c7c6e34ebc1e3" kindref="member">std::max</ref>(max,x[i].max());</highlight></codeline>
|
|
<codeline lineno="349"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="350"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1_1Int_1_1Distinct_1a20048792bef5d1044c68fab690f0ba88" kindref="member">prop_bnd</ref>(home,<sp/>x,<sp/>min,<sp/>max);</highlight></codeline>
|
|
<codeline lineno="351"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="352"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="353"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>View></highlight></codeline>
|
|
<codeline lineno="354"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref></highlight></codeline>
|
|
<codeline lineno="355" refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a836da0df879a48116fa74fc0f1b8d942" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a836da0df879a48116fa74fc0f1b8d942" kindref="member">Bnd<View>::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/>med)<sp/>{</highlight></codeline>
|
|
<codeline lineno="356"><highlight class="normal"><sp/><sp/><sp/><sp/>assert(x.size()<sp/>><sp/>1);</highlight></codeline>
|
|
<codeline lineno="357"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="358"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(View::me(med)<sp/>==<sp/>ME_INT_VAL)<sp/>{</highlight></codeline>
|
|
<codeline lineno="359"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref><sp/>es<sp/>=<sp/>prop_val<View,false>(home,y);</highlight></codeline>
|
|
<codeline lineno="360"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(es);</highlight></codeline>
|
|
<codeline lineno="361"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(y.size()<sp/><<sp/>2)</highlight></codeline>
|
|
<codeline lineno="362"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>home.ES_SUBSUMED(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
|
<codeline lineno="363"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(es<sp/>==<sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5a13bb69056fb9293e8df98c0e347ba634" kindref="member">ES_FIX</ref>)</highlight></codeline>
|
|
<codeline lineno="364"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>home.ES_FIX_PARTIAL(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">,View::med(ME_INT_BND));</highlight></codeline>
|
|
<codeline lineno="365"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="366"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(y.size()<sp/>==<sp/>2)</highlight></codeline>
|
|
<codeline lineno="368"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_REWRITE(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">,<ref refid="classGecode_1_1Int_1_1Rel_1_1Nq" kindref="compound">Rel::Nq<View>::post</ref>(home(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">),y[0],y[1]));</highlight></codeline>
|
|
<codeline lineno="369"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="370"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref><sp/>es<sp/>=<sp/>prop_bnd<View>(home,x,min_x,max_x);</highlight></codeline>
|
|
<codeline lineno="371"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="372"><highlight class="normal"><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(es);</highlight></codeline>
|
|
<codeline lineno="373"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(es<sp/>==<sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5ac32341b682bca52b8617a8ad004023ef" kindref="member">ES_NOFIX</ref><sp/>&&<sp/>View::me(modeventdelta())<sp/>==<sp/><sp/>ME_INT_VAL)</highlight></codeline>
|
|
<codeline lineno="374"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>es;</highlight></codeline>
|
|
<codeline lineno="375"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="376"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n<sp/>=<sp/>x.size();</highlight></codeline>
|
|
<codeline lineno="377"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="378"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((n<sp/>><sp/>2*y.size())<sp/>&&<sp/>(n<sp/>><sp/>6))<sp/>{</highlight></codeline>
|
|
<codeline lineno="379"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>If<sp/>there<sp/>are<sp/>many<sp/>assigned<sp/>views,<sp/>try<sp/>to<sp/>eliminate<sp/>them</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="380"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>d<sp/>=<sp/></highlight><highlight class="keyword">static_cast<</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="keyword">></highlight><highlight class="normal">(max_x<sp/>-<sp/>min_x)<sp/>+<sp/>1;</highlight></codeline>
|
|
<codeline lineno="381"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(d<sp/>><sp/>2*static_cast<unsigned<sp/>int>(n))<sp/>{</highlight></codeline>
|
|
<codeline lineno="382"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1MinInc" kindref="compound">MinInc<View></ref><sp/>min_inc;</highlight></codeline>
|
|
<codeline lineno="383"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Support::quicksort<View,MinInc<View><sp/>>(&x[0],<sp/>n,<sp/>min_inc);</highlight></codeline>
|
|
<codeline lineno="384"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
|
<codeline lineno="385"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Region" kindref="compound">Region</ref><sp/>r(home);</highlight></codeline>
|
|
<codeline lineno="386"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*<sp/>minbucket<sp/>=<sp/>r.<ref refid="classGecode_1_1Region_1a167cff2d16f08d890fff11f80e519233" kindref="member">alloc</ref><</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">>(d);</highlight></codeline>
|
|
<codeline lineno="387"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>View*<sp/>minsorted<sp/>=<sp/>r.<ref refid="classGecode_1_1Region_1a167cff2d16f08d890fff11f80e519233" kindref="member">alloc</ref><View>(n);</highlight></codeline>
|
|
<codeline lineno="388"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="389"><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">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=d;<sp/>i--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="390"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>minbucket[i]=0;</highlight></codeline>
|
|
<codeline lineno="391"><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=n;<sp/>i--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="392"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>minbucket[x[i].min()<sp/>-<sp/>min_x]++;</highlight></codeline>
|
|
<codeline lineno="393"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="394"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>c_min<sp/>=<sp/>0;</highlight></codeline>
|
|
<codeline lineno="395"><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">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i=0;<sp/>i<d;<sp/>i++)<sp/>{</highlight></codeline>
|
|
<codeline lineno="396"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>t_min<sp/>=<sp/>minbucket[i];</highlight></codeline>
|
|
<codeline lineno="397"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>minbucket[i]<sp/>=<sp/>c_min;<sp/>c_min<sp/>+=<sp/>t_min;</highlight></codeline>
|
|
<codeline lineno="398"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="399"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>assert(c_min<sp/>==<sp/>n);</highlight></codeline>
|
|
<codeline lineno="400"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="401"><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=n;<sp/>i--;)</highlight></codeline>
|
|
<codeline lineno="402"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>minsorted[minbucket[x[i].min()<sp/>-<sp/>min_x]++]<sp/>=<sp/>x[i];</highlight></codeline>
|
|
<codeline lineno="403"><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=n;<sp/>i--;)</highlight></codeline>
|
|
<codeline lineno="404"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x[i]<sp/>=<sp/>minsorted[i];</highlight></codeline>
|
|
<codeline lineno="405"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="406"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="407"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/><sp/><sp/>=<sp/>0;</highlight></codeline>
|
|
<codeline lineno="408"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j<sp/><sp/><sp/>=<sp/>0;</highlight></codeline>
|
|
<codeline lineno="409"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>max<sp/>=<sp/>x[0].max()-1;</highlight></codeline>
|
|
<codeline lineno="410"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(i<sp/><<sp/>n-1)<sp/>{</highlight></codeline>
|
|
<codeline lineno="411"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!x[i].assigned()<sp/>||</highlight></codeline>
|
|
<codeline lineno="412"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(x[i].val()<sp/><=<sp/>max)<sp/>||<sp/>(x[i].val()<sp/>><sp/>x[i+1].min()))<sp/>{</highlight></codeline>
|
|
<codeline lineno="413"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Keep<sp/>view<sp/>x[i]</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="414"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>max<sp/>=<sp/><ref refid="group__TaskModelFloatArith_1ga958cb25ae9754d6cc35c7c6e34ebc1e3" kindref="member">std::max</ref>(max,x[i].max());</highlight></codeline>
|
|
<codeline lineno="415"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x[j++]=x[i];</highlight></codeline>
|
|
<codeline lineno="416"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="417"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i++;</highlight></codeline>
|
|
<codeline lineno="418"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="419"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!x[i].assigned()<sp/>||<sp/>(x[i].val()<sp/><=<sp/>max))</highlight></codeline>
|
|
<codeline lineno="420"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x[j++]=x[i];</highlight></codeline>
|
|
<codeline lineno="421"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>x.size(j);</highlight></codeline>
|
|
<codeline lineno="422"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="423"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="424"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x.size()<sp/><<sp/>2)</highlight></codeline>
|
|
<codeline lineno="425"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>home.ES_SUBSUMED(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
|
<codeline lineno="426"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="427"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x.size()<sp/>==<sp/>2)</highlight></codeline>
|
|
<codeline lineno="428"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_REWRITE(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">,<ref refid="classGecode_1_1Int_1_1Rel_1_1Nq" kindref="compound">Rel::Nq<View>::post</ref>(home(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">),x[0],x[1]));</highlight></codeline>
|
|
<codeline lineno="429"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="430"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>es;</highlight></codeline>
|
|
<codeline lineno="431"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="432"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="433"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>View></highlight></codeline>
|
|
<codeline lineno="434"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref></highlight></codeline>
|
|
<codeline lineno="435" refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a4dc05ab2735e4cd39018f1375b07df05" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd_1a4dc05ab2735e4cd39018f1375b07df05" kindref="member">Bnd<View>::post</ref>(<ref refid="classGecode_1_1Home" kindref="compound">Home</ref><sp/>home,<sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<View></ref>&<sp/>x){</highlight></codeline>
|
|
<codeline lineno="436"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x.<ref refid="classGecode_1_1ViewArray_1a65940b23e2457e97607475f8bd8f4ac6" kindref="member">size</ref>()<sp/>==<sp/>2)</highlight></codeline>
|
|
<codeline lineno="437"><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_1Rel_1_1Nq" kindref="compound">Rel::Nq<View>::post</ref>(home,x[0],x[1]);</highlight></codeline>
|
|
<codeline lineno="438"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x.<ref refid="classGecode_1_1ViewArray_1a65940b23e2457e97607475f8bd8f4ac6" kindref="member">size</ref>()<sp/>><sp/>2)</highlight></codeline>
|
|
<codeline lineno="439"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>(home)<sp/><ref refid="classGecode_1_1Int_1_1Distinct_1_1Bnd" kindref="compound">Bnd<View></ref>(home,x);</highlight></codeline>
|
|
<codeline lineno="440"><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="441"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="442"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="443"><highlight class="normal">}}}</highlight></codeline>
|
|
<codeline lineno="444"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="445"><highlight class="normal"></highlight><highlight class="comment">//<sp/>STATISTICS:<sp/>int-prop</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="446"><highlight class="normal"></highlight></codeline>
|
|
</programlisting>
|
|
<location file="/usr/include/gecode/int/distinct/bnd.hpp"/>
|
|
</compounddef>
|
|
</doxygen>
|