190 lines
32 KiB
XML
190 lines
32 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="opt_8hpp" kind="file">
|
|
<compoundname>opt.hpp</compoundname>
|
|
<includedby refid="no-overlap_8hh" local="no">/usr/include/gecode/int/no-overlap.hh</includedby>
|
|
<invincdepgraph>
|
|
<node id="17542">
|
|
<label>/usr/include/gecode/int/no-overlap.hh</label>
|
|
<link refid="no-overlap_8hh_source"/>
|
|
</node>
|
|
<node id="17541">
|
|
<label>/usr/include/gecode/int/no-overlap/opt.hpp</label>
|
|
<link refid="opt.hpp"/>
|
|
<childnode refid="17542" relation="include">
|
|
</childnode>
|
|
</node>
|
|
</invincdepgraph>
|
|
<innernamespace refid="namespaceGecode">Gecode</innernamespace>
|
|
<innernamespace refid="namespaceGecode_1_1Int">Gecode::Int</innernamespace>
|
|
<innernamespace refid="namespaceGecode_1_1Int_1_1NoOverlap">Gecode::Int::NoOverlap</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/>2011</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-22<sp/>21:13:52<sp/>+0200<sp/>(Mon,<sp/>22<sp/>Oct<sp/>2012)<sp/>$<sp/>by<sp/>$Author:<sp/>schulte<sp/>$</highlight></codeline>
|
|
<codeline lineno="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>$Revision:<sp/>13163<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"><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">NoOverlap<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/>Box></highlight></codeline>
|
|
<codeline lineno="41"><highlight class="normal"><sp/><sp/>forceinline</highlight></codeline>
|
|
<codeline lineno="42" refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1ada76d991753c8232635b77d1b71b70e1" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1ada76d991753c8232635b77d1b71b70e1" kindref="member">OptProp<Box>::OptProp</ref>(<ref refid="classGecode_1_1Home" kindref="compound">Home</ref><sp/>home,<sp/>Box*<sp/>b,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>m0)</highlight></codeline>
|
|
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/>:<sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1Base" kindref="compound">Base</ref><Box>(home,b,n),<sp/>m(m0)<sp/>{</highlight></codeline>
|
|
<codeline lineno="44"><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_1NoOverlap_1_1OptProp_1acac68702f89cc8ebe9adbf06bc42abeb" kindref="member">m</ref>;<sp/>i--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>b[n+i].subscribe(home,<sp/>*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
|
<codeline lineno="46"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="47"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="48"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>Box></highlight></codeline>
|
|
<codeline lineno="49"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref></highlight></codeline>
|
|
<codeline lineno="50" refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1a5f49b87494b5e85433d2ae1ee0cafd51" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1a5f49b87494b5e85433d2ae1ee0cafd51" kindref="member">OptProp<Box>::post</ref>(<ref refid="classGecode_1_1Home" kindref="compound">Home</ref><sp/>home,<sp/>Box*<sp/>b,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n)<sp/>{</highlight></codeline>
|
|
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Partition<sp/>into<sp/>mandatory<sp/>and<sp/>optional<sp/>boxes</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(n<sp/>><sp/>1)<sp/>{</highlight></codeline>
|
|
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>p<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1Base_1aeaaaf24e3948fa7c65b3cc270e8ea943" kindref="member">Base<Box>::partition</ref>(b,<sp/>0,<sp/>n);</highlight></codeline>
|
|
<codeline lineno="54"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>(void)<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>(home)<sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp" kindref="compound">OptProp<Box></ref>(home,b,p,n-p);</highlight></codeline>
|
|
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="56"><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="57"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="58"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="59"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>Box></highlight></codeline>
|
|
<codeline lineno="60"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">size_t</highlight><highlight class="normal"><sp/></highlight></codeline>
|
|
<codeline lineno="61" refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1ac9b538e874db877aba179cb915f0b2fd" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1ac9b538e874db877aba179cb915f0b2fd" kindref="member">OptProp<Box>::dispose</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home)<sp/>{</highlight></codeline>
|
|
<codeline lineno="62"><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=m;<sp/>i--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>b[n+i].cancel(home,<sp/>*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
|
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/>(void)<sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1Base" kindref="compound">Base<Box>::dispose</ref>(home);</highlight></codeline>
|
|
<codeline lineno="65"><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="66"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="67"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="68"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="69"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>Box></highlight></codeline>
|
|
<codeline lineno="70"><highlight class="normal"><sp/><sp/>forceinline</highlight></codeline>
|
|
<codeline lineno="71" refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1a84e3277d88eb3c291d90c81fbbd6d2fd" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1ada76d991753c8232635b77d1b71b70e1" kindref="member">OptProp<Box>::OptProp</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1a5430dfdb1866d9506626cb0e838f0e66" kindref="member">shared</ref>,<sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp" kindref="compound">OptProp<Box></ref>&<sp/>p)<sp/></highlight></codeline>
|
|
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/>:<sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1Base" kindref="compound">Base</ref><Box>(home,<sp/>shared,<sp/>p,<sp/>p.n<sp/>+<sp/>p.m),<sp/>m(p.m)<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/>Box></highlight></codeline>
|
|
<codeline lineno="75"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Actor" kindref="compound">Actor</ref>*<sp/></highlight></codeline>
|
|
<codeline lineno="76" refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1af7f2e7c9f42a84ca01cf1a1f72fb8aff" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1af7f2e7c9f42a84ca01cf1a1f72fb8aff" kindref="member">OptProp<Box>::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_1NoOverlap_1_1OptProp" kindref="compound">OptProp<Box></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/>Box></highlight></codeline>
|
|
<codeline lineno="81"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref><sp/></highlight></codeline>
|
|
<codeline lineno="82" refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1a72211a96da2db76e7d8735c0839433f6" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1OptProp_1a72211a96da2db76e7d8735c0839433f6" kindref="member">OptProp<Box>::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="83"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Region" kindref="compound">Region</ref><sp/>r(home);</highlight></codeline>
|
|
<codeline lineno="84"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classGecode_1_1VarImpView_1a6dced43c3bf8befaf8cd27dbd53bf24c" kindref="member">BoolView::me</ref>(med)<sp/>==<sp/>ME_BOOL_VAL)<sp/>{</highlight></codeline>
|
|
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Eliminate<sp/>excluded<sp/>boxes</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="87"><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=m;<sp/>i--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(b[n+i].excluded())<sp/>{</highlight></codeline>
|
|
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>b[n+i].cancel(home,*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
|
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>b[n+i]<sp/>=<sp/>b[n+(--m)];</highlight></codeline>
|
|
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Reconsider<sp/>optional<sp/>boxes</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(m<sp/>><sp/>0)<sp/>{</highlight></codeline>
|
|
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>p<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1NoOverlap_1_1Base_1aeaaaf24e3948fa7c65b3cc270e8ea943" kindref="member">Base<Box>::partition</ref>(b+n,<sp/>0,<sp/>m);</highlight></codeline>
|
|
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>+=<sp/>p;<sp/>m<sp/>-=<sp/>p;</highlight></codeline>
|
|
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="98"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Number<sp/>of<sp/>disjoint<sp/>boxes</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*<sp/>db<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="101"><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--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>db[i]<sp/>=<sp/>n-1;</highlight></codeline>
|
|
<codeline lineno="103"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Number<sp/>of<sp/>boxes<sp/>to<sp/>be<sp/>eliminated</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>e<sp/>=<sp/>0;</highlight></codeline>
|
|
<codeline lineno="106"><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--;<sp/>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>assert(b[i].mandatory());</highlight></codeline>
|
|
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j=i;<sp/>j--;<sp/>)<sp/></highlight></codeline>
|
|
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(b[i].<ref refid="group__TaskModelIntGeoPacking_1ga38d3dcba5887db04ed6dc3c3f8037e8c" kindref="member">nooverlap</ref>(b[j]))<sp/>{</highlight></codeline>
|
|
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>assert(db[i]<sp/>><sp/>0);<sp/>assert(db[j]<sp/>><sp/>0);</highlight></codeline>
|
|
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(--db[i]<sp/>==<sp/>0)<sp/>e++;</highlight></codeline>
|
|
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(--db[j]<sp/>==<sp/>0)<sp/>e++;</highlight></codeline>
|
|
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">continue</highlight><highlight class="normal">;</highlight></codeline>
|
|
<codeline lineno="114"><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="115"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(b[i].<ref refid="group__TaskModelIntGeoPacking_1ga38d3dcba5887db04ed6dc3c3f8037e8c" kindref="member">nooverlap</ref>(home,b[j]));</highlight></codeline>
|
|
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="118"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(m<sp/>==<sp/>0)<sp/>{</highlight></codeline>
|
|
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(e<sp/>==<sp/>n)</highlight></codeline>
|
|
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>home.<ref refid="group__TaskActorStatus_1gafc19cbf71ed90a9e0b414b875103f4c7" kindref="member">ES_SUBSUMED</ref>(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
|
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>n-1;</highlight></codeline>
|
|
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(e<sp/>><sp/>0)<sp/>{</highlight></codeline>
|
|
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Eliminate<sp/>boxes<sp/>that<sp/>do<sp/>not<sp/>overlap</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(db[i]<sp/>><sp/>0)</highlight></codeline>
|
|
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i--;</highlight></codeline>
|
|
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>b[i].cancel(home,<sp/>*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
|
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>b[i]<sp/>=<sp/>b[--n];<sp/>b[n]<sp/>=<sp/>b[n+m];</highlight></codeline>
|
|
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e--;<sp/>i--;</highlight></codeline>
|
|
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(n<sp/><<sp/>2)</highlight></codeline>
|
|
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>home.<ref refid="group__TaskActorStatus_1gafc19cbf71ed90a9e0b414b875103f4c7" kindref="member">ES_SUBSUMED</ref>(*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
|
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="134"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Check<sp/>whether<sp/>some<sp/>optional<sp/>boxes<sp/>must<sp/>be<sp/>excluded</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="136"><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=m;<sp/>i--;<sp/>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(b[n+i].optional())<sp/>{</highlight></codeline>
|
|
<codeline lineno="138"><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/>j=n;<sp/>j--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(b[n+i].overlap(b[j]))<sp/>{</highlight></codeline>
|
|
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ES_CHECK(b[n+i].exclude(home));</highlight></codeline>
|
|
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>b[n+i].cancel(home,*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
|
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>b[n+i]<sp/>=<sp/>b[n+(--m)];</highlight></codeline>
|
|
<codeline lineno="143"><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="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
|
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>This<sp/>might<sp/>be<sp/>the<sp/>case<sp/>if<sp/>the<sp/>same<sp/>Boolean<sp/>view<sp/>occurs</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>several<sp/>times<sp/>and<sp/>has<sp/>already<sp/>been<sp/>excluded</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>assert(b[n+i].excluded());</highlight></codeline>
|
|
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>b[n+i].cancel(home,*</highlight><highlight class="keyword">this</highlight><highlight class="normal">);</highlight></codeline>
|
|
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>b[n+i]<sp/>=<sp/>b[n+(--m)];</highlight></codeline>
|
|
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="153"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5ac32341b682bca52b8617a8ad004023ef" kindref="member">ES_NOFIX</ref>;</highlight></codeline>
|
|
<codeline lineno="155"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="156"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="157"><highlight class="normal">}}}</highlight></codeline>
|
|
<codeline lineno="158"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="159"><highlight class="normal"></highlight><highlight class="comment">//<sp/>STATISTICS:<sp/>int-prop</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="160"><highlight class="normal"></highlight></codeline>
|
|
</programlisting>
|
|
<location file="/usr/include/gecode/int/no-overlap/opt.hpp"/>
|
|
</compounddef>
|
|
</doxygen>
|