<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>PolyBoRi: pbori_routines_dd.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>pbori_routines_dd.h</h1><a href="pbori__routines__dd_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- c++ -*-</span> <a name="l00002"></a>00002 <span class="comment">//*****************************************************************************</span> <a name="l00052"></a>00052 <span class="comment"></span><span class="comment">//*****************************************************************************</span> <a name="l00053"></a>00053 <a name="l00054"></a>00054 <span class="comment">// include basic definitions</span> <a name="l00055"></a>00055 <span class="preprocessor">#include "<a class="code" href="pbori__defs_8h.html">pbori_defs.h</a>"</span> <a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="comment">// get addition definitions</span> <a name="l00058"></a>00058 <span class="preprocessor">#include "<a class="code" href="CTermIter_8h.html">CTermIter.h</a>"</span> <a name="l00059"></a>00059 <span class="preprocessor">#include "<a class="code" href="PBoRiOutIter_8h.html">PBoRiOutIter.h</a>"</span> <a name="l00060"></a>00060 <span class="preprocessor">#include <set></span> <a name="l00061"></a>00061 <span class="preprocessor">#include <vector></span> <a name="l00062"></a>00062 <a name="l00063"></a>00063 <a name="l00064"></a>00064 <a class="code" href="pbori__defs_8h.html#6ae360a591580558f31b6157ee792a10" title="Start project&#39;s namespace.">BEGIN_NAMESPACE_PBORI</a> <a name="l00065"></a>00065 <a name="l00068"></a>00068 <span class="keyword">template</span><<span class="keyword">class</span> DDType, <span class="keyword">class</span> OutputType> <a name="l00069"></a>00069 OutputType <a name="l00070"></a><a class="code" href="namespacepolybori.html#a3bb460b9a008e8fd01d86120780af32">00070</a> <a class="code" href="namespacepolybori.html#a3bb460b9a008e8fd01d86120780af32" title="Get last term (wrt. lexicographical order).">dd_last_lexicographical_term</a>(<span class="keyword">const</span> DDType& dd, <a class="code" href="structpolybori_1_1type__tag.html" title="This class marks a given type.">type_tag<OutputType></a>) { <a name="l00071"></a>00071 <a name="l00072"></a>00072 <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespacepolybori_1_1groebner.html#ef37a95e97afbd561cc4c5f84d660765">DDType::idx_type</a> <a class="code" href="namespacepolybori_1_1groebner.html#ef37a95e97afbd561cc4c5f84d660765">idx_type</a>; <a name="l00073"></a>00073 <span class="keyword">typedef</span> <span class="keyword">typename</span> DDType::size_type size_type; <a name="l00074"></a>00074 <span class="keyword">typedef</span> OutputType term_type; <a name="l00075"></a>00075 <a name="l00076"></a>00076 term_type result(dd.ring()); <a name="l00077"></a>00077 <a name="l00078"></a>00078 assert(!dd.emptiness()); <a name="l00079"></a>00079 <a name="l00080"></a>00080 size_type nlen = std::distance(dd.lastBegin(), dd.lastEnd()); <a name="l00081"></a>00081 <a name="l00082"></a>00082 <span class="comment">// store indices in list</span> <a name="l00083"></a>00083 std::vector<idx_type> indices(nlen); <a name="l00084"></a>00084 <a name="l00085"></a>00085 <span class="comment">// iterator, which uses changeAssign to insert variable</span> <a name="l00086"></a>00086 <span class="comment">// wrt. given indices to a monomial</span> <a name="l00087"></a>00087 <a class="code" href="classpolybori_1_1PBoRiOutIter.html" title="This template class defines an output iterator which interprets assignments of indices...">PBoRiOutIter<term_type, idx_type, change_assign<term_type></a> > <a name="l00088"></a>00088 outiter(result); <a name="l00089"></a>00089 <a name="l00090"></a>00090 <span class="comment">// insert backward (for efficiency reasons)</span> <a name="l00091"></a>00091 <a class="code" href="namespacepolybori.html#39e393c4286cf8905dd845f004f04443" title="Function templates doing a reversed copy using intermediate storage.">reversed_inter_copy</a>(dd.lastBegin(), dd.lastEnd(), indices, outiter); <a name="l00092"></a>00092 <a name="l00093"></a>00093 <span class="keywordflow">return</span> result; <a name="l00094"></a>00094 } <a name="l00095"></a>00095 <a name="l00096"></a>00096 <a name="l00097"></a>00097 <a class="code" href="pbori__defs_8h.html#faf094fde6c1a7f1aad18bcb455f3b06" title="Finish project&#39;s namespace.">END_NAMESPACE_PBORI</a> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Sep 9 14:30:59 2009 for PolyBoRi by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>