From 8bca23bbec33a5ef755da641116418f4dc90e0da Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Sat, 12 Feb 2011 23:17:31 +0000 Subject: Mention comma initializer can be used to concatenate vectors (inspired by a question on IRC) --- doc/snippets/Tutorial_AdvancedInitialization_Join.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/snippets/Tutorial_AdvancedInitialization_Join.cpp (limited to 'doc/snippets') diff --git a/doc/snippets/Tutorial_AdvancedInitialization_Join.cpp b/doc/snippets/Tutorial_AdvancedInitialization_Join.cpp new file mode 100644 index 000000000..84e8715cb --- /dev/null +++ b/doc/snippets/Tutorial_AdvancedInitialization_Join.cpp @@ -0,0 +1,11 @@ +RowVectorXd vec1(3); +vec1 << 1, 2, 3; +std::cout << "vec1 = " << vec1 << std::endl; + +RowVectorXd vec2(4); +vec2 << 1, 4, 9, 16;; +std::cout << "vec2 = " << vec2 << std::endl; + +RowVectorXd joined(7); +joined << vec1, vec2; +std::cout << "joined = " << joined << std::endl; -- cgit v1.2.3