313 lines
59 KiB
XML
313 lines
59 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="nvalues_2graph_8hpp" kind="file">
|
|
<compoundname>graph.hpp</compoundname>
|
|
<includedby refid="nvalues_8hh" local="no">/usr/include/gecode/int/nvalues.hh</includedby>
|
|
<invincdepgraph>
|
|
<node id="13348">
|
|
<label>/usr/include/gecode/int/nvalues.hh</label>
|
|
<link refid="nvalues_8hh_source"/>
|
|
</node>
|
|
<node id="13347">
|
|
<label>/usr/include/gecode/int/nvalues/graph.hpp</label>
|
|
<link refid="nvalues/graph.hpp"/>
|
|
<childnode refid="13348" relation="include">
|
|
</childnode>
|
|
</node>
|
|
</invincdepgraph>
|
|
<innernamespace refid="namespaceGecode">Gecode</innernamespace>
|
|
<innernamespace refid="namespaceGecode_1_1Int">Gecode::Int</innernamespace>
|
|
<innernamespace refid="namespaceGecode_1_1Int_1_1NValues">Gecode::Int::NValues</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-09-07<sp/>17:31:22<sp/>+0200<sp/>(Fri,<sp/>07<sp/>Sep<sp/>2012)<sp/>$<sp/>by<sp/>$Author:<sp/>schulte<sp/>$</highlight></codeline>
|
|
<codeline lineno="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>$Revision:<sp/>13068<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">NValues<sp/>{</highlight></codeline>
|
|
<codeline lineno="39"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="40"><highlight class="normal"><sp/><sp/>forceinline</highlight></codeline>
|
|
<codeline lineno="41" refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a8967d6e10a96137744d8c5e66fec2a6f" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a8967d6e10a96137744d8c5e66fec2a6f" kindref="member">Graph::Graph</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)</highlight></codeline>
|
|
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/>:<sp/>n_matched(0)<sp/>{}</highlight></codeline>
|
|
<codeline lineno="43"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="44"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="45" refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a7c55ee994116ac04b62307b2ea8c0630" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a7c55ee994116ac04b62307b2ea8c0630" kindref="member">Graph::size</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
|
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a3e7ff720562c60178fd76816ea192eab" kindref="member">n_matched</ref>;</highlight></codeline>
|
|
<codeline lineno="47"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="48"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="49"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="50" refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a6145b4bb83c4c7af031fdf73b85f032c" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a6145b4bb83c4c7af031fdf73b85f032c" kindref="member">Graph::init</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="classGecode_1_1Int_1_1ValSet" kindref="compound">ValSet</ref>&<sp/>vs,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1ViewArray" kindref="compound">ViewArray<IntView></ref>&<sp/>x)<sp/>{</highlight></codeline>
|
|
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">ViewValGraph;</highlight></codeline>
|
|
<codeline lineno="52"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref><sp/>=<sp/>x.<ref refid="classGecode_1_1ViewArray_1a65940b23e2457e97607475f8bd8f4ac6" kindref="member">size</ref>()<sp/>+<sp/>vs.<ref refid="classGecode_1_1Int_1_1ValSet_1a24f440a4e82190ad085e117f5b157f8c" kindref="member">size</ref>();</highlight></codeline>
|
|
<codeline lineno="53"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref><sp/>=<sp/>home.<ref refid="group__FuncMemSpace_1gacf6b71739fd13f46d8d27052d714265e" kindref="member">alloc</ref><ViewNode<IntView>*>(<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref>);</highlight></codeline>
|
|
<codeline lineno="54"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Create<sp/>nodes<sp/>corresponding<sp/>to<sp/>the<sp/>value<sp/>set<sp/>vs</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
|
|
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>x.<ref refid="classGecode_1_1ViewArray_1a65940b23e2457e97607475f8bd8f4ac6" kindref="member">size</ref>();</highlight></codeline>
|
|
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ValSet_1_1Ranges" kindref="compound">ValSet::Ranges</ref><sp/>vsr(vs);</highlight></codeline>
|
|
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>ValNode<IntView>**<sp/>v<sp/>=<sp/>&<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aef781ac3c445fa98cf75a029d4da0c03" kindref="member">val</ref>;</highlight></codeline>
|
|
<codeline lineno="60"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(<ref refid="classGecode_1_1Iter_1_1Ranges_1_1ToValues" kindref="compound">Iter::Ranges::ToValues<ValSet::Ranges></ref><sp/>n(vsr);<sp/>n();<sp/>++n)<sp/>{</highlight></codeline>
|
|
<codeline lineno="61"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Create<sp/>view<sp/>node</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="62"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]<sp/>=<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>(home)<sp/>ViewNode<IntView>();</highlight></codeline>
|
|
<codeline lineno="63"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Create<sp/>and<sp/>link<sp/>value<sp/>node</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="64"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ValNode<IntView>*<sp/>nv<sp/>=<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>(home)<sp/>ValNode<IntView>(n.val());</highlight></codeline>
|
|
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*v<sp/>=<sp/>nv;<sp/>v<sp/>=<sp/>nv->next_val_ref();</highlight></codeline>
|
|
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Create<sp/>and<sp/>link<sp/>single<sp/>edge</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Edge<IntView>**<sp/>e<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]-><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1ViewNode_1a4c64acab9339a77c5c77e2048dc250f5" kindref="member">val_edges_ref</ref>();</highlight></codeline>
|
|
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*e<sp/>=<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>(home)<sp/>Edge<IntView>(nv,<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i],NULL);</highlight></codeline>
|
|
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Match<sp/>edge</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(*e)-><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Edge_1acaf62af3a02f99e9a20c5e50aae90f4a" kindref="member">revert</ref>(<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]);<sp/>nv->matching(*e);</highlight></codeline>
|
|
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i++;</highlight></codeline>
|
|
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>*v<sp/>=<sp/>NULL;</highlight></codeline>
|
|
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1ac445d6c6dde2a916c24b218b0376637b" kindref="member">n_val</ref><sp/>=<sp/>vs.<ref refid="classGecode_1_1Int_1_1ValSet_1a24f440a4e82190ad085e117f5b157f8c" kindref="member">size</ref>();</highlight></codeline>
|
|
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a3e7ff720562c60178fd76816ea192eab" kindref="member">n_matched</ref><sp/>=<sp/>vs.<ref refid="classGecode_1_1Int_1_1ValSet_1a24f440a4e82190ad085e117f5b157f8c" kindref="member">size</ref>();</highlight></codeline>
|
|
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>assert(i<sp/>-<sp/>x.<ref refid="classGecode_1_1ViewArray_1a65940b23e2457e97607475f8bd8f4ac6" kindref="member">size</ref>()<sp/>==<sp/>vs.<ref refid="classGecode_1_1Int_1_1ValSet_1a24f440a4e82190ad085e117f5b157f8c" kindref="member">size</ref>());</highlight></codeline>
|
|
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="78"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Initialize<sp/>real<sp/>view<sp/>nodes</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="80"><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>();<sp/>i--;<sp/>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]<sp/>=<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>(home)<sp/>ViewNode<IntView>(x[i]);</highlight></codeline>
|
|
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a1aedc7f51f64a5e3e055821701516338" kindref="member">ViewValGraph::Graph<IntView>::init</ref>(home,<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]);</highlight></codeline>
|
|
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="84"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Match<sp/>the<sp/>real<sp/>view<sp/>nodes,<sp/>if<sp/>possible</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Region" kindref="compound">Region</ref><sp/>r(home);</highlight></codeline>
|
|
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Support_1_1StaticStack" kindref="compound">ViewNodeStack</ref><sp/>m(r,<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref>);</highlight></codeline>
|
|
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>x.<ref refid="classGecode_1_1ViewArray_1a65940b23e2457e97607475f8bd8f4ac6" kindref="member">size</ref>();<sp/>i--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1acf0e0fc364b1dbf38465873c6d8e3213" kindref="member">match</ref>(m,<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]))</highlight></codeline>
|
|
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a3e7ff720562c60178fd76816ea192eab" kindref="member">n_matched</ref>++;</highlight></codeline>
|
|
<codeline lineno="91"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="92"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="93"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="94" refid="classGecode_1_1Int_1_1NValues_1_1Graph_1af50bc03d0bbb977c447d15922d2471a0" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1NValues_1_1Graph_1af50bc03d0bbb977c447d15922d2471a0" kindref="member">Graph::sync</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home)<sp/>{</highlight></codeline>
|
|
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">ViewValGraph;</highlight></codeline>
|
|
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Region" kindref="compound">Region</ref><sp/>r(home);</highlight></codeline>
|
|
<codeline lineno="97"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Whether<sp/>to<sp/>rematch</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>rematch<sp/>=<sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
|
|
<codeline lineno="100"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Synchronize<sp/>nodes</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref>;<sp/>i--;<sp/>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>ViewNode<IntView>*<sp/>x<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i];</highlight></codeline>
|
|
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Skip<sp/>faked<sp/>view<sp/>nodes,<sp/>they<sp/>correspond<sp/>to<sp/>values<sp/>in<sp/>the<sp/>value<sp/>set</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!x->fake())<sp/>{</highlight></codeline>
|
|
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x->changed())<sp/>{</highlight></codeline>
|
|
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewRanges_3_01IntView_01_4" kindref="compound">ViewRanges<IntView></ref><sp/>r(x->view());</highlight></codeline>
|
|
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Edge<IntView>*<sp/><sp/>m<sp/>=<sp/>x->matched()<sp/>?<sp/>x->edge_fst()<sp/>:<sp/>NULL;</highlight></codeline>
|
|
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Edge<IntView>**<sp/>p<sp/>=<sp/>x->val_edges_ref();</highlight></codeline>
|
|
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Edge<IntView>*<sp/><sp/>e<sp/>=<sp/>*p;</highlight></codeline>
|
|
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">do</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
|
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(e->val(x)->val()<sp/><<sp/>r.min())<sp/>{</highlight></codeline>
|
|
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Skip<sp/>edge</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e->unlink();<sp/>e->mark();</highlight></codeline>
|
|
<codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e<sp/>=<sp/>e->next_edge();</highlight></codeline>
|
|
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*p<sp/>=<sp/>e;</highlight></codeline>
|
|
<codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>assert(r.min()<sp/>==<sp/>e->val(x)->val());</highlight></codeline>
|
|
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>This<sp/>edges<sp/>must<sp/>be<sp/>kept</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><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/>j=r.width();<sp/>j--;<sp/>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e-><ref refid="classGecode_1_1Region_1ab6fb7233ea7822b457558d78d808a46c" kindref="member">free</ref>();</highlight></codeline>
|
|
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>p<sp/>=<sp/>e->next_edge_ref();</highlight></codeline>
|
|
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e<sp/>=<sp/>e->next_edge();</highlight></codeline>
|
|
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>++r;</highlight></codeline>
|
|
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(r());</highlight></codeline>
|
|
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*p<sp/>=<sp/>NULL;</highlight></codeline>
|
|
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(e<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
|
|
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e->unlink();<sp/>e->mark();</highlight></codeline>
|
|
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e<sp/>=<sp/>e->next_edge();</highlight></codeline>
|
|
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((m<sp/>!=<sp/>NULL)<sp/>&&<sp/>m->marked())<sp/>{</highlight></codeline>
|
|
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Matching<sp/>has<sp/>been<sp/>deleted!</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>m->val(x)->matching(NULL);</highlight></codeline>
|
|
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rematch<sp/>=<sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
|
|
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a3e7ff720562c60178fd76816ea192eab" kindref="member">n_matched</ref>--;</highlight></codeline>
|
|
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="138"><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="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Just<sp/>free<sp/>edges</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(Edge<IntView>*<sp/>e=x->val_edges();<sp/>e<sp/>!=<sp/>NULL;<sp/>e<sp/>=<sp/>e->next_edge())</highlight></codeline>
|
|
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e->free();</highlight></codeline>
|
|
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="145"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="146"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rematch)<sp/>{</highlight></codeline>
|
|
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Support_1_1StaticStack" kindref="compound">ViewNodeStack</ref><sp/>m(r,<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref>);</highlight></codeline>
|
|
<codeline lineno="148"><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/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref>;<sp/>i--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]->matched()<sp/>&&<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1acf0e0fc364b1dbf38465873c6d8e3213" kindref="member">match</ref>(m,<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]))</highlight></codeline>
|
|
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a3e7ff720562c60178fd76816ea192eab" kindref="member">n_matched</ref>++;</highlight></codeline>
|
|
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="152"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="153"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="154"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="155"><highlight class="normal"><sp/><sp/>Graph::mark(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home)<sp/>{</highlight></codeline>
|
|
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">ViewValGraph;</highlight></codeline>
|
|
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Region" kindref="compound">Region</ref><sp/>r(home);</highlight></codeline>
|
|
<codeline lineno="158"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n_view_visited<sp/>=<sp/>0;</highlight></codeline>
|
|
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
|
|
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Marks<sp/>all<sp/>edges<sp/>as<sp/>used<sp/>that<sp/>are<sp/>on<sp/>simple<sp/>paths<sp/>in<sp/>the<sp/>graph</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>that<sp/>start<sp/>from<sp/>a<sp/>free<sp/>value<sp/>node<sp/>by<sp/>depth-first-search</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Support_1_1StaticStack" kindref="compound">Support::StaticStack<ValNode<IntView></ref>*,<ref refid="classGecode_1_1Region" kindref="compound">Region</ref>><sp/>visit(r,<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1ac445d6c6dde2a916c24b218b0376637b" kindref="member">n_val</ref>);</highlight></codeline>
|
|
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
|
|
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Insert<sp/>all<sp/>free<sp/>value<sp/>nodes</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a7704c702ba3530adcd918654cdac1a24" kindref="member">count</ref>++;</highlight></codeline>
|
|
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
|
|
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ValNode<IntView>**<sp/>v<sp/>=<sp/>&<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aef781ac3c445fa98cf75a029d4da0c03" kindref="member">val</ref>;</highlight></codeline>
|
|
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(*v<sp/>!=<sp/>NULL)</highlight></codeline>
|
|
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Is<sp/>the<sp/>node<sp/>free?</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!(*v)->matching())<sp/>{</highlight></codeline>
|
|
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Eliminate<sp/>empty<sp/>value<sp/>nodes</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((*v)->empty())<sp/>{</highlight></codeline>
|
|
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*v<sp/>=<sp/>(*v)-><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1ValNode_1a0fa1b950f677fbf0c973723c7eacd55c" kindref="member">next_val</ref>();</highlight></codeline>
|
|
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1ac445d6c6dde2a916c24b218b0376637b" kindref="member">n_val</ref>--;</highlight></codeline>
|
|
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
|
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(*v)->min<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a7704c702ba3530adcd918654cdac1a24" kindref="member">count</ref>;</highlight></codeline>
|
|
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>visit.push(*v);</highlight></codeline>
|
|
<codeline lineno="179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>v<sp/>=<sp/>(*v)->next_val_ref();</highlight></codeline>
|
|
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
|
<codeline lineno="182"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>v<sp/>=<sp/>(*v)->next_val_ref();</highlight></codeline>
|
|
<codeline lineno="183"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
|
|
<codeline lineno="186"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Invariant:<sp/>only<sp/>value<sp/>nodes<sp/>are<sp/>on<sp/>the<sp/>stack!</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="187"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(!visit.empty())<sp/>{</highlight></codeline>
|
|
<codeline lineno="188"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ValNode<IntView>*<sp/>n<sp/>=<sp/>visit.pop();</highlight></codeline>
|
|
<codeline lineno="189"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(Edge<IntView>*<sp/>e<sp/>=<sp/>n->edge_fst();<sp/>e<sp/>!=<sp/>n->edge_lst();<sp/></highlight></codeline>
|
|
<codeline lineno="190"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e<sp/>=<sp/>e->next())<sp/>{</highlight></codeline>
|
|
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Is<sp/>the<sp/>view<sp/>node<sp/>is<sp/>matched:<sp/>the<sp/>path<sp/>must<sp/>be<sp/>alternating!</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ViewNode<IntView>*<sp/>x<sp/>=<sp/>e->view(n);</highlight></codeline>
|
|
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x->matched())<sp/>{</highlight></codeline>
|
|
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Mark<sp/>the<sp/>edge<sp/>as<sp/>used</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e->use();</highlight></codeline>
|
|
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x->min<sp/><<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a7704c702ba3530adcd918654cdac1a24" kindref="member">count</ref>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n_view_visited++;</highlight></codeline>
|
|
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x->min<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a7704c702ba3530adcd918654cdac1a24" kindref="member">count</ref>;</highlight></codeline>
|
|
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>assert(x->edge_fst()->next()<sp/>==<sp/>x->edge_lst());</highlight></codeline>
|
|
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ValNode<IntView>*<sp/>m<sp/>=<sp/>x->edge_fst()->val(x);</highlight></codeline>
|
|
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x->edge_fst()->use();</highlight></codeline>
|
|
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(m->min<sp/><<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a7704c702ba3530adcd918654cdac1a24" kindref="member">count</ref>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>m->min<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a7704c702ba3530adcd918654cdac1a24" kindref="member">count</ref>;</highlight></codeline>
|
|
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>visit.push(m);</highlight></codeline>
|
|
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
|
|
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="212"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="213"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(n_view_visited<sp/><<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="214"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Mark<sp/>all<sp/>edges<sp/>as<sp/>used<sp/>starting<sp/>from<sp/>a<sp/>free<sp/>view<sp/>node<sp/>on</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>an<sp/>alternating<sp/>path<sp/>by<sp/>depth-first<sp/>search.</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>Support::StaticStack<ViewNode<IntView>*,Region><sp/>visit(r,<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref>);</highlight></codeline>
|
|
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
|
|
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Insert<sp/>all<sp/>free<sp/>view<sp/>nodes</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a7704c702ba3530adcd918654cdac1a24" kindref="member">count</ref>++;</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">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref>;<sp/>i--;<sp/>)</highlight></codeline>
|
|
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]->matched())<sp/>{</highlight></codeline>
|
|
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]->min<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a7704c702ba3530adcd918654cdac1a24" kindref="member">count</ref>;</highlight></codeline>
|
|
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>visit.push(<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]);</highlight></codeline>
|
|
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="225"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Invariant:<sp/>only<sp/>view<sp/>nodes<sp/>are<sp/>on<sp/>the<sp/>stack!</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(!visit.empty())<sp/>{</highlight></codeline>
|
|
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n_view_visited++;</highlight></codeline>
|
|
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ViewNode<IntView>*<sp/>x<sp/>=<sp/>visit.pop();</highlight></codeline>
|
|
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(Edge<IntView>*<sp/>e<sp/>=<sp/>x->val_edges();<sp/>e<sp/>!=<sp/>NULL;<sp/>e<sp/>=<sp/>e->next_edge())</highlight></codeline>
|
|
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Consider<sp/>only<sp/>free<sp/>edges</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(e<sp/>!=<sp/>x->edge_fst())<sp/>{</highlight></codeline>
|
|
<codeline lineno="233"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ValNode<IntView>*<sp/>n<sp/>=<sp/>e->val(x);</highlight></codeline>
|
|
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Is<sp/>there<sp/>a<sp/>matched<sp/>edge<sp/>from<sp/>the<sp/>value<sp/>node<sp/>to<sp/>a<sp/>view<sp/>node?</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(n->matching()<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
|
|
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e->use();</highlight></codeline>
|
|
<codeline lineno="237"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n->matching()->use();</highlight></codeline>
|
|
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ViewNode<IntView>*<sp/>y<sp/>=<sp/>n->matching()->view(n);</highlight></codeline>
|
|
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(y->min<sp/><<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a7704c702ba3530adcd918654cdac1a24" kindref="member">count</ref>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>y->min<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a7704c702ba3530adcd918654cdac1a24" kindref="member">count</ref>;</highlight></codeline>
|
|
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>visit.push(y);</highlight></codeline>
|
|
<codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="245"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="246"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="248"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="249"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(n_view_visited<sp/><<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a54f3bb8fd8bcbb86d466dc6030f5225f" kindref="member">scc</ref>(home);</highlight></codeline>
|
|
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;</highlight></codeline>
|
|
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
|
|
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">false</highlight><highlight class="normal">;</highlight></codeline>
|
|
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="255"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="256"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="257"><highlight class="normal"><sp/><sp/>forceinline<sp/><ref refid="namespaceGecode_1ab278aee34126d2f13c5429ee3c4ed3b5" kindref="member">ExecStatus</ref></highlight></codeline>
|
|
<codeline lineno="258" refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a4aad33ebfbfaebb964d31e3176072a9e" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Int_1_1NValues_1_1Graph_1a4aad33ebfbfaebb964d31e3176072a9e" kindref="member">Graph::prune</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>&<sp/>home)<sp/>{</highlight></codeline>
|
|
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">ViewValGraph;</highlight></codeline>
|
|
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Tell<sp/>constraints<sp/>and<sp/>also<sp/>eliminate<sp/>nodes<sp/>and<sp/>edges</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref>;<sp/>i--;<sp/>)<sp/>{</highlight></codeline>
|
|
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>ViewNode<IntView>*<sp/>x<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i];</highlight></codeline>
|
|
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!x->fake())<sp/>{</highlight></codeline>
|
|
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(x->matched()<sp/>&&<sp/>!x->edge_fst()->used(x))<sp/>{</highlight></codeline>
|
|
<codeline lineno="265"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ME_CHECK(x->view().eq(home,x->edge_fst()->val(x)->val()));</highlight></codeline>
|
|
<codeline lineno="266"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>x->edge_fst()->val(x)->matching(NULL);</highlight></codeline>
|
|
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(Edge<IntView>*<sp/>e<sp/>=<sp/>x->val_edges();<sp/>e<sp/>!=<sp/>NULL;<sp/>e=e->next_edge())</highlight></codeline>
|
|
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>e->unlink();</highlight></codeline>
|
|
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[i]<sp/>=<sp/><ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1a952bd906303f4a714f83f7dd262a1fe9" kindref="member">view</ref>[--<ref refid="classGecode_1_1Int_1_1ViewValGraph_1_1Graph_1aaae3ec72101aecd38b7c422576d06552" kindref="member">n_view</ref>];</highlight></codeline>
|
|
<codeline lineno="270"><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="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>IterPruneVal<IntView><sp/>pv(x);</highlight></codeline>
|
|
<codeline lineno="272"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>GECODE_ME_CHECK(x->view().minus_v(home,pv,</highlight><highlight class="keyword">false</highlight><highlight class="normal">));</highlight></codeline>
|
|
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="276"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="277"><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="278"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="279"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="280"><highlight class="normal">}}}</highlight></codeline>
|
|
<codeline lineno="281"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="282"><highlight class="normal"></highlight><highlight class="comment">//<sp/>STATISTICS:<sp/>int-prop</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="283"><highlight class="normal"></highlight></codeline>
|
|
</programlisting>
|
|
<location file="/usr/include/gecode/int/nvalues/graph.hpp"/>
|
|
</compounddef>
|
|
</doxygen>
|