mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
4d4a23cd3e
fix the previous/next links
35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
namespace Eigen {
|
|
|
|
/** \page TutorialAdvancedInitialization Tutorial page 5 - Advanced initialization
|
|
\ingroup Tutorial
|
|
|
|
\li \b Previous: \ref TutorialBlockOperations
|
|
\li \b Next: \ref TutorialLinearAlgebra
|
|
|
|
\section TutorialMatrixArithmCommaInitializer Comma initializer
|
|
|
|
Eigen offers a comma initializer syntax which allows to set all the coefficients
|
|
of any dense objects (matrix, vector, array, block, etc.) to specific values:
|
|
\include Tutorial_commainit_01.cpp
|
|
Output: \verbinclude Tutorial_commainit_01.out
|
|
|
|
Moreover, the elements of the initialization list may themselves be Eigen expressions:
|
|
\include Tutorial_commainit_02.cpp
|
|
Output: \verbinclude Tutorial_commainit_02.out
|
|
|
|
<span class="note">\b Side \b note: here \link CommaInitializer::finished() .finished() \endlink
|
|
is used to get the actual matrix object once the comma initialization
|
|
of our temporary submatrix is done. Note that despite the apparent complexity of such an expression,
|
|
Eigen's comma initializer usually compiles to very optimized code without any overhead.</span>
|
|
|
|
|
|
TODO mention using the comma initializer to fill a block xpr like m.row(i) << 1,2,3;
|
|
|
|
TODO add more sections about Identity(), Zero(), Constant(), Random(), LinSpaced().
|
|
|
|
\li \b Next: \ref TutorialLinearAlgebra
|
|
|
|
*/
|
|
|
|
}
|