namespace Eigen { /** \page Eigen2ToEigen3 Porting from Eigen2 to Eigen3 This page lists the most important API changes between Eigen2 and Eigen3, and gives tips to help porting your application from Eigen2 to Eigen3. \b Table \b of \b contents - \ref CompatibilitySupport - \ref Using - \ref VectorBlocks - \ref Corners - \ref CoefficientWiseOperations - \ref PartAndExtract - \ref TriangularSolveInPlace - \ref Decompositions - \ref LinearSolvers - \ref Transform - \ref LazyVsNoalias - \ref AlignMacros - \ref AlignedMap \section CompatibilitySupport Eigen2 compatibility support In order to ease the switch from Eigen2 to Eigen3, Eigen3 features a compatibility mode which can be enabled by defining the EIGEN2_SUPPORT preprocessor token \b before including any Eigen header (typically it should be set in your project options). \section Using The USING_PART_OF_NAMESPACE_EIGEN macro The USING_PART_OF_NAMESPACE_EIGEN macro has been removed. In Eigen 3, just do: \code using namespace Eigen; \endcode \section VectorBlocks Vector blocks
Eigen 2 | Eigen 3 |
---|---|
\code
vector.start(length)
vector.start | \code
vector.head(length)
vector.head |
Eigen 2 | Eigen 3 |
---|---|
\code
matrix.corner(TopLeft,r,c)
matrix.corner(TopRight,r,c)
matrix.corner(BottomLeft,r,c)
matrix.corner(BottomRight,r,c)
matrix.corner | \code
matrix.topLeftCorner(r,c)
matrix.topRightCorner(r,c)
matrix.bottomLeftCorner(r,c)
matrix.bottomRightCorner(r,c)
matrix.topLeftCorner |
Eigen 2 | Eigen 3 |
---|---|
\code
A.part |
\code
A.triangularView |
\code
A.extract |
\code
A.triangularView |
\code
A.marked |
\code
A.triangularView |
\code
A.part |
\code
A.selfadjointView |
\code UpperTriangular LowerTriangular UnitUpperTriangular UnitLowerTriangular StrictlyUpperTriangular StrictlyLowerTriangular \endcode | \code Upper Lower UnitUpper UnitLower StrictlyUpper StrictlyLower \endcode |
Eigen 2 | Eigen 3 |
---|---|
\code A.triangularSolveInPlace | \code A.triangularView |
Eigen 2 | Eigen 3 | Notes |
---|---|---|
LU | FullPivLU | See also the new PartialPivLU, it's much faster |
QR | HouseholderQR | See also the new ColPivHouseholderQR, it's more reliable |
SVD | JacobiSVD | We currently don't have a bidiagonalizing SVD; of course this is planned. |
EigenSolver and friends | \code #include |
Moved to separate module |
Eigen 2 | Eigen 3 | Notes |
---|---|---|
\code A.lu();\endcode | \code A.fullPivLu();\endcode | Now A.lu() returns a PartialPivLU |
\code A.lu().solve(B,&X);\endcode | \code X = A.lu().solve(B); X = A.fullPivLu().solve(B);\endcode | The returned by value is fully optimized |
\code A.llt().solve(B,&X);\endcode | \code X = A.llt().solve(B);
X = A.selfadjointView |
The returned by value is fully optimized and \n the selfadjointView API allows you to select the \n triangular part to work on (default is lower part) |
\code A.llt().solveInPlace(B);\endcode | \code B = A.llt().solve(B);
B = A.selfadjointView |
In place solving |
\code A.ldlt().solve(B,&X);\endcode | \code X = A.ldlt().solve(B);
X = A.selfadjointView |
The returned by value is fully optimized and \n the selfadjointView API allows you to select the \n triangular part to work on |
Eigen 2 | Eigen 3 | Notes |
---|---|---|
Transform3f | Affine3f or Projective3f | Of course 3f is just an example here |