<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>linbox: VectorFraction< Domain > Class Template Reference</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.7.4 --> <script type="text/javascript"> function hasClass(ele,cls) { return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')); } function addClass(ele,cls) { if (!this.hasClass(ele,cls)) ele.className += " "+cls; } function removeClass(ele,cls) { if (hasClass(ele,cls)) { var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)'); ele.className=ele.className.replace(reg,' '); } } function toggleVisibility(linkObj) { var base = linkObj.getAttribute('id'); var summary = document.getElementById(base + '-summary'); var content = document.getElementById(base + '-content'); var trigger = document.getElementById(base + '-trigger'); if ( hasClass(linkObj,'closed') ) { summary.style.display = 'none'; content.style.display = 'block'; trigger.src = 'open.png'; removeClass(linkObj,'closed'); addClass(linkObj,'opened'); } else if ( hasClass(linkObj,'opened') ) { summary.style.display = 'block'; content.style.display = 'none'; trigger.src = 'closed.png'; removeClass(linkObj,'opened'); addClass(linkObj,'closed'); } return false; } </script> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">linbox</div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <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="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Data Fields</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespace_lin_box.html">LinBox</a> </li> <li class="navelem"><a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <div class="title">VectorFraction< Domain > Class Template Reference</div> </div> </div> <div class="contents"> <!-- doxytag: class="LinBox::VectorFraction" --> <p>VectorFraction<Domain> is a vector of rational elements with common reduced denominator. <a href="class_lin_box_1_1_vector_fraction.html#details">More...</a></p> <p><code>#include <vector-fraction.h></code></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaacac93f437e011e3ad072eee3ad2f33"></a><!-- doxytag: member="LinBox::VectorFraction::VectorFraction" ref="aaacac93f437e011e3ad072eee3ad2f33" args="(const Domain &D, FVector &frac)" -->  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#aaacac93f437e011e3ad072eee3ad2f33">VectorFraction</a> (const Domain &D, FVector &frac)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">constructor from vector of rational numbers reduces individual pairs in-place first unless alreadyReduced=true <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#a4526ef5b0b77f88d0be5c1e323851913">VectorFraction</a> (const Domain &D, size_t n)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">allocating constructor, returns [0, 0, ... <a href="#a4526ef5b0b77f88d0be5c1e323851913"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a83d6ec84cacbd24b198b0293383f4837"></a><!-- doxytag: member="LinBox::VectorFraction::VectorFraction" ref="a83d6ec84cacbd24b198b0293383f4837" args="(const VectorFraction< Domain > &VF)" -->  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#a83d6ec84cacbd24b198b0293383f4837">VectorFraction</a> (const <a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a>< Domain > &VF)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">copy constructor <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a176e5daedec6bdeb1dd0e496cb0f8110"></a><!-- doxytag: member="LinBox::VectorFraction::copy" ref="a176e5daedec6bdeb1dd0e496cb0f8110" args="(const VectorFraction< Domain > &VF)" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#a176e5daedec6bdeb1dd0e496cb0f8110">copy</a> (const <a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a>< Domain > &VF)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">copy without construction <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeded70a4e018895bf2eeb34d7caa3198"></a><!-- doxytag: member="LinBox::VectorFraction::clearAndResize" ref="aeded70a4e018895bf2eeb34d7caa3198" args="(size_t size)" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#aeded70a4e018895bf2eeb34d7caa3198">clearAndResize</a> (size_t size)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">clear and resize without construction <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a19e4963b18bcfdda70275db6f391a72b"></a><!-- doxytag: member="LinBox::VectorFraction::combineSolution" ref="a19e4963b18bcfdda70275db6f391a72b" args="(const VectorFraction< Domain > &other)" --> bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#a19e4963b18bcfdda70275db6f391a72b">combineSolution</a> (const <a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a>< Domain > &other)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Replaces *this with a linear combination of *this and other such that the result has denominator == gcd(this->denom, other.denom) see Mulders+Storjohann : 'Certified Dense Linear System Solving' Lemma 2.1 return value of true means that there was some improvement (ie denom was reduced) <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaee1b76dcef5d1a0d86f152884b06e41"></a><!-- doxytag: member="LinBox::VectorFraction::boundedCombineSolution" ref="aaee1b76dcef5d1a0d86f152884b06e41" args="(const VectorFraction< Domain > &other, const Element &denBound, Element &g)" --> bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#aaee1b76dcef5d1a0d86f152884b06e41">boundedCombineSolution</a> (const <a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a>< Domain > &other, const Element &denBound, Element &g)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds in-place to *this a multiple of other such that the result has gcd(denominator, denBound) == gcd(this->denom, other.denom, denBound) see Mulders+Storjohann : 'Certified Dense Linear System Solving' Lemma 6.1 return value of true means that there was some improvement (ie gcd(denom, denBound) was reduced) g is gcd(denom, denBound), and is updated by this function when there is improvement. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#a83465a73add196a0b6f67f4cc510f4b0">combineCertificate</a> (const <a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a>< Domain > &other, Element &n1, Element &d1, const Element &n2, const Element d2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds in-place to *this a multiple of other to create an improved certificate ("z") n1/d1 = *this . <a href="#a83465a73add196a0b6f67f4cc510f4b0"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a>< Domain > & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#a811bc9235c0a10467ef5655240c16fb6">axpyin</a> (Element &a, const <a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a>< Domain > &x)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">this += a * x. <a href="#a811bc9235c0a10467ef5655240c16fb6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acd22def76f55c19076bb6c86104beaf0"></a><!-- doxytag: member="LinBox::VectorFraction::write" ref="acd22def76f55c19076bb6c86104beaf0" args="(std::ostream &os) const " --> std::ostream & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#acd22def76f55c19076bb6c86104beaf0">write</a> (std::ostream &os) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">write to a stream <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4b471843489d3625a9ec39ab679c4860"></a><!-- doxytag: member="LinBox::VectorFraction::toFVector" ref="a4b471843489d3625a9ec39ab679c4860" args="(FVector &result) const " --> FVector & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#a4b471843489d3625a9ec39ab679c4860">toFVector</a> (FVector &result) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">convert to 'answer' type of lifting container <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a652f2a5cfcb68550d5a5a0ab0a998060"></a><!-- doxytag: member="LinBox::VectorFraction::simplify" ref="a652f2a5cfcb68550d5a5a0ab0a998060" args="()" --> <a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a>< Domain > & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_lin_box_1_1_vector_fraction.html#a652f2a5cfcb68550d5a5a0ab0a998060">simplify</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">reduces to simplest form, returns (*this) <br/></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><h3>template<class Domain><br/> class LinBox::VectorFraction< Domain ></h3> <p>VectorFraction<Domain> is a vector of rational elements with common reduced denominator. </p> <p>Here Domain is a ring supporting the gcd, eg <a class="el" href="class_lin_box_1_1_n_t_l___z_z.html" title="the integer ring.">NTL_ZZ</a> or <a class="el" href="class_lin_box_1_1_p_i_d__integer.html" title="Domain for integer operations.">PID_integer</a> For compatability with the return type of rationalSolver, it allows conversion from/to std::vector<std::pair<Domain::Element> >. All functions will return the fraction in reduced form, calling reduce() if necessary. </p> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a4526ef5b0b77f88d0be5c1e323851913"></a><!-- doxytag: member="LinBox::VectorFraction::VectorFraction" ref="a4526ef5b0b77f88d0be5c1e323851913" args="(const Domain &D, size_t n)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a> </td> <td>(</td> <td class="paramtype">const Domain & </td> <td class="paramname"><em>D</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>n</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>allocating constructor, returns [0, 0, ... </p> <p>0]/1 </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a83465a73add196a0b6f67f4cc510f4b0"></a><!-- doxytag: member="LinBox::VectorFraction::combineCertificate" ref="a83465a73add196a0b6f67f4cc510f4b0" args="(const VectorFraction< Domain > &other, Element &n1, Element &d1, const Element &n2, const Element d2)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool combineCertificate </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a>< Domain > & </td> <td class="paramname"><em>other</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">Element & </td> <td class="paramname"><em>n1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">Element & </td> <td class="paramname"><em>d1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const Element & </td> <td class="paramname"><em>n2</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const Element </td> <td class="paramname"><em>d2</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Adds in-place to *this a multiple of other to create an improved certificate ("z") n1/d1 = *this . </p> <p>b, n2/d2 = other . b in reduced form n1/d1 are updated so that new denominator is lcm(d1, d2); see Mulders+Storjohann : 'Certified Dense Linear System Solving' Lemma 6.2 return value of true means that there was some improvement (ie d1 was increased) </p> </div> </div> <a class="anchor" id="a811bc9235c0a10467ef5655240c16fb6"></a><!-- doxytag: member="LinBox::VectorFraction::axpyin" ref="a811bc9235c0a10467ef5655240c16fb6" args="(Element &a, const VectorFraction< Domain > &x)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a><Domain>& axpyin </td> <td>(</td> <td class="paramtype">Element & </td> <td class="paramname"><em>a</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="class_lin_box_1_1_vector_fraction.html">VectorFraction</a>< Domain > & </td> <td class="paramname"><em>x</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>this += a * x. </p> <p>performs a rational axpy with an integer multiplier returns (*this) </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>vector-fraction.h</li> </ul> </div> <hr class="footer"/><address class="footer"><small>Generated on Tue Aug 30 2011 for linbox by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address> </body> </html>