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