aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2017-01-04 23:08:27 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2017-01-04 23:08:27 +0100
commit5165de97a44869188b19e62b669b6bc78d8e96e0 (patch)
tree1f8efa46fc7f98a676c162fcbb5bb6766f00d7d9 /doc/snippets
parenta0a36ad0efd3f36545a16e78faf5ce2efa2dd7d3 (diff)
Add missing snippet files.
Diffstat (limited to 'doc/snippets')
-rw-r--r--doc/snippets/Cwise_boolean_xor.cpp2
-rw-r--r--doc/snippets/MatrixBase_selfadjointView.cpp6
2 files changed, 8 insertions, 0 deletions
diff --git a/doc/snippets/Cwise_boolean_xor.cpp b/doc/snippets/Cwise_boolean_xor.cpp
new file mode 100644
index 000000000..99bcc5e09
--- /dev/null
+++ b/doc/snippets/Cwise_boolean_xor.cpp
@@ -0,0 +1,2 @@
+.Array3d v(-1,2,1), w(-3,2,3);
+cout << ((v<w) ^ (v<0)) << endl;
diff --git a/doc/snippets/MatrixBase_selfadjointView.cpp b/doc/snippets/MatrixBase_selfadjointView.cpp
new file mode 100644
index 000000000..4bd3c7eeb
--- /dev/null
+++ b/doc/snippets/MatrixBase_selfadjointView.cpp
@@ -0,0 +1,6 @@
+Matrix3i m = Matrix3i::Random();
+cout << "Here is the matrix m:" << endl << m << endl;
+cout << "Here is the symmetric matrix extracted from the upper part of m:" << endl
+ << Matrix3i(m.selfadjointView<Upper>()) << endl;
+cout << "Here is the symmetric matrix extracted from the lower part of m:" << endl
+ << Matrix3i(m.selfadjointView<Lower>()) << endl;