175 lines
26 KiB
XML
175 lines
26 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="ldsb_8hpp" kind="file">
|
|
<compoundname>ldsb.hpp</compoundname>
|
|
<includedby refid="minimodel_8hh" local="no">/usr/include/gecode/minimodel.hh</includedby>
|
|
<invincdepgraph>
|
|
<node id="28650">
|
|
<label>/usr/include/gecode/minimodel/ldsb.hpp</label>
|
|
<link refid="ldsb.hpp"/>
|
|
<childnode refid="28651" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="28653">
|
|
<label>/usr/include/gecode/flatzinc.hh</label>
|
|
<link refid="flatzinc_8hh_source"/>
|
|
<childnode refid="28654" relation="include">
|
|
</childnode>
|
|
<childnode refid="28655" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="28651">
|
|
<label>/usr/include/gecode/minimodel.hh</label>
|
|
<link refid="minimodel_8hh_source"/>
|
|
<childnode refid="28652" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="28652">
|
|
<label>/usr/include/gecode/driver.hh</label>
|
|
<link refid="driver_8hh_source"/>
|
|
<childnode refid="28653" relation="include">
|
|
</childnode>
|
|
</node>
|
|
<node id="28654">
|
|
<label>/usr/include/gecode/flatzinc/parser.hh</label>
|
|
<link refid="parser_8hh_source"/>
|
|
</node>
|
|
<node id="28655">
|
|
<label>/usr/include/gecode/flatzinc/registry.hh</label>
|
|
<link refid="registry_8hh_source"/>
|
|
</node>
|
|
</invincdepgraph>
|
|
<innernamespace refid="namespaceGecode">Gecode</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/>Christopher<sp/>Mears<sp/><chris.mears@monash.edu></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/>Christopher<sp/>Mears,<sp/>2012</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-22<sp/>04:21:36<sp/>+0200<sp/>(Wed,<sp/>22<sp/>May<sp/>2013)<sp/>$<sp/>by<sp/>$Author:<sp/>mears<sp/>$</highlight></codeline>
|
|
<codeline lineno="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/>$Revision:<sp/>13653<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/>{</highlight></codeline>
|
|
<codeline lineno="39"><highlight class="normal"><sp/><sp/></highlight></codeline>
|
|
<codeline lineno="42"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>A></highlight></codeline>
|
|
<codeline lineno="43"><highlight class="normal"><sp/><sp/>SymmetryHandle</highlight></codeline>
|
|
<codeline lineno="44" refid="namespaceGecode_1a95ae0c658a5005f6353dd92fae2b2da5" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1a95ae0c658a5005f6353dd92fae2b2da5" kindref="member">rows_interchange</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix" kindref="compound">Matrix<A></ref>&<sp/>m)<sp/>{</highlight></codeline>
|
|
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix_1a0966361678a7474d1c2058271b98f59d" kindref="member">Matrix<A>::ArgsType</ref><sp/>xs;</highlight></codeline>
|
|
<codeline lineno="46"><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/>r<sp/>=<sp/>0<sp/>;<sp/>r<sp/><<sp/>m.<ref refid="classGecode_1_1Matrix_1a9bc77760569857e12b961bbabbd9c1d2" kindref="member">height</ref>()<sp/>;<sp/>r++)</highlight></codeline>
|
|
<codeline lineno="47"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>xs<sp/><<<sp/>m.<ref refid="classGecode_1_1Matrix_1a8ea675452963e06e4b1a4fc459b63078" kindref="member">row</ref>(r);</highlight></codeline>
|
|
<codeline lineno="48"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__TaskModelIntBranchSymm_1gaabb552d4c34a90e89b71096063aee7ac" kindref="member">VariableSequenceSymmetry</ref>(xs,<sp/>m.<ref refid="classGecode_1_1Matrix_1a742da0e317430fc93d95d4b68713ff5e" kindref="member">width</ref>());</highlight></codeline>
|
|
<codeline lineno="49"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="50"><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/>A></highlight></codeline>
|
|
<codeline lineno="54"><highlight class="normal"><sp/><sp/>SymmetryHandle</highlight></codeline>
|
|
<codeline lineno="55" refid="namespaceGecode_1afe5e455905440d5418cc2262b628df6f" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1afe5e455905440d5418cc2262b628df6f" kindref="member">columns_interchange</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix" kindref="compound">Matrix<A></ref>&<sp/>m)<sp/>{</highlight></codeline>
|
|
<codeline lineno="56"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix_1a0966361678a7474d1c2058271b98f59d" kindref="member">Matrix<A>::ArgsType</ref><sp/>xs;</highlight></codeline>
|
|
<codeline lineno="57"><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/>c<sp/>=<sp/>0<sp/>;<sp/>c<sp/><<sp/>m.<ref refid="classGecode_1_1Matrix_1a742da0e317430fc93d95d4b68713ff5e" kindref="member">width</ref>()<sp/>;<sp/>c++)</highlight></codeline>
|
|
<codeline lineno="58"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>xs<sp/><<<sp/>m.<ref refid="classGecode_1_1Matrix_1a1d105eb679bfd06d4821a60447dd0419" kindref="member">col</ref>(c);</highlight></codeline>
|
|
<codeline lineno="59"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__TaskModelIntBranchSymm_1gaabb552d4c34a90e89b71096063aee7ac" kindref="member">VariableSequenceSymmetry</ref>(xs,<sp/>m.<ref refid="classGecode_1_1Matrix_1a9bc77760569857e12b961bbabbd9c1d2" kindref="member">height</ref>());</highlight></codeline>
|
|
<codeline lineno="60"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="61"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="64"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>A></highlight></codeline>
|
|
<codeline lineno="65"><highlight class="normal"><sp/><sp/>SymmetryHandle</highlight></codeline>
|
|
<codeline lineno="66" refid="namespaceGecode_1a2e8fe0b7d12a576e3bddf1eec484d3ae" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="namespaceGecode_1a2e8fe0b7d12a576e3bddf1eec484d3ae" kindref="member">rows_reflect</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix" kindref="compound">Matrix<A></ref>&<sp/>m)<sp/>{</highlight></codeline>
|
|
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nrows<sp/>=<sp/>m.<ref refid="classGecode_1_1Matrix_1a9bc77760569857e12b961bbabbd9c1d2" kindref="member">height</ref>();</highlight></codeline>
|
|
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ncols<sp/>=<sp/>m.<ref refid="classGecode_1_1Matrix_1a742da0e317430fc93d95d4b68713ff5e" kindref="member">width</ref>();</highlight></codeline>
|
|
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Length<sp/>of<sp/>each<sp/>sequence<sp/>in<sp/>the<sp/>symmetry.</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>length<sp/>=<sp/>(nrows/2)<sp/>*<sp/>ncols;</highlight></codeline>
|
|
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix_1a0966361678a7474d1c2058271b98f59d" kindref="member">Matrix<A>::ArgsType</ref><sp/>xs(length<sp/>*<sp/>2);</highlight></codeline>
|
|
<codeline lineno="72"><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/>0<sp/>;<sp/>i<sp/><<sp/>length<sp/>;<sp/>i++)<sp/>{</highlight></codeline>
|
|
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Break<sp/>position<sp/>i<sp/>into<sp/>its<sp/>coordinates</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="74"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>r1<sp/>=<sp/>i/ncols;</highlight></codeline>
|
|
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>c1<sp/>=<sp/>i%ncols;</highlight></codeline>
|
|
<codeline lineno="76"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>r2<sp/>is<sp/>the<sp/>row<sp/>symmetric<sp/>with<sp/>r1</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="77"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>r2<sp/>=<sp/>nrows<sp/>-<sp/>r1<sp/>-<sp/>1;</highlight></codeline>
|
|
<codeline lineno="78"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>The<sp/>column<sp/>remains<sp/>the<sp/>same</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="79"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>c2<sp/>=<sp/>c1;</highlight></codeline>
|
|
<codeline lineno="80"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>xs[i]<sp/>=<sp/>m(c1,r1);</highlight></codeline>
|
|
<codeline lineno="81"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>xs[length+i]<sp/>=<sp/>m(c2,r2);</highlight></codeline>
|
|
<codeline lineno="82"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="83"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__TaskModelIntBranchSymm_1gaabb552d4c34a90e89b71096063aee7ac" kindref="member">VariableSequenceSymmetry</ref>(xs,<sp/>length);</highlight></codeline>
|
|
<codeline lineno="84"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="85"><highlight class="normal"><sp/><sp/></highlight></codeline>
|
|
<codeline lineno="88"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>A></highlight></codeline>
|
|
<codeline lineno="89" refid="namespaceGecode_1a86021d1aeb6aa901e15040760b2d0efd" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1SymmetryHandle" kindref="compound">SymmetryHandle</ref><sp/><ref refid="namespaceGecode_1a86021d1aeb6aa901e15040760b2d0efd" kindref="member">columns_reflect</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix" kindref="compound">Matrix<A></ref>&<sp/>m)<sp/>{</highlight></codeline>
|
|
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nrows<sp/>=<sp/>m.<ref refid="classGecode_1_1Matrix_1a9bc77760569857e12b961bbabbd9c1d2" kindref="member">height</ref>();</highlight></codeline>
|
|
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ncols<sp/>=<sp/>m.<ref refid="classGecode_1_1Matrix_1a742da0e317430fc93d95d4b68713ff5e" kindref="member">width</ref>();</highlight></codeline>
|
|
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Length<sp/>of<sp/>each<sp/>sequence<sp/>in<sp/>the<sp/>symmetry.</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>length<sp/>=<sp/>(ncols/2)<sp/>*<sp/>nrows;</highlight></codeline>
|
|
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix_1a0966361678a7474d1c2058271b98f59d" kindref="member">Matrix<A>::ArgsType</ref><sp/>xs(length<sp/>*<sp/>2);</highlight></codeline>
|
|
<codeline lineno="95"><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/>0<sp/>;<sp/>i<sp/><<sp/>length<sp/>;<sp/>i++)<sp/>{</highlight></codeline>
|
|
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Break<sp/>position<sp/>i<sp/>into<sp/>its<sp/>coordinates</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>r1<sp/>=<sp/>i/ncols;</highlight></codeline>
|
|
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>c1<sp/>=<sp/>i%ncols;</highlight></codeline>
|
|
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>c2<sp/>is<sp/>the<sp/>column<sp/>symmetric<sp/>with<sp/>c1</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>c2<sp/>=<sp/>ncols<sp/>-<sp/>c1<sp/>-<sp/>1;</highlight></codeline>
|
|
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>The<sp/>row<sp/>remains<sp/>the<sp/>same</highlight><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>r2<sp/>=<sp/>r1;</highlight></codeline>
|
|
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>xs[i]<sp/>=<sp/>m(c1,r1);</highlight></codeline>
|
|
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>xs[length+i]<sp/>=<sp/>m(c2,r2);</highlight></codeline>
|
|
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__TaskModelIntBranchSymm_1gaabb552d4c34a90e89b71096063aee7ac" kindref="member">VariableSequenceSymmetry</ref>(xs,<sp/>length);</highlight></codeline>
|
|
<codeline lineno="107"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="108"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="111"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">template</highlight><highlight class="normal"><</highlight><highlight class="keyword">class</highlight><highlight class="normal"><sp/>A></highlight></codeline>
|
|
<codeline lineno="112" refid="namespaceGecode_1adf66bd3fa7af1b80ed1a47e996ed5696" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="classGecode_1_1SymmetryHandle" kindref="compound">SymmetryHandle</ref><sp/><ref refid="namespaceGecode_1adf66bd3fa7af1b80ed1a47e996ed5696" kindref="member">diagonal_reflect</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix" kindref="compound">Matrix<A></ref>&<sp/>m)<sp/>{</highlight></codeline>
|
|
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>nrows<sp/>=<sp/>m.<ref refid="classGecode_1_1Matrix_1a9bc77760569857e12b961bbabbd9c1d2" kindref="member">height</ref>();</highlight></codeline>
|
|
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ncols<sp/>=<sp/>m.<ref refid="classGecode_1_1Matrix_1a742da0e317430fc93d95d4b68713ff5e" kindref="member">width</ref>();</highlight></codeline>
|
|
<codeline lineno="115"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix_1a0966361678a7474d1c2058271b98f59d" kindref="member">Matrix<A>::ArgsType</ref><sp/>a1;</highlight></codeline>
|
|
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix_1a0966361678a7474d1c2058271b98f59d" kindref="member">Matrix<A>::ArgsType</ref><sp/>a2;</highlight></codeline>
|
|
<codeline lineno="118"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="119"><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/>0<sp/>;<sp/>i<sp/><<sp/>nrows<sp/>;<sp/>i++)<sp/>{</highlight></codeline>
|
|
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>j<sp/>=<sp/>i+1<sp/>;<sp/>j<sp/><<sp/>ncols<sp/>;<sp/>j++)<sp/>{</highlight></codeline>
|
|
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>a1<sp/><<<sp/>m(j,i);</highlight></codeline>
|
|
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>a2<sp/><<<sp/>m(i,j);</highlight></codeline>
|
|
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="125"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/><ref refid="classGecode_1_1Matrix_1a0966361678a7474d1c2058271b98f59d" kindref="member">Matrix<A>::ArgsType</ref><sp/>aboth;</highlight></codeline>
|
|
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/>aboth<sp/><<<sp/>a1;</highlight></codeline>
|
|
<codeline lineno="128"><highlight class="normal"><sp/><sp/><sp/><sp/>aboth<sp/><<<sp/>a2;</highlight></codeline>
|
|
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__TaskModelIntBranchSymm_1gaabb552d4c34a90e89b71096063aee7ac" kindref="member">VariableSequenceSymmetry</ref>(aboth,<sp/>a1.size());</highlight></codeline>
|
|
<codeline lineno="130"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
|
|
<codeline lineno="131"><highlight class="normal">}</highlight></codeline>
|
|
<codeline lineno="132"><highlight class="normal"></highlight></codeline>
|
|
<codeline lineno="133"><highlight class="normal"></highlight><highlight class="comment">//<sp/>STATISTICS:<sp/>minimodel-any</highlight><highlight class="normal"></highlight></codeline>
|
|
</programlisting>
|
|
<location file="/usr/include/gecode/minimodel/ldsb.hpp"/>
|
|
</compounddef>
|
|
</doxygen>
|