324 lines
50 KiB
XML
324 lines
50 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="gist_2node_8hpp" kind="file">
|
||
|
<compoundname>node.hpp</compoundname>
|
||
|
<includedby refid="visualnode_8hh" local="no">/usr/include/gecode/gist/visualnode.hh</includedby>
|
||
|
<invincdepgraph>
|
||
|
<node id="7758">
|
||
|
<label>/usr/include/gecode/gist/mainwindow.hh</label>
|
||
|
<link refid="mainwindow_8hh_source"/>
|
||
|
</node>
|
||
|
<node id="7755">
|
||
|
<label>/usr/include/gecode/gist/nodecursor.hh</label>
|
||
|
<link refid="nodecursor_8hh_source"/>
|
||
|
<childnode refid="7754" relation="include">
|
||
|
</childnode>
|
||
|
<childnode refid="7753" relation="include">
|
||
|
</childnode>
|
||
|
</node>
|
||
|
<node id="7752">
|
||
|
<label>/usr/include/gecode/gist/visualnode.hh</label>
|
||
|
<link refid="visualnode_8hh_source"/>
|
||
|
<childnode refid="7753" relation="include">
|
||
|
</childnode>
|
||
|
<childnode refid="7755" relation="include">
|
||
|
</childnode>
|
||
|
<childnode refid="7756" relation="include">
|
||
|
</childnode>
|
||
|
<childnode refid="7760" relation="include">
|
||
|
</childnode>
|
||
|
</node>
|
||
|
<node id="7757">
|
||
|
<label>/usr/include/gecode/gist/qtgist.hh</label>
|
||
|
<link refid="qtgist_8hh_source"/>
|
||
|
<childnode refid="7758" relation="include">
|
||
|
</childnode>
|
||
|
<childnode refid="7759" relation="include">
|
||
|
</childnode>
|
||
|
</node>
|
||
|
<node id="7751">
|
||
|
<label>/usr/include/gecode/gist/node.hpp</label>
|
||
|
<link refid="gist/node.hpp"/>
|
||
|
<childnode refid="7752" relation="include">
|
||
|
</childnode>
|
||
|
</node>
|
||
|
<node id="7760">
|
||
|
<label>/usr/include/gecode/gist/treecanvas.hh</label>
|
||
|
<link refid="treecanvas_8hh_source"/>
|
||
|
<childnode refid="7757" relation="include">
|
||
|
</childnode>
|
||
|
</node>
|
||
|
<node id="7756">
|
||
|
<label>/usr/include/gecode/gist/nodestats.hh</label>
|
||
|
<link refid="nodestats_8hh_source"/>
|
||
|
<childnode refid="7757" relation="include">
|
||
|
</childnode>
|
||
|
</node>
|
||
|
<node id="7759">
|
||
|
<label>/usr/include/gecode/gist/nodewidget.hh</label>
|
||
|
<link refid="nodewidget_8hh_source"/>
|
||
|
</node>
|
||
|
<node id="7753">
|
||
|
<label>/usr/include/gecode/gist/layoutcursor.hh</label>
|
||
|
<link refid="layoutcursor_8hh_source"/>
|
||
|
<childnode refid="7754" relation="include">
|
||
|
</childnode>
|
||
|
</node>
|
||
|
<node id="7754">
|
||
|
<label>/usr/include/gecode/gist/drawingcursor.hh</label>
|
||
|
<link refid="drawingcursor_8hh_source"/>
|
||
|
</node>
|
||
|
</invincdepgraph>
|
||
|
<innernamespace refid="namespaceGecode">Gecode</innernamespace>
|
||
|
<innernamespace refid="namespaceGecode_1_1Gist">Gecode::Gist</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/>Guido<sp/>Tack<sp/><tack@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/>Guido<sp/>Tack,<sp/>2006</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/>2013-05-06<sp/>09:02:17<sp/>+0200<sp/>(Mon,<sp/>06<sp/>May<sp/>2013)<sp/>$<sp/>by<sp/>$Author:<sp/>tack<sp/>$</highlight></codeline>
|
||
|
<codeline lineno="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>$Revision:<sp/>13613<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/>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/>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/>"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/>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/>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/>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/>the<sp/>following<sp/>conditions:</highlight></codeline>
|
||
|
<codeline lineno="24"><highlight class="comment"><sp/>*</highlight></codeline>
|
||
|
<codeline lineno="25"><highlight class="comment"><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/>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/>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/>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/>MERCHANTABILITY,<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>AND</highlight></codeline>
|
||
|
<codeline lineno="31"><highlight class="comment"><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/>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/>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/>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">Gist<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/>T></highlight></codeline>
|
||
|
<codeline lineno="41"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="42"><highlight class="normal"><sp/><sp/>NodeAllocatorBase<T>::allocate(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/>cur_b++;</highlight></codeline>
|
||
|
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/>cur_t<sp/>=<sp/>0;</highlight></codeline>
|
||
|
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(cur_b==n)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="46"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>oldn<sp/>=<sp/>n;</highlight></codeline>
|
||
|
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>=<sp/></highlight><highlight class="keyword">static_cast<</highlight><highlight class="keywordtype">int</highlight><highlight class="keyword">></highlight><highlight class="normal">(n*1.5+1.0);</highlight></codeline>
|
||
|
<codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>b<sp/>=<sp/><ref refid="namespaceGecode_1a6595368d634d0db095ad8dee79f14d2c" kindref="member">heap</ref>.<ref refid="classGecode_1_1Heap_1afd4c30033c627eedd31f2308466b2ead" kindref="member">realloc</ref><Block*>(b,oldn,n);</highlight></codeline>
|
||
|
<codeline lineno="49"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="50"><highlight class="normal"><sp/><sp/><sp/><sp/>b[cur_b]<sp/>=<sp/></highlight><highlight class="keyword">static_cast<</highlight><highlight class="normal">Block*</highlight><highlight class="keyword">></highlight><highlight class="normal">(<ref refid="namespaceGecode_1a6595368d634d0db095ad8dee79f14d2c" kindref="member">heap</ref>.<ref refid="classGecode_1_1Heap_1a55baad1786a0407ba0321cd37745a7a6" kindref="member">ralloc</ref>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(Block)));</highlight></codeline>
|
||
|
<codeline lineno="51"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="52"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="53"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
||
|
<codeline lineno="54" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1ae040f534edc18fa6d37c292d0dc6b55c" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1ae040f534edc18fa6d37c292d0dc6b55c" kindref="member">NodeAllocatorBase<T>::NodeAllocatorBase</ref>(</highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="namespaceGecode_1_1Gist_1a82664735df61360a285ea94625afbd71" kindref="member">bab</ref>)</highlight></codeline>
|
||
|
<codeline lineno="55"><highlight class="normal"><sp/><sp/><sp/><sp/>:<sp/>_bab(bab)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/>b<sp/>=<sp/><ref refid="namespaceGecode_1a6595368d634d0db095ad8dee79f14d2c" kindref="member">heap</ref>.<ref refid="classGecode_1_1Heap_1a9421bccf9db4f773fdef71e17d09ad51" kindref="member">alloc</ref><Block*>(10);</highlight></codeline>
|
||
|
<codeline lineno="57"><highlight class="normal"><sp/><sp/><sp/><sp/>n<sp/>=<sp/>10;</highlight></codeline>
|
||
|
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/>cur_b<sp/>=<sp/>-1;</highlight></codeline>
|
||
|
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/>cur_t<sp/>=<sp/>NodeBlockSize-1;</highlight></codeline>
|
||
|
<codeline lineno="60"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="61"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="62"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
||
|
<codeline lineno="63" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1aef442d3acdd9c5e9f971ddf7e0ec1979" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1aef442d3acdd9c5e9f971ddf7e0ec1979" kindref="member">NodeAllocatorBase<T>::~NodeAllocatorBase</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="64"><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=cur_b+1;<sp/>i--;)</highlight></codeline>
|
||
|
<codeline lineno="65"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="namespaceGecode_1a6595368d634d0db095ad8dee79f14d2c" kindref="member">heap</ref>.<ref refid="classGecode_1_1Heap_1aa424ffe00ff3f52d7e66a5766db638bf" kindref="member">rfree</ref>(b[i]);</highlight></codeline>
|
||
|
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="namespaceGecode_1a6595368d634d0db095ad8dee79f14d2c" kindref="member">heap</ref>.<ref refid="classGecode_1_1Heap_1a896fd2ab9d4304ee4f8b90de66291add" kindref="member">free</ref><Block*>(b,n);</highlight></codeline>
|
||
|
<codeline lineno="67"><highlight class="normal"><sp/><sp/>}</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/>T></highlight></codeline>
|
||
|
<codeline lineno="70"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="71" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a61c36d13faadc2db2d40a690650b47ca" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase" kindref="compound">NodeAllocatorBase<T>::allocate</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>p)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/>cur_t++;</highlight></codeline>
|
||
|
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(cur_t==NodeBlockSize)</highlight></codeline>
|
||
|
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>allocate();</highlight></codeline>
|
||
|
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>(&b[cur_b]->b[cur_t])<sp/>T(p);</highlight></codeline>
|
||
|
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/>b[cur_b]->best[cur_t]<sp/>=<sp/>-1;</highlight></codeline>
|
||
|
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>cur_b*NodeBlockSize+cur_t;</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/>T></highlight></codeline>
|
||
|
<codeline lineno="81"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="82" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a990684a755abab6ba9aa2511684d2fcc" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase" kindref="compound">NodeAllocatorBase<T>::allocate</ref>(<ref refid="classGecode_1_1Space" kindref="compound">Space</ref>*<sp/>root)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/>cur_t++;</highlight></codeline>
|
||
|
<codeline lineno="84"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(cur_t==NodeBlockSize)</highlight></codeline>
|
||
|
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>allocate();</highlight></codeline>
|
||
|
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/>(&b[cur_b]->b[cur_t])<sp/>T(root);</highlight></codeline>
|
||
|
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/>b[cur_b]->best[cur_t]<sp/>=<sp/>-1;</highlight></codeline>
|
||
|
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>cur_b*NodeBlockSize+cur_t;</highlight></codeline>
|
||
|
<codeline lineno="89"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="90"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="91"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
||
|
<codeline lineno="92"><highlight class="normal"><sp/><sp/>forceinline<sp/>T*</highlight></codeline>
|
||
|
<codeline lineno="93" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a2410f2988e6dcc2d13c76ca91ee70701" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a2410f2988e6dcc2d13c76ca91ee70701" kindref="member">NodeAllocatorBase<T>::operator []</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
||
|
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/>assert(i/NodeBlockSize<sp/><<sp/>n);</highlight></codeline>
|
||
|
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/>assert(i/NodeBlockSize<sp/><<sp/>cur_b<sp/>||<sp/>i%NodeBlockSize<sp/><=<sp/>cur_t);</highlight></codeline>
|
||
|
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>&(b[i/NodeBlockSize]->b[i%NodeBlockSize]);</highlight></codeline>
|
||
|
<codeline lineno="97"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="98"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="99"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
||
|
<codeline lineno="100"><highlight class="normal"><sp/><sp/>forceinline<sp/>T*</highlight></codeline>
|
||
|
<codeline lineno="101" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a66c363673c91a4df4e664bd4583543d3" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a66c363673c91a4df4e664bd4583543d3" kindref="member">NodeAllocatorBase<T>::best</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
||
|
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/>assert(i/NodeBlockSize<sp/><<sp/>n);</highlight></codeline>
|
||
|
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/>assert(i/NodeBlockSize<sp/><<sp/>cur_b<sp/>||<sp/>i%NodeBlockSize<sp/><=<sp/>cur_t);</highlight></codeline>
|
||
|
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>bi<sp/>=<sp/>b[i/NodeBlockSize]->best[i%NodeBlockSize];</highlight></codeline>
|
||
|
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>bi<sp/>==<sp/>-1<sp/>?<sp/>NULL<sp/>:<sp/>(*this)[bi];</highlight></codeline>
|
||
|
<codeline lineno="106"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="107"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="108"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
||
|
<codeline lineno="109"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="110" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a190c751a1e903d1ad9e6250fb254e73b" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a190c751a1e903d1ad9e6250fb254e73b" kindref="member">NodeAllocatorBase<T>::setBest</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>best)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/>assert(i/NodeBlockSize<sp/><<sp/>n);</highlight></codeline>
|
||
|
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/>assert(i/NodeBlockSize<sp/><<sp/>cur_b<sp/>||<sp/>i%NodeBlockSize<sp/><=<sp/>cur_t);</highlight></codeline>
|
||
|
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/>b[i/NodeBlockSize]->best[i%NodeBlockSize]<sp/>=<sp/>best;</highlight></codeline>
|
||
|
<codeline lineno="114"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="115"><highlight class="normal"><sp/><sp/></highlight></codeline>
|
||
|
<codeline lineno="116"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
||
|
<codeline lineno="117"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="118" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1ada874c939cc3c2e2bb5e35df806600b2" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1ada874c939cc3c2e2bb5e35df806600b2" kindref="member">NodeAllocatorBase<T>::bab</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="119"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>_bab;</highlight></codeline>
|
||
|
<codeline lineno="120"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="121"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="122"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
||
|
<codeline lineno="123"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="124" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a9a8cd08959e931fb72d56d8642b70d50" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a9a8cd08959e931fb72d56d8642b70d50" kindref="member">NodeAllocatorBase<T>::showLabels</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="125"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>!labels.isEmpty();</highlight></codeline>
|
||
|
<codeline lineno="126"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="127"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="128"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
||
|
<codeline lineno="129"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="130" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1afd56672dce9bee17affc58f03d3c4a6b" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1afd56672dce9bee17affc58f03d3c4a6b" kindref="member">NodeAllocatorBase<T>::hasLabel</ref>(T*<sp/>n)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
||
|
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>labels.contains(n);</highlight></codeline>
|
||
|
<codeline lineno="132"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="133"><highlight class="normal"><sp/><sp/></highlight></codeline>
|
||
|
<codeline lineno="134"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
||
|
<codeline lineno="135"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="136" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1aab2885a08fcac2db7223d13f5f577b63" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1aab2885a08fcac2db7223d13f5f577b63" kindref="member">NodeAllocatorBase<T>::setLabel</ref>(T*<sp/>n,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>QString&<sp/>l)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/>labels[n]<sp/>=<sp/>l;</highlight></codeline>
|
||
|
<codeline lineno="138"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="139"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="140"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
||
|
<codeline lineno="141"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="142" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1ae4441f9852b5c85731ae5136546b911e" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1ae4441f9852b5c85731ae5136546b911e" kindref="member">NodeAllocatorBase<T>::clearLabel</ref>(T*<sp/>n)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/>labels.remove(n);</highlight></codeline>
|
||
|
<codeline lineno="144"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="145"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="146"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>T></highlight></codeline>
|
||
|
<codeline lineno="147"><highlight class="normal"><sp/><sp/>QString</highlight></codeline>
|
||
|
<codeline lineno="148" refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a0f328f45b986ec07b043d0382bd20b3f" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase_1a0f328f45b986ec07b043d0382bd20b3f" kindref="member">NodeAllocatorBase<T>::getLabel</ref>(T*<sp/>n)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
||
|
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>labels.value(n);</highlight></codeline>
|
||
|
<codeline lineno="150"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="151"><highlight class="normal"><sp/><sp/></highlight></codeline>
|
||
|
<codeline lineno="152"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="153"><highlight class="normal"><sp/><sp/>Node::getTag(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><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/></highlight><highlight class="keyword">static_cast<</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="keyword">></highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="155"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>(</highlight><highlight class="keyword">reinterpret_cast<</highlight><highlight class="normal">ptrdiff_t</highlight><highlight class="keyword">></highlight><highlight class="normal">(childrenOrFirstChild)<sp/>&<sp/>3);</highlight></codeline>
|
||
|
<codeline lineno="156"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="157"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="158"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="159"><highlight class="normal"><sp/><sp/>Node::setTag(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>tag)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/>assert(tag<sp/><=<sp/>3);</highlight></codeline>
|
||
|
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/>assert(getTag()<sp/>==<sp/>UNDET);</highlight></codeline>
|
||
|
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/>childrenOrFirstChild<sp/>=<sp/></highlight><highlight class="keyword">reinterpret_cast<</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*</highlight><highlight class="keyword">></highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>(<sp/>(</highlight><highlight class="keyword">reinterpret_cast<</highlight><highlight class="normal">ptrdiff_t</highlight><highlight class="keyword">></highlight><highlight class="normal">(childrenOrFirstChild)<sp/>&<sp/>~(3))<sp/>|<sp/>tag);</highlight></codeline>
|
||
|
<codeline lineno="164"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="165"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="166"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*</highlight></codeline>
|
||
|
<codeline lineno="167"><highlight class="normal"><sp/><sp/>Node::getPtr(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
||
|
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">reinterpret_cast<</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*</highlight><highlight class="keyword">></highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>(</highlight><highlight class="keyword">reinterpret_cast<</highlight><highlight class="normal">ptrdiff_t</highlight><highlight class="keyword">></highlight><highlight class="normal">(childrenOrFirstChild)<sp/>&<sp/>~(3));</highlight></codeline>
|
||
|
<codeline lineno="170"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="171"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="172"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="173"><highlight class="normal"><sp/><sp/>Node::getFirstChild(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
||
|
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static_cast<</highlight><highlight class="keywordtype">int</highlight><highlight class="keyword">></highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>((</highlight><highlight class="keyword">reinterpret_cast<</highlight><highlight class="normal">ptrdiff_t</highlight><highlight class="keyword">></highlight><highlight class="normal">(childrenOrFirstChild)<sp/>&<sp/>~(3))<sp/>>><sp/>2);</highlight></codeline>
|
||
|
<codeline lineno="176"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="177"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="178"><highlight class="normal"><sp/><sp/>forceinline</highlight></codeline>
|
||
|
<codeline lineno="179" refid="classGecode_1_1Gist_1_1Node_1a71b358f00310f2776ebfe4c491e4399d" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1Node_1a71b358f00310f2776ebfe4c491e4399d" kindref="member">Node::Node</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>p,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>failed)<sp/>:<sp/>parent(p)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/>childrenOrFirstChild<sp/>=<sp/>NULL;</highlight></codeline>
|
||
|
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/>noOfChildren<sp/>=<sp/>0;</highlight></codeline>
|
||
|
<codeline lineno="182"><highlight class="normal"><sp/><sp/><sp/><sp/>setTag(failed<sp/>?<sp/>LEAF<sp/>:<sp/>UNDET);</highlight></codeline>
|
||
|
<codeline lineno="183"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="184"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="185"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="186" refid="classGecode_1_1Gist_1_1Node_1af832b649d232c4d03b6fcf534c3482e7" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1Node_1af832b649d232c4d03b6fcf534c3482e7" kindref="member">Node::getParent</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="187"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>parent;</highlight></codeline>
|
||
|
<codeline lineno="188"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="189"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="190"><highlight class="normal"><sp/><sp/>forceinline<sp/><ref refid="classGecode_1_1Gist_1_1VisualNode" kindref="compound">VisualNode</ref>*</highlight></codeline>
|
||
|
<codeline lineno="191" refid="classGecode_1_1Gist_1_1Node_1a20e1a0cd69047563508f91e3fca0d5c2" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1Node_1af832b649d232c4d03b6fcf534c3482e7" kindref="member">Node::getParent</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase" kindref="compound">NodeAllocator</ref>&<sp/>na)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
||
|
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>parent<sp/><<sp/>0<sp/>?<sp/>NULL<sp/>:<sp/>na[parent];</highlight></codeline>
|
||
|
<codeline lineno="193"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="194"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="195"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="196" refid="classGecode_1_1Gist_1_1Node_1a3c539ac10e753095aeafa88722b9dd37" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1Node_1a3c539ac10e753095aeafa88722b9dd37" kindref="member">Node::isUndetermined</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>getTag()<sp/>==<sp/>UNDET;<sp/>}</highlight></codeline>
|
||
|
<codeline lineno="197"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="198"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="199" refid="classGecode_1_1Gist_1_1Node_1a81a3ee39115b6771a4d63edfeef2fe47" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1Node_1a81a3ee39115b6771a4d63edfeef2fe47" kindref="member">Node::getChild</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
||
|
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/>assert(getTag()<sp/>!=<sp/>UNDET<sp/>&&<sp/>getTag()<sp/>!=<sp/>LEAF);</highlight></codeline>
|
||
|
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(getTag()<sp/>==<sp/>TWO_CHILDREN)<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>assert(n<sp/>!=<sp/>1<sp/>||<sp/>noOfChildren<sp/><=<sp/>0);</highlight></codeline>
|
||
|
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>n<sp/>==<sp/>0<sp/>?<sp/>getFirstChild()<sp/>:<sp/>-noOfChildren;</highlight></codeline>
|
||
|
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/>assert(n<sp/><<sp/>noOfChildren);</highlight></codeline>
|
||
|
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">static_cast<</highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*</highlight><highlight class="keyword">></highlight><highlight class="normal">(getPtr())[n];</highlight></codeline>
|
||
|
<codeline lineno="207"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="208"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="209"><highlight class="normal"><sp/><sp/>forceinline<sp/><ref refid="classGecode_1_1Gist_1_1VisualNode" kindref="compound">VisualNode</ref>*</highlight></codeline>
|
||
|
<codeline lineno="210" refid="classGecode_1_1Gist_1_1Node_1a799e7bc0bb7c2e99a916d47b8366990a" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1Node_1a81a3ee39115b6771a4d63edfeef2fe47" kindref="member">Node::getChild</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase" kindref="compound">NodeAllocator</ref>&<sp/>na,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>n)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
||
|
<codeline lineno="211"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>na[<ref refid="classGecode_1_1Gist_1_1Node_1a81a3ee39115b6771a4d63edfeef2fe47" kindref="member">getChild</ref>(n)];</highlight></codeline>
|
||
|
<codeline lineno="212"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="213"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="214"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="215" refid="classGecode_1_1Gist_1_1Node_1a2b0f5b6e8ab7b1c0ca0dd91abbac7a97" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1Node_1a2b0f5b6e8ab7b1c0ca0dd91abbac7a97" kindref="member">Node::isRoot</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>parent<sp/>==<sp/>-1;<sp/>}</highlight></codeline>
|
||
|
<codeline lineno="216"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="217"><highlight class="normal"><sp/><sp/>forceinline<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="218" refid="classGecode_1_1Gist_1_1Node_1afbbbcaf065a9cf68d2bee0414468000d" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1Node_1afbbbcaf065a9cf68d2bee0414468000d" kindref="member">Node::getNumberOfChildren</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="219"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(getTag())<sp/>{</highlight></codeline>
|
||
|
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>UNDET:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
|
||
|
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>LEAF:<sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
|
||
|
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/>TWO_CHILDREN:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>1+(noOfChildren<sp/><=<sp/>0);</highlight></codeline>
|
||
|
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>noOfChildren;</highlight></codeline>
|
||
|
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="225"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="226"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="227"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">inline</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="228" refid="classGecode_1_1Gist_1_1Node_1adff3aae1f3bb07f9c73d23482b756ddf" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1Gist_1_1Node_1adff3aae1f3bb07f9c73d23482b756ddf" kindref="member">Node::getIndex</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Gist_1_1NodeAllocatorBase" kindref="compound">NodeAllocator</ref>&<sp/>na)</highlight><highlight class="keyword"><sp/>const<sp/></highlight><highlight class="normal">{</highlight></codeline>
|
||
|
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(parent==-1)</highlight></codeline>
|
||
|
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
|
||
|
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="classGecode_1_1Gist_1_1Node" kindref="compound">Node</ref>*<sp/>p<sp/>=<sp/>na[parent];</highlight></codeline>
|
||
|
<codeline lineno="232"><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=p-><ref refid="classGecode_1_1Gist_1_1Node_1afbbbcaf065a9cf68d2bee0414468000d" kindref="member">getNumberOfChildren</ref>();<sp/>i--;)</highlight></codeline>
|
||
|
<codeline lineno="233"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(p-><ref refid="classGecode_1_1Gist_1_1Node_1a81a3ee39115b6771a4d63edfeef2fe47" kindref="member">getChild</ref>(na,i)<sp/>==<sp/></highlight><highlight class="keyword">this</highlight><highlight class="normal">)</highlight></codeline>
|
||
|
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>p-><ref refid="classGecode_1_1Gist_1_1Node_1a81a3ee39115b6771a4d63edfeef2fe47" kindref="member">getChild</ref>(i);</highlight></codeline>
|
||
|
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/>GECODE_NEVER;</highlight></codeline>
|
||
|
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
|
||
|
<codeline lineno="237"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
||
|
<codeline lineno="238"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="239"><highlight class="normal">}}</highlight></codeline>
|
||
|
<codeline lineno="240"><highlight class="normal"></highlight></codeline>
|
||
|
<codeline lineno="241"><highlight class="normal"></highlight><highlight class="comment">//<sp/>STATISTICS:<sp/>gist-any</highlight><highlight class="normal"></highlight></codeline>
|
||
|
</programlisting>
|
||
|
<location file="/usr/include/gecode/gist/node.hpp"/>
|
||
|
</compounddef>
|
||
|
</doxygen>
|