eigen/doc/snippets/Matrix_initializer_list_cxx11.cpp
David Tellenbach db152b9ee6 PR 572: Add initializer list constructors to Matrix and Array (include unit tests and doc)
- {1,2,3,4,5,...} for fixed-size vectors only
- {{1,2,3},{4,5,6}} for the general cases
- {{1,2,3,4,5,....}} is allowed for both row and column-vector
2019-01-21 16:25:57 +01:00

6 lines
104 B
C++

Matrix<int, 2, 3> m {
{1, 2, 3},
{4, 5, 6}
};
VectorXi v {{1, 2}};
cout << m << "\n\n" << v << endl;