Sophie

Sophie

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

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: Porting from Eigen2 to Eigen3</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('Eigen2ToEigen3.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="headertitle">
<div class="title">Porting from Eigen2 to Eigen3 </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This page lists the most important API changes between Eigen2 and Eigen3, and gives tips to help porting your application from Eigen2 to Eigen3.</p>
<h1><a class="anchor" id="CompatibilitySupport"></a>
Eigen2 compatibility support</h1>
<p>In order to ease the switch from Eigen2 to Eigen3, Eigen3 features <a class="el" href="Eigen2SupportModes.html">Eigen2 support modes</a>.</p>
<p>The quick way to enable this is to define the <code>EIGEN2_SUPPORT</code> preprocessor token <b>before</b> including any <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> header (typically it should be set in your project options).</p>
<p>A more powerful, <em>staged</em> migration path is also provided, which may be useful to migrate larger projects from Eigen2 to Eigen3. This is explained in the <a class="el" href="Eigen2SupportModes.html">Eigen 2 support modes</a> page.</p>
<h1><a class="anchor" id="Using"></a>
The USING_PART_OF_NAMESPACE_EIGEN macro</h1>
<p>The USING_PART_OF_NAMESPACE_EIGEN macro has been removed. In <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3, just do: </p>
<div class="fragment"><div class="line"><span class="keyword">using namespace </span>Eigen;</div>
</div><!-- fragment --><h1><a class="anchor" id="ComplexDot"></a>
Dot products over complex numbers</h1>
<p>This is the single trickiest change between <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2 and <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3. It only affects code using <code>std::complex</code> numbers as scalar type.</p>
<p><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2's dot product was linear in the first variable. <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3's dot product is linear in the second variable. In other words, the <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2 code</p>
<div class="fragment"><div class="line">x.dot(y) </div>
</div><!-- fragment --><p> is equivalent to the <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3 code</p>
<div class="fragment"><div class="line">y.dot(x) </div>
</div><!-- fragment --><p> In yet other words, dot products are complex-conjugated in <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3 compared to <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2. The switch to the new convention was commanded by common usage, especially with the notation <img class="formulaInl" alt="$ x^Ty $" src="form_166.png"/> for dot products of column-vectors.</p>
<h1><a class="anchor" id="VectorBlocks"></a>
Vector blocks</h1>
<table  class="manual">
<tr>
<th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2</th><th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3 </th></tr>
<tr>
<td><div class="fragment"><div class="line">vector.start(length)</div>
<div class="line">vector.start&lt;length&gt;()</div>
<div class="line">vector.end(length)</div>
<div class="line">vector.end&lt;length&gt;()</div>
</div><!-- fragment --></td><td><div class="fragment"><div class="line">vector.head(length)</div>
<div class="line">vector.head&lt;length&gt;()</div>
<div class="line">vector.tail(length)</div>
<div class="line">vector.tail&lt;length&gt;()</div>
</div><!-- fragment --> </td></tr>
</table>
<h1><a class="anchor" id="Corners"></a>
Matrix Corners</h1>
<table  class="manual">
<tr>
<th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2</th><th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3 </th></tr>
<tr>
<td><div class="fragment"><div class="line">matrix.corner(TopLeft,r,c)</div>
<div class="line">matrix.corner(TopRight,r,c)</div>
<div class="line">matrix.corner(BottomLeft,r,c)</div>
<div class="line">matrix.corner(BottomRight,r,c)</div>
<div class="line">matrix.corner&lt;r,c&gt;(TopLeft)</div>
<div class="line">matrix.corner&lt;r,c&gt;(TopRight)</div>
<div class="line">matrix.corner&lt;r,c&gt;(BottomLeft)</div>
<div class="line">matrix.corner&lt;r,c&gt;(BottomRight)</div>
</div><!-- fragment --></td><td><div class="fragment"><div class="line">matrix.topLeftCorner(r,c)</div>
<div class="line">matrix.topRightCorner(r,c)</div>
<div class="line">matrix.bottomLeftCorner(r,c)</div>
<div class="line">matrix.bottomRightCorner(r,c)</div>
<div class="line">matrix.topLeftCorner&lt;r,c&gt;()</div>
<div class="line">matrix.topRightCorner&lt;r,c&gt;()</div>
<div class="line">matrix.bottomLeftCorner&lt;r,c&gt;()</div>
<div class="line">matrix.bottomRightCorner&lt;r,c&gt;()</div>
</div><!-- fragment -->  </td></tr>
</table>
<p>Notice that Eigen3 also provides these new convenience methods: topRows(), bottomRows(), leftCols(), rightCols(). See in class <a class="el" href="classEigen_1_1DenseBase.html" title="Base class for all dense matrices, vectors, and arrays. ">DenseBase</a>.</p>
<h1><a class="anchor" id="CoefficientWiseOperations"></a>
Coefficient wise operations</h1>
<p>In Eigen2, coefficient wise operations which have no proper mathematical definition (as a coefficient wise product) were achieved using the .cwise() prefix, e.g.: </p>
<div class="fragment"><div class="line">a.cwise() * b </div>
</div><!-- fragment --><p> In Eigen3 this .cwise() prefix has been superseded by a new kind of matrix type called <a class="el" href="classEigen_1_1Array.html" title="General-purpose arrays with easy API for coefficient-wise operations. ">Array</a> for which all operations are performed coefficient wise. You can easily view a matrix as an array and vice versa using the <a class="el" href="classEigen_1_1MatrixBase.html#a4545be7a9af33ba337a4ebb0101395fd">MatrixBase::array()</a> and <a class="el" href="classEigen_1_1ArrayBase.html#a534d52e9394efc21d065c79c189b78c2">ArrayBase::matrix()</a> functions respectively. Here is an example: </p>
<div class="fragment"><div class="line"><a class="code" href="group__matrixtypedefs.html#ga96452a1b0400ea4ef7935e06914a56b1">Vector4f</a> a, b, c;</div>
<div class="line">c = a.array() * b.array();</div>
</div><!-- fragment --><p> Note that the .array() function is not at all a synonym of the deprecated .cwise() prefix. While the .cwise() prefix changed the behavior of the following operator, the array() function performs a permanent conversion to the array world. Therefore, for binary operations such as the coefficient wise product, both sides must be converted to an <em>array</em> as in the above example. On the other hand, when you concatenate multiple coefficient wise operations you only have to do the conversion once, e.g.: </p>
<div class="fragment"><div class="line"><a class="code" href="group__matrixtypedefs.html#ga96452a1b0400ea4ef7935e06914a56b1">Vector4f</a> a, b, c;</div>
<div class="line">c = a.array().abs().pow(3) * b.array().abs().sin();</div>
</div><!-- fragment --><p> With Eigen2 you would have written: </p>
<div class="fragment"><div class="line">c = (a.cwise().abs().cwise().pow(3)).cwise() * (b.cwise().abs().cwise().sin());</div>
</div><!-- fragment --><h1><a class="anchor" id="PartAndExtract"></a>
Triangular and self-adjoint matrices</h1>
<p>In <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2 you had to play with the part, extract, and marked functions to deal with triangular and selfadjoint matrices. In <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3, all these functions have been removed in favor of the concept of <em>views:</em> </p>
<table  class="manual">
<tr>
<th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2</th><th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3 </th></tr>
<tr>
<td><div class="fragment"><div class="line">A.part&lt;UpperTriangular&gt;();</div>
<div class="line">A.part&lt;StrictlyLowerTriangular&gt;(); </div>
</div><!-- fragment --> </td><td><div class="fragment"><div class="line">A.triangularView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910bae70afef0d3ff7aca74e17e85ff6c9f2e">Upper</a>&gt;()</div>
<div class="line">A.triangularView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910ba29eb98bd08096415c55f37ed4ac2af11">StrictlyLower</a>&gt;()</div>
</div><!-- fragment --> </td></tr>
<tr>
<td><div class="fragment"><div class="line">A.extract&lt;UpperTriangular&gt;();</div>
<div class="line">A.extract&lt;StrictlyLowerTriangular&gt;();</div>
</div><!-- fragment --> </td><td><div class="fragment"><div class="line">A.triangularView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910bae70afef0d3ff7aca74e17e85ff6c9f2e">Upper</a>&gt;()</div>
<div class="line">A.triangularView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910ba29eb98bd08096415c55f37ed4ac2af11">StrictlyLower</a>&gt;()</div>
</div><!-- fragment --> </td></tr>
<tr>
<td><div class="fragment"><div class="line">A.marked&lt;UpperTriangular&gt;();</div>
<div class="line">A.marked&lt;StrictlyLowerTriangular&gt;();</div>
</div><!-- fragment --> </td><td><div class="fragment"><div class="line">A.triangularView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910bae70afef0d3ff7aca74e17e85ff6c9f2e">Upper</a>&gt;()</div>
<div class="line">A.triangularView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910ba29eb98bd08096415c55f37ed4ac2af11">StrictlyLower</a>&gt;()</div>
</div><!-- fragment --> </td></tr>
<tr>
<td colspan="2"></td></tr>
<tr>
<td><div class="fragment"><div class="line">A.part&lt;SelfAdfjoint|UpperTriangular&gt;();</div>
<div class="line">A.extract&lt;SelfAdfjoint|LowerTriangular&gt;();</div>
</div><!-- fragment --> </td><td><div class="fragment"><div class="line">A.selfadjointView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910bae70afef0d3ff7aca74e17e85ff6c9f2e">Upper</a>&gt;()</div>
<div class="line">A.selfadjointView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910baf886b397626076218462d53d50eb96bc">Lower</a>&gt;()</div>
</div><!-- fragment --> </td></tr>
<tr>
<td colspan="2"></td></tr>
<tr>
<td><div class="fragment"><div class="line">UpperTriangular</div>
<div class="line">LowerTriangular</div>
<div class="line">UnitUpperTriangular</div>
<div class="line">UnitLowerTriangular</div>
<div class="line">StrictlyUpperTriangular</div>
<div class="line">StrictlyLowerTriangular</div>
</div><!-- fragment --></td><td><div class="fragment"><div class="line"><a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910bae70afef0d3ff7aca74e17e85ff6c9f2e">Upper</a></div>
<div class="line"><a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910baf886b397626076218462d53d50eb96bc">Lower</a></div>
<div class="line"><a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910ba65b1d67b2bb2e4a85b5f6a8863cd7109">UnitUpper</a></div>
<div class="line"><a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910ba0dc6c411b3fc7ae6e32860a7872b7d18">UnitLower</a></div>
<div class="line"><a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910babf11791f004a059cfdd9b941c76f3703">StrictlyUpper</a></div>
<div class="line"><a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910ba29eb98bd08096415c55f37ed4ac2af11">StrictlyLower</a></div>
</div><!-- fragment -->  </td></tr>
</table>
<dl class="section see"><dt>See Also</dt><dd>class <a class="el" href="classEigen_1_1TriangularView.html" title="Base class for triangular part in a matrix. ">TriangularView</a>, class <a class="el" href="classEigen_1_1SelfAdjointView.html" title="Expression of a selfadjoint matrix from a triangular part of a dense matrix. ">SelfAdjointView</a></dd></dl>
<h1><a class="anchor" id="TriangularSolveInPlace"></a>
Triangular in-place solving</h1>
<table  class="manual">
<tr>
<th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2</th><th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3 </th></tr>
<tr>
<td><div class="fragment"><div class="line">A.triangularSolveInPlace&lt;XxxTriangular&gt;(Y);</div>
</div><!-- fragment --></td><td><div class="fragment"><div class="line">A.triangularView&lt;Xxx&gt;().solveInPlace(Y);</div>
</div><!-- fragment --> </td></tr>
</table>
<h1><a class="anchor" id="Decompositions"></a>
Matrix decompositions</h1>
<p>Some of <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2's matrix decompositions have been renamed in <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3, while some others have been removed and are replaced by other decompositions in <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3.</p>
<table  class="manual">
<tr>
<th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2 </th><th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3 </th><th>Notes  </th></tr>
<tr>
<td>LU </td><td><a class="el" href="classEigen_1_1FullPivLU.html" title="LU decomposition of a matrix with complete pivoting, and related features. ">FullPivLU</a> </td><td class="alt">See also the new <a class="el" href="classEigen_1_1PartialPivLU.html" title="LU decomposition of a matrix with partial pivoting, and related features. ">PartialPivLU</a>, it's much faster  </td></tr>
<tr>
<td>QR </td><td><a class="el" href="classEigen_1_1HouseholderQR.html" title="Householder QR decomposition of a matrix. ">HouseholderQR</a> </td><td class="alt">See also the new <a class="el" href="classEigen_1_1ColPivHouseholderQR.html" title="Householder rank-revealing QR decomposition of a matrix with column-pivoting. ">ColPivHouseholderQR</a>, it's more reliable  </td></tr>
<tr>
<td>SVD </td><td><a class="el" href="classEigen_1_1JacobiSVD.html" title="Two-sided Jacobi SVD decomposition of a rectangular matrix. ">JacobiSVD</a> </td><td class="alt">We currently don't have a bidiagonalizing SVD; of course this is planned.  </td></tr>
<tr>
<td><a class="el" href="classEigen_1_1EigenSolver.html" title="Computes eigenvalues and eigenvectors of general matrices. ">EigenSolver</a> and friends </td><td><div class="fragment"><div class="line"><span class="preprocessor">#include&lt;Eigen/Eigenvalues&gt;</span> </div>
</div><!-- fragment -->  </td><td class="alt">Moved to separate module  </td></tr>
</table>
<h1><a class="anchor" id="LinearSolvers"></a>
Linear solvers</h1>
<table  class="manual">
<tr>
<th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2</th><th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3</th><th>Notes </th></tr>
<tr>
<td><div class="fragment"><div class="line">A.lu();</div>
</div><!-- fragment --> </td><td><div class="fragment"><div class="line">A.fullPivLu();</div>
</div><!-- fragment --> </td><td class="alt">Now A.lu() returns a <a class="el" href="classEigen_1_1PartialPivLU.html" title="LU decomposition of a matrix with partial pivoting, and related features. ">PartialPivLU</a> </td></tr>
<tr>
<td><div class="fragment"><div class="line">A.lu().solve(B,&amp;X);</div>
</div><!-- fragment --> </td><td><div class="fragment"><div class="line">X = A.lu().solve(B);</div>
<div class="line">X = A.fullPivLu().solve(B);</div>
</div><!-- fragment --> </td><td class="alt">The returned by value is fully optimized </td></tr>
<tr>
<td><div class="fragment"><div class="line">A.llt().solve(B,&amp;X);</div>
</div><!-- fragment --> </td><td><div class="fragment"><div class="line">X = A.llt().solve(B);</div>
<div class="line">X = A.selfadjointView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910baf886b397626076218462d53d50eb96bc">Lower</a>&gt;.llt().solve(B);</div>
<div class="line">X = A.selfadjointView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910bae70afef0d3ff7aca74e17e85ff6c9f2e">Upper</a>&gt;.llt().solve(B);</div>
</div><!-- fragment --> </td><td class="alt">The returned by value is fully optimized and <br/>
the selfadjointView API allows you to select the <br/>
triangular part to work on (default is lower part) </td></tr>
<tr>
<td><div class="fragment"><div class="line">A.llt().solveInPlace(B);</div>
</div><!-- fragment --> </td><td><div class="fragment"><div class="line">B = A.llt().solve(B);</div>
<div class="line">B = A.selfadjointView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910baf886b397626076218462d53d50eb96bc">Lower</a>&gt;.llt().solve(B);</div>
<div class="line">B = A.selfadjointView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910bae70afef0d3ff7aca74e17e85ff6c9f2e">Upper</a>&gt;.llt().solve(B);</div>
</div><!-- fragment --> </td><td class="alt">In place solving </td></tr>
<tr>
<td><div class="fragment"><div class="line">A.ldlt().solve(B,&amp;X);</div>
</div><!-- fragment --> </td><td><div class="fragment"><div class="line">X = A.ldlt().solve(B);</div>
<div class="line">X = A.selfadjointView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910baf886b397626076218462d53d50eb96bc">Lower</a>&gt;.ldlt().solve(B);</div>
<div class="line">X = A.selfadjointView&lt;<a class="code" href="group__enums.html#ggab59c1bec446b10af208f977a871d910bae70afef0d3ff7aca74e17e85ff6c9f2e">Upper</a>&gt;.ldlt().solve(B);</div>
</div><!-- fragment --> </td><td class="alt">The returned by value is fully optimized and <br/>
the selfadjointView API allows you to select the <br/>
triangular part to work on </td></tr>
</table>
<h1><a class="anchor" id="GeometryModule"></a>
Changes in the Geometry module</h1>
<p>The Geometry module is the one that changed the most. If you rely heavily on it, it's probably a good idea to use the <a class="el" href="Eigen2SupportModes.html">Eigen 2 support modes</a> to perform your migration.</p>
<h1><a class="anchor" id="Transform"></a>
The Transform class</h1>
<p>In <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2, the <a class="el" href="classEigen_1_1Transform.html" title="Represents an homogeneous transformation in a N dimensional space. ">Transform</a> class didn't really know whether it was a projective or affine transformation. In <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3, it takes a new <em>Mode</em> template parameter, which indicates whether it's <em>Projective</em> or <em>Affine</em> transform. There is no default value.</p>
<p>The Transform3f (etc) typedefs are no more. In <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3, the <a class="el" href="classEigen_1_1Transform.html" title="Represents an homogeneous transformation in a N dimensional space. ">Transform</a> typedefs explicitly refer to the <em>Projective</em> and <em>Affine</em> modes:</p>
<table  class="manual">
<tr>
<th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2</th><th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3</th><th>Notes </th></tr>
<tr>
<td>Transform3f  </td><td>Affine3f or Projective3f  </td><td>Of course 3f is just an example here   </td></tr>
</table>
<h1><a class="anchor" id="LazyVsNoalias"></a>
Lazy evaluation and noalias</h1>
<p>In <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> all operations are performed in a lazy fashion except the matrix products which are always evaluated into a temporary by default. In Eigen2, lazy evaluation could be enforced by tagging a product using the .lazy() function. However, in complex expressions it was not easy to determine where to put the lazy() function. In Eigen3, the lazy() feature has been superseded by the <a class="el" href="classEigen_1_1MatrixBase.html#ae77f3c3ccfb21694555dafc92c2da340">MatrixBase::noalias()</a> function which can be used on the left hand side of an assignment when no aliasing can occur. Here is an example: </p>
<div class="fragment"><div class="line"><a class="code" href="group__matrixtypedefs.html#gabab09c32e96cfa9829a88400627af162">MatrixXf</a> a, b, c;</div>
<div class="line">...</div>
<div class="line">c.noalias() += 2 * a.transpose() * b;</div>
</div><!-- fragment --><p> However, the noalias mechanism does not cover all the features of the old .lazy(). Indeed, in some extremely rare cases, it might be useful to explicit request for a lay product, i.e., for a product which will be evaluated one coefficient at once, on request, just like any other expressions. To this end you can use the <a class="el" href="classEigen_1_1MatrixBase.html#a605309e450951e44eaf5167c59bc3c97">MatrixBase::lazyProduct()</a> function, however we strongly discourage you to use it unless you are sure of what you are doing, i.e., you have rigourosly measured a speed improvement.</p>
<h1><a class="anchor" id="AlignMacros"></a>
Alignment-related macros</h1>
<p>The EIGEN_ALIGN_128 macro has been renamed to EIGEN_ALIGN16. Don't be surprised, it's just that we switched to counting in bytes ;-)</p>
<p>The EIGEN_DONT_ALIGN option still exists in <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3, but it has a new cousin: EIGEN_DONT_ALIGN_STATICALLY. It allows to get rid of all static alignment issues while keeping alignment of dynamic-size heap-allocated arrays, thus keeping vectorization for dynamic-size objects.</p>
<h1><a class="anchor" id="AlignedMap"></a>
Aligned Map objects</h1>
<p>A common issue with <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2 was that when mapping an array with <a class="el" href="classEigen_1_1Map.html" title="A matrix or vector expression mapping an existing array of data. ">Map</a>, there was no way to tell <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> that your array was aligned. There was a ForceAligned option but it didn't mean that; it was just confusing and has been removed.</p>
<p>New in Eigen3 is the <a class="el" href="group__enums.html#gga456ac33d49271d3e2c371351cd1d6371ad5380ca00f3d74b38593adf8a0d06d3e">Aligned</a> option. See the documentation of class <a class="el" href="classEigen_1_1Map.html" title="A matrix or vector expression mapping an existing array of data. ">Map</a>. Use it like this: </p>
<div class="fragment"><div class="line">Map&lt;Vector4f, Aligned&gt; myMappedVector(some_aligned_array);</div>
</div><!-- fragment --><p> There also are related convenience static methods, which actually are the preferred way as they take care of such things as constness: </p>
<div class="fragment"><div class="line">result = Vector4f::MapAligned(some_aligned_array);</div>
</div><!-- fragment --><h1><a class="anchor" id="StdContainers"></a>
STL Containers</h1>
<p>In Eigen2, <code>#include&lt;Eigen/StdVector&gt;</code> tweaked std::vector to automatically align elements. The problem was that that was quite invasive. In Eigen3, we only override standard behavior if you use Eigen::aligned_allocator&lt;T&gt; as your allocator type. So for example, if you use std::vector&lt;Matrix4f&gt;, you need to do the following change (note that <a class="el" href="classEigen_1_1aligned__allocator.html" title="STL compatible allocator to use with with 16 byte aligned types. ">aligned_allocator</a> is under namespace <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a>):</p>
<table  class="manual">
<tr>
<th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 2</th><th><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> 3 </th></tr>
<tr>
<td><div class="fragment"><div class="line">std::vector&lt;Matrix4f&gt; </div>
</div><!-- fragment -->  </td><td><div class="fragment"><div class="line">std::vector&lt;Matrix4f, aligned_allocator&lt;Matrix4f&gt; &gt; </div>
</div><!-- fragment -->   </td></tr>
</table>
<h1><a class="anchor" id="eiPrefix"></a>
Internal ei_ prefix</h1>
<p>In Eigen2, global internal functions and structures were prefixed by <code>ei_</code>. In Eigen3, they all have been moved into the more explicit <code>internal</code> namespace. So, e.g., <code>ei_sqrt(x)</code> now becomes <code>internal::sqrt(x)</code>. Of course it is not recommended to rely on <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a>'s internal features. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Oct 28 2013 11:04:26 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>