blob: 1e048d4b299581aeb2870fa7249922a395be1dbc [file] [log] [blame]
Benoit Jacobe078bb22010-06-26 14:00:00 -04001namespace Eigen {
2
Benoit Jacob4d4a23c2010-06-30 10:11:55 -04003/** \page TutorialAdvancedInitialization Tutorial page 5 - Advanced initialization
Benoit Jacobe078bb22010-06-26 14:00:00 -04004 \ingroup Tutorial
5
Benoit Jacob4d4a23c2010-06-30 10:11:55 -04006\li \b Previous: \ref TutorialBlockOperations
7\li \b Next: \ref TutorialLinearAlgebra
8
Benoit Jacobe078bb22010-06-26 14:00:00 -04009\section TutorialMatrixArithmCommaInitializer Comma initializer
10
11Eigen offers a comma initializer syntax which allows to set all the coefficients
12of any dense objects (matrix, vector, array, block, etc.) to specific values:
13\include Tutorial_commainit_01.cpp
14Output: \verbinclude Tutorial_commainit_01.out
15
16Moreover, the elements of the initialization list may themselves be Eigen expressions:
17\include Tutorial_commainit_02.cpp
18Output: \verbinclude Tutorial_commainit_02.out
19
20<span class="note">\b Side \b note: here \link CommaInitializer::finished() .finished() \endlink
21is used to get the actual matrix object once the comma initialization
22of our temporary submatrix is done. Note that despite the apparent complexity of such an expression,
23Eigen's comma initializer usually compiles to very optimized code without any overhead.</span>
24
25
26TODO mention using the comma initializer to fill a block xpr like m.row(i) << 1,2,3;
27
28TODO add more sections about Identity(), Zero(), Constant(), Random(), LinSpaced().
29
Benoit Jacob4d4a23c2010-06-30 10:11:55 -040030\li \b Next: \ref TutorialLinearAlgebra
31
Benoit Jacobe078bb22010-06-26 14:00:00 -040032*/
33
34}