Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 99cb5ede6a5329071fbeecc8218deb35 > files > 606

eigen3-doc-3.2-3.mga4.noarch.rpm

<!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: Ref&lt; PlainObjectType, Options, StrideType &gt; Class Template 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>
   &#160;<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('classEigen_1_1Ref.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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</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_1Ref-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Ref&lt; PlainObjectType, Options, StrideType &gt; Class Template 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"><h3>template&lt;typename PlainObjectType, int Options = 0, typename StrideType = typename internal::conditional&lt;PlainObjectType::IsVectorAtCompileTime,InnerStride&lt;1&gt;,OuterStride&lt;&gt; &gt;::type&gt;<br/>
class Eigen::Ref&lt; PlainObjectType, Options, StrideType &gt;</h3>

<p>A matrix or vector expression mapping an existing expressions. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">PlainObjectType</td><td>the equivalent matrix type of the mapped data </td></tr>
    <tr><td class="paramname">Options</td><td>specifies whether the pointer is <code><a class="el" href="group__enums.html#gga456ac33d49271d3e2c371351cd1d6371ad5380ca00f3d74b38593adf8a0d06d3e">Aligned</a></code>, or <code><a class="el" href="group__enums.html#gga456ac33d49271d3e2c371351cd1d6371afeaf599f3da3693d2ab4a7cc48a19437">Unaligned</a></code>. The default is <code><a class="el" href="group__enums.html#gga456ac33d49271d3e2c371351cd1d6371afeaf599f3da3693d2ab4a7cc48a19437">Unaligned</a></code>. </td></tr>
    <tr><td class="paramname">StrideType</td><td>optionally specifies strides. By default, <a class="el" href="classEigen_1_1Ref.html" title="A matrix or vector expression mapping an existing expressions. ">Ref</a> implies a contiguous storage along the inner dimension (inner stride==1), but accept a variable outer stride (leading dimension). This can be overridden by specifying strides. The type passed here must be a specialization of the <a class="el" href="classEigen_1_1Stride.html" title="Holds strides information for Map. ">Stride</a> template, see examples below.</td></tr>
  </table>
  </dd>
</dl>
<p>This class permits to write non template functions taking <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a>'s object as parameters while limiting the number of copies. A Ref&lt;&gt; object can represent either a const expression or a l-value: </p>
<div class="fragment"><div class="line">* <span class="comment">// in-out argument:</span></div>
<div class="line">* <span class="keywordtype">void</span> foo1(Ref&lt;VectorXf&gt; x);</div>
<div class="line">*</div>
<div class="line">* <span class="comment">// read-only const argument:</span></div>
<div class="line">* <span class="keywordtype">void</span> foo2(<span class="keyword">const</span> Ref&lt;const VectorXf&gt;&amp; x);</div>
<div class="line">* </div>
</div><!-- fragment --><p>In the in-out case, the input argument must satisfies the constraints of the actual Ref&lt;&gt; type, otherwise a compilation issue will be triggered. By default, a Ref&lt;VectorXf&gt; can reference any dense vector expression of float having a contiguous memory layout. Likewise, a Ref&lt;MatrixXf&gt; can reference any column major dense matrix expression of float whose column's elements are contiguously stored with the possibility to have a constant space inbetween each column, i.e.: the inner stride mmust be equal to 1, but the outer-stride (or leading dimension), can be greater than the number of rows.</p>
<p>In the const case, if the input expression does not match the above requirement, then it is evaluated into a temporary before being passed to the function. Here are some examples: </p>
<div class="fragment"><div class="line">* <a class="code" href="group__matrixtypedefs.html#gabab09c32e96cfa9829a88400627af162">MatrixXf</a> A;</div>
<div class="line">* VectorXf a;</div>
<div class="line">* foo1(a.head());             <span class="comment">// OK</span></div>
<div class="line">* foo1(A.col());              <span class="comment">// OK</span></div>
<div class="line">* foo1(A.row());              <span class="comment">// compilation error because here innerstride!=1</span></div>
<div class="line">* foo2(A.row());              <span class="comment">// The row is copied into a contiguous temporary</span></div>
<div class="line">* foo2(2*a);                  <span class="comment">// The expression is evaluated into a temporary</span></div>
<div class="line">* foo2(A.col().segment(2,4)); <span class="comment">// No temporary</span></div>
<div class="line">* </div>
</div><!-- fragment --><p>The range of inputs that can be referenced without temporary can be enlarged using the last two template parameter. Here is an example accepting an innerstride!=1: </p>
<div class="fragment"><div class="line">* <span class="comment">// in-out argument:</span></div>
<div class="line">* <span class="keywordtype">void</span> foo3(Ref&lt;VectorXf,0,InnerStride&lt;&gt; &gt; x);</div>
<div class="line">* foo3(A.row());              <span class="comment">// OK</span></div>
<div class="line">* </div>
</div><!-- fragment --><p> The downside here is that the function foo3 might be significantly slower than foo1 because it won't be able to exploit vectorization, and will involved more expensive address computations even if the input is contiguously stored in memory. To overcome this issue, one might propose to overloads internally calling a template function, e.g.: </p>
<div class="fragment"><div class="line">* <span class="comment">// in the .h:</span></div>
<div class="line">* <span class="keywordtype">void</span> foo(<span class="keyword">const</span> Ref&lt;MatrixXf&gt;&amp; A);</div>
<div class="line">* <span class="keywordtype">void</span> foo(<span class="keyword">const</span> Ref&lt;<a class="code" href="group__matrixtypedefs.html#gabab09c32e96cfa9829a88400627af162">MatrixXf</a>,0,Stride&lt;&gt; &gt;&amp; A);</div>
<div class="line">*</div>
<div class="line">* <span class="comment">// in the .cpp:</span></div>
<div class="line">* <span class="keyword">template</span>&lt;<span class="keyword">typename</span> TypeOfA&gt; <span class="keywordtype">void</span> foo_impl(<span class="keyword">const</span> TypeOfA&amp; A) {</div>
<div class="line">*     ... <span class="comment">// crazy code goes here</span></div>
<div class="line">* }</div>
<div class="line">* <span class="keywordtype">void</span> foo(<span class="keyword">const</span> Ref&lt;MatrixXf&gt;&amp; A) { foo_impl(A); }</div>
<div class="line">* <span class="keywordtype">void</span> foo(<span class="keyword">const</span> Ref&lt;<a class="code" href="group__matrixtypedefs.html#gabab09c32e96cfa9829a88400627af162">MatrixXf</a>,0,Stride&lt;&gt; &gt;&amp; A) { foo_impl(A); }</div>
<div class="line">* </div>
</div><!-- fragment --><dl class="section see"><dt>See Also</dt><dd>PlainObjectBase::Map(), <a class="el" href="group__TopicStorageOrders.html">Storage orders</a> </dd></dl>
</div>
<p>Inherits RefBase&lt; Derived &gt;.</p>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Ref_8h_source.html">Ref.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="classEigen_1_1Ref.html">Ref</a></li>
    <li class="footer">Generated on Mon Oct 28 2013 11:04:30 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>