summaryrefslogtreecommitdiffhomepage
path: root/eigen/doc/examples/DenseBase_template_int_middleCols.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'eigen/doc/examples/DenseBase_template_int_middleCols.cpp')
-rw-r--r--eigen/doc/examples/DenseBase_template_int_middleCols.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/eigen/doc/examples/DenseBase_template_int_middleCols.cpp b/eigen/doc/examples/DenseBase_template_int_middleCols.cpp
new file mode 100644
index 0000000..6191d79
--- /dev/null
+++ b/eigen/doc/examples/DenseBase_template_int_middleCols.cpp
@@ -0,0 +1,15 @@
+#include <Eigen/Core>
+#include <iostream>
+
+using namespace Eigen;
+using namespace std;
+
+int main(void)
+{
+ int const N = 5;
+ MatrixXi A(N,N);
+ A.setRandom();
+ cout << "A =\n" << A << '\n' << endl;
+ cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl;
+ return 0;
+}