<!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"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.5"/> <title>Eigen: IOFormat Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="eigendoxy.css" rel="stylesheet" type="text/css"> <!-- --> <script type="text/javascript" src="eigen_navtree_hacks.js"></script> <!-- <script type="text/javascript"> --> <!-- </script> --> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <!-- <a name="top"></a> --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="Eigen_Silly_Professor_64x64.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname"><a href="http://eigen.tuxfamily.org">Eigen</a>  <span id="projectnumber">3.2.0</span> </div> </td> <td> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.5 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('structEigen_1_1IOFormat.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="classEigen_1_1IOFormat-members.html">List of all members</a> | <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <div class="title">IOFormat Class Reference<div class="ingroups"><a class="el" href="group__Core__Module.html">Core module</a></div></div> </div> </div><!--header--> <div class="contents"> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Stores a set of parameters controlling the way matrices are printed. </p> <p>List of available parameters:</p> <ul> <li><b>precision</b> number of digits for floating point values, or one of the special constants <code>StreamPrecision</code> and <code>FullPrecision</code>. The default is the special value <code>StreamPrecision</code> which means to use the stream's own precision setting, as set for instance using <code>cout.precision(3)</code>. The other special value <code>FullPrecision</code> means that the number of digits will be computed to match the full precision of each floating-point type.</li> <li><b>flags</b> an OR-ed combination of flags, the default value is 0, the only currently available flag is <code>DontAlignCols</code> which allows to disable the alignment of columns, resulting in faster code.</li> <li><b>coeffSeparator</b> string printed between two coefficients of the same row</li> <li><b>rowSeparator</b> string printed between two rows</li> <li><b>rowPrefix</b> string printed at the beginning of each row</li> <li><b>rowSuffix</b> string printed at the end of each row</li> <li><b>matPrefix</b> string printed at the beginning of the matrix</li> <li><b>matSuffix</b> string printed at the end of the matrix</li> </ul> <p>Example: </p> <div class="fragment"><div class="line">std::string sep = <span class="stringliteral">"\n----------------------------------------\n"</span>;</div> <div class="line"><a class="code" href="group__matrixtypedefs.html#ga45a14b423c687c3e2e8325f148e27bf3">Matrix3d</a> m1;</div> <div class="line">m1 << 1.111111, 2, 3.33333, 4, 5, 6, 7, 8.888888, 9;</div> <div class="line"></div> <div class="line"><a class="code" href="structEigen_1_1IOFormat.html#a2cfedae142c169cc3ccd8c7dd53e04a7">IOFormat</a> CommaInitFmt(StreamPrecision, DontAlignCols, <span class="stringliteral">", "</span>, <span class="stringliteral">", "</span>, <span class="stringliteral">""</span>, <span class="stringliteral">""</span>, <span class="stringliteral">" << "</span>, <span class="stringliteral">";"</span>);</div> <div class="line"><a class="code" href="structEigen_1_1IOFormat.html#a2cfedae142c169cc3ccd8c7dd53e04a7">IOFormat</a> CleanFmt(4, 0, <span class="stringliteral">", "</span>, <span class="stringliteral">"\n"</span>, <span class="stringliteral">"["</span>, <span class="stringliteral">"]"</span>);</div> <div class="line"><a class="code" href="structEigen_1_1IOFormat.html#a2cfedae142c169cc3ccd8c7dd53e04a7">IOFormat</a> OctaveFmt(StreamPrecision, 0, <span class="stringliteral">", "</span>, <span class="stringliteral">";\n"</span>, <span class="stringliteral">""</span>, <span class="stringliteral">""</span>, <span class="stringliteral">"["</span>, <span class="stringliteral">"]"</span>);</div> <div class="line"><a class="code" href="structEigen_1_1IOFormat.html#a2cfedae142c169cc3ccd8c7dd53e04a7">IOFormat</a> HeavyFmt(FullPrecision, 0, <span class="stringliteral">", "</span>, <span class="stringliteral">";\n"</span>, <span class="stringliteral">"["</span>, <span class="stringliteral">"]"</span>, <span class="stringliteral">"["</span>, <span class="stringliteral">"]"</span>);</div> <div class="line"></div> <div class="line">std::cout << m1 << sep;</div> <div class="line">std::cout << m1.format(CommaInitFmt) << sep;</div> <div class="line">std::cout << m1.format(CleanFmt) << sep;</div> <div class="line">std::cout << m1.format(OctaveFmt) << sep;</div> <div class="line">std::cout << m1.format(HeavyFmt) << sep;</div> </div><!-- fragment --><p> Output: </p> <pre class="fragment">1.11 2 3.33 4 5 6 7 8.89 9 ---------------------------------------- << 1.11, 2, 3.33, 4, 5, 6, 7, 8.89, 9; ---------------------------------------- [1.111, 2, 3.333] [ 4, 5, 6] [ 7, 8.889, 9] ---------------------------------------- [ 1.11, 2, 3.33; 4, 5, 6; 7, 8.89, 9] ---------------------------------------- [[1.111111, 2, 3.33333]; [ 4, 5, 6]; [ 7, 8.888888, 9]] ---------------------------------------- </pre><dl class="section see"><dt>See Also</dt><dd><a class="el" href="classEigen_1_1DenseBase.html#aa364b60e6a2a124ea7392e4c0550fb4e">DenseBase::format()</a>, class <a class="el" href="classEigen_1_1WithFormat.html" title="Pseudo expression providing matrix output with given format. ">WithFormat</a> </dd></dl> </div><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a2cfedae142c169cc3ccd8c7dd53e04a7"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="structEigen_1_1IOFormat.html#a2cfedae142c169cc3ccd8c7dd53e04a7">IOFormat</a> (int _precision=StreamPrecision, int _flags=0, const std::string &_coeffSeparator=" ", const std::string &_rowSeparator="\n", const std::string &_rowPrefix="", const std::string &_rowSuffix="", const std::string &_matPrefix="", const std::string &_matSuffix="")</td></tr> <tr class="separator:a2cfedae142c169cc3ccd8c7dd53e04a7"><td class="memSeparator" colspan="2"> </td></tr> </table> <h2 class="groupheader">Constructor & Destructor Documentation</h2> <a class="anchor" id="a2cfedae142c169cc3ccd8c7dd53e04a7"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structEigen_1_1IOFormat.html">IOFormat</a> </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>_precision</em> = <code>StreamPrecision</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>_flags</em> = <code>0</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>_coeffSeparator</em> = <code>" "</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>_rowSeparator</em> = <code>"\n"</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>_rowPrefix</em> = <code>""</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>_rowSuffix</em> = <code>""</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>_matPrefix</em> = <code>""</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>_matSuffix</em> = <code>""</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Default contructor, see class <a class="el" href="structEigen_1_1IOFormat.html" title="Stores a set of parameters controlling the way matrices are printed. ">IOFormat</a> for the meaning of the parameters </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="IO_8h_source.html">IO.h</a></li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="namespaceEigen.html">Eigen</a></li><li class="navelem"><a class="el" href="structEigen_1_1IOFormat.html">IOFormat</a></li> <li class="footer">Generated on Mon Oct 28 2013 11:04:29 for Eigen by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li> </ul> </div> <!-- Piwik --> <!-- <script type="text/javascript"> var pkBaseURL = (("https:" == document.location.protocol) ? "https://stats.sylphide-consulting.com/piwik/" : "http://stats.sylphide-consulting.com/piwik/"); document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); </script><script type="text/javascript"> try { var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 20); piwikTracker.trackPageView(); piwikTracker.enableLinkTracking(); } catch( err ) {} </script><noscript><p><img src="http://stats.sylphide-consulting.com/piwik/piwik.php?idsite=20" style="border:0" alt="" /></p></noscript> --> <!-- End Piwik Tracking Code --> </body> </html>