Various documentation updates:
- update the tutorial
- update doc of deprecated cwise function
- update cwise doc snippets
diff --git a/doc/snippets/Cwise_abs.cpp b/doc/snippets/Cwise_abs.cpp
index 7f94dbd..0aeec3a 100644
--- a/doc/snippets/Cwise_abs.cpp
+++ b/doc/snippets/Cwise_abs.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,-2,-3);
-cout << v.cwise().abs() << endl;
+Array3d v(1,-2,-3);
+cout << v.abs() << endl;
diff --git a/doc/snippets/Cwise_abs2.cpp b/doc/snippets/Cwise_abs2.cpp
index 3b338af..2c4f9b3 100644
--- a/doc/snippets/Cwise_abs2.cpp
+++ b/doc/snippets/Cwise_abs2.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,-2,-3);
-cout << v.cwise().abs2() << endl;
+Array3d v(1,-2,-3);
+cout << v.abs2() << endl;
diff --git a/doc/snippets/Cwise_cos.cpp b/doc/snippets/Cwise_cos.cpp
index 4eb230a..f589f07 100644
--- a/doc/snippets/Cwise_cos.cpp
+++ b/doc/snippets/Cwise_cos.cpp
@@ -1,2 +1,2 @@
-Vector3d v(M_PI, M_PI/2, M_PI/3);
-cout << v.cwise().cos() << endl;
+Array3d v(M_PI, M_PI/2, M_PI/3);
+cout << v.cos() << endl;
diff --git a/doc/snippets/Cwise_cube.cpp b/doc/snippets/Cwise_cube.cpp
index fd40436..85e41dc 100644
--- a/doc/snippets/Cwise_cube.cpp
+++ b/doc/snippets/Cwise_cube.cpp
@@ -1,2 +1,2 @@
-Vector3d v(2,3,4);
-cout << v.cwise().cube() << endl;
+Array3d v(2,3,4);
+cout << v.cube() << endl;
diff --git a/doc/snippets/Cwise_equal_equal.cpp b/doc/snippets/Cwise_equal_equal.cpp
index ea49120..0ba96f6 100644
--- a/doc/snippets/Cwise_equal_equal.cpp
+++ b/doc/snippets/Cwise_equal_equal.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,3), w(3,2,1);
-cout << (v.cwise()==w) << endl;
+Array3d v(1,2,3), w(3,2,1);
+cout << (v==w) << endl;
diff --git a/doc/snippets/Cwise_exp.cpp b/doc/snippets/Cwise_exp.cpp
index c22fd4c..db23618 100644
--- a/doc/snippets/Cwise_exp.cpp
+++ b/doc/snippets/Cwise_exp.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,3);
-cout << v.cwise().exp() << endl;
+Array3d v(1,2,3);
+cout << v.exp() << endl;
diff --git a/doc/snippets/Cwise_greater.cpp b/doc/snippets/Cwise_greater.cpp
index 54641e1..40ad029 100644
--- a/doc/snippets/Cwise_greater.cpp
+++ b/doc/snippets/Cwise_greater.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,3), w(3,2,1);
-cout << (v.cwise()>w) << endl;
+Array3d v(1,2,3), w(3,2,1);
+cout << (v>w) << endl;
diff --git a/doc/snippets/Cwise_greater_equal.cpp b/doc/snippets/Cwise_greater_equal.cpp
index 744a9ae..6a08f89 100644
--- a/doc/snippets/Cwise_greater_equal.cpp
+++ b/doc/snippets/Cwise_greater_equal.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,3), w(3,2,1);
-cout << (v.cwise()>=w) << endl;
+Array3d v(1,2,3), w(3,2,1);
+cout << (v>=w) << endl;
diff --git a/doc/snippets/Cwise_inverse.cpp b/doc/snippets/Cwise_inverse.cpp
index 7f6eee8..3967a7e 100644
--- a/doc/snippets/Cwise_inverse.cpp
+++ b/doc/snippets/Cwise_inverse.cpp
@@ -1,2 +1,2 @@
-Vector3d v(2,3,4);
-cout << v.cwise().inverse() << endl;
+Array3d v(2,3,4);
+cout << v.inverse() << endl;
diff --git a/doc/snippets/Cwise_less.cpp b/doc/snippets/Cwise_less.cpp
index 008e3d9..cafd3b6 100644
--- a/doc/snippets/Cwise_less.cpp
+++ b/doc/snippets/Cwise_less.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,3), w(3,2,1);
-cout << (v.cwise()<w) << endl;
+Array3d v(1,2,3), w(3,2,1);
+cout << (v<w) << endl;
diff --git a/doc/snippets/Cwise_less_equal.cpp b/doc/snippets/Cwise_less_equal.cpp
index 3b7a68e..1600e39 100644
--- a/doc/snippets/Cwise_less_equal.cpp
+++ b/doc/snippets/Cwise_less_equal.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,3), w(3,2,1);
-cout << (v.cwise()<=w) << endl;
+Array3d v(1,2,3), w(3,2,1);
+cout << (v<=w) << endl;
diff --git a/doc/snippets/Cwise_log.cpp b/doc/snippets/Cwise_log.cpp
index 2fa28eb..f7aca72 100644
--- a/doc/snippets/Cwise_log.cpp
+++ b/doc/snippets/Cwise_log.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,3);
-cout << v.cwise().log() << endl;
+Array3d v(1,2,3);
+cout << v.log() << endl;
diff --git a/doc/snippets/Cwise_max.cpp b/doc/snippets/Cwise_max.cpp
index a03bccf..6602881 100644
--- a/doc/snippets/Cwise_max.cpp
+++ b/doc/snippets/Cwise_max.cpp
@@ -1,2 +1,2 @@
-Vector3d v(2,3,4), w(4,2,3);
-cout << v.cwise().max(w) << endl;
+Array3d v(2,3,4), w(4,2,3);
+cout << v.max(w) << endl;
diff --git a/doc/snippets/Cwise_min.cpp b/doc/snippets/Cwise_min.cpp
index a31d5a8..1c01c76 100644
--- a/doc/snippets/Cwise_min.cpp
+++ b/doc/snippets/Cwise_min.cpp
@@ -1,2 +1,2 @@
-Vector3d v(2,3,4), w(4,2,3);
-cout << v.cwise().min(w) << endl;
+Array3d v(2,3,4), w(4,2,3);
+cout << v.min(w) << endl;
diff --git a/doc/snippets/Cwise_minus.cpp b/doc/snippets/Cwise_minus.cpp
index 5b8e692..b89b9fb 100644
--- a/doc/snippets/Cwise_minus.cpp
+++ b/doc/snippets/Cwise_minus.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,3);
-cout << v.cwise()-5 << endl;
+Array3d v(1,2,3);
+cout << v-5 << endl;
diff --git a/doc/snippets/Cwise_minus_equal.cpp b/doc/snippets/Cwise_minus_equal.cpp
index 6919ca1..dfde49d 100644
--- a/doc/snippets/Cwise_minus_equal.cpp
+++ b/doc/snippets/Cwise_minus_equal.cpp
@@ -1,3 +1,3 @@
-Vector3d v(1,2,3);
-v.cwise() -= 5;
+Array3d v(1,2,3);
+v -= 5;
cout << v << endl;
diff --git a/doc/snippets/Cwise_not_equal.cpp b/doc/snippets/Cwise_not_equal.cpp
index fd0c38f..57a407a 100644
--- a/doc/snippets/Cwise_not_equal.cpp
+++ b/doc/snippets/Cwise_not_equal.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,3), w(3,2,1);
-cout << (v.cwise()!=w) << endl;
+Array3d v(1,2,3), w(3,2,1);
+cout << (v!=w) << endl;
diff --git a/doc/snippets/Cwise_plus.cpp b/doc/snippets/Cwise_plus.cpp
index d62cf7b..9d47327 100644
--- a/doc/snippets/Cwise_plus.cpp
+++ b/doc/snippets/Cwise_plus.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,3);
-cout << v.cwise()+5 << endl;
+Array3d v(1,2,3);
+cout << v+5 << endl;
diff --git a/doc/snippets/Cwise_plus_equal.cpp b/doc/snippets/Cwise_plus_equal.cpp
index 8dfa2af..d744b1e 100644
--- a/doc/snippets/Cwise_plus_equal.cpp
+++ b/doc/snippets/Cwise_plus_equal.cpp
@@ -1,3 +1,3 @@
-Vector3d v(1,2,3);
-v.cwise() += 5;
+Array3d v(1,2,3);
+v += 5;
cout << v << endl;
diff --git a/doc/snippets/Cwise_pow.cpp b/doc/snippets/Cwise_pow.cpp
index 6a58ddf..a723ed8 100644
--- a/doc/snippets/Cwise_pow.cpp
+++ b/doc/snippets/Cwise_pow.cpp
@@ -1,2 +1,2 @@
-Vector3d v(8,27,64);
-cout << v.cwise().pow(0.333333) << endl;
+Array3d v(8,27,64);
+cout << v.pow(0.333333) << endl;
diff --git a/doc/snippets/Cwise_product.cpp b/doc/snippets/Cwise_product.cpp
index 460ed67..714d66d 100644
--- a/doc/snippets/Cwise_product.cpp
+++ b/doc/snippets/Cwise_product.cpp
@@ -1,4 +1,4 @@
-Matrix3i a = Matrix3i::Random(), b = Matrix3i::Random();
-Matrix3i c = a.cwise() * b;
+Array33i a = Array33i::Random(), b = Array33i::Random();
+Array33i c = a * b;
cout << "a:\n" << a << "\nb:\n" << b << "\nc:\n" << c << endl;
diff --git a/doc/snippets/Cwise_quotient.cpp b/doc/snippets/Cwise_quotient.cpp
index 9ad2044..7cb9f7f 100644
--- a/doc/snippets/Cwise_quotient.cpp
+++ b/doc/snippets/Cwise_quotient.cpp
@@ -1,2 +1,2 @@
-Vector3d v(2,3,4), w(4,2,3);
-cout << v.cwise()/w << endl;
+Array3d v(2,3,4), w(4,2,3);
+cout << v/w << endl;
diff --git a/doc/snippets/Cwise_sin.cpp b/doc/snippets/Cwise_sin.cpp
index 41ffcc2..46fa908 100644
--- a/doc/snippets/Cwise_sin.cpp
+++ b/doc/snippets/Cwise_sin.cpp
@@ -1,2 +1,2 @@
-Vector3d v(M_PI, M_PI/2, M_PI/3);
-cout << v.cwise().sin() << endl;
+Array3d v(M_PI, M_PI/2, M_PI/3);
+cout << v.sin() << endl;
diff --git a/doc/snippets/Cwise_slash_equal.cpp b/doc/snippets/Cwise_slash_equal.cpp
index 10c4f4a..2efd32d 100644
--- a/doc/snippets/Cwise_slash_equal.cpp
+++ b/doc/snippets/Cwise_slash_equal.cpp
@@ -1,4 +1,3 @@
-Vector3d v(3,2,4);
-Vector3d w(5,4,2);
-v.cwise() /= w;
+Array3d v(3,2,4), w(5,4,2);
+v /= w;
cout << v << endl;
diff --git a/doc/snippets/Cwise_sqrt.cpp b/doc/snippets/Cwise_sqrt.cpp
index 2b825b4..97bafe8 100644
--- a/doc/snippets/Cwise_sqrt.cpp
+++ b/doc/snippets/Cwise_sqrt.cpp
@@ -1,2 +1,2 @@
-Vector3d v(1,2,4);
-cout << v.cwise().sqrt() << endl;
+Array3d v(1,2,4);
+cout << v.sqrt() << endl;
diff --git a/doc/snippets/Cwise_square.cpp b/doc/snippets/Cwise_square.cpp
index 9ed41c2..f704c5e 100644
--- a/doc/snippets/Cwise_square.cpp
+++ b/doc/snippets/Cwise_square.cpp
@@ -1,2 +1,2 @@
-Vector3d v(2,3,4);
-cout << v.cwise().square() << endl;
+Array3d v(2,3,4);
+cout << v.square() << endl;
diff --git a/doc/snippets/Cwise_times_equal.cpp b/doc/snippets/Cwise_times_equal.cpp
index 7db95b0..147556c 100644
--- a/doc/snippets/Cwise_times_equal.cpp
+++ b/doc/snippets/Cwise_times_equal.cpp
@@ -1,4 +1,3 @@
-Vector3d v(1,2,3);
-Vector3d w(2,3,0);
-v.cwise() *= w;
+Array3d v(1,2,3), w(2,3,0);
+v *= w;
cout << v << endl;
diff --git a/doc/snippets/MatrixBase_all.cpp b/doc/snippets/MatrixBase_all.cpp
index 4a39e21..46f26f1 100644
--- a/doc/snippets/MatrixBase_all.cpp
+++ b/doc/snippets/MatrixBase_all.cpp
@@ -1,7 +1,7 @@
Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones());
-Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwise().abs();
+Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs();
// let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax:
cout << "Is (" << p0.transpose() << ") inside the box: "
- << ((boxMin.cwise()<p0).all() && (boxMax.cwise()>p0).all()) << endl;
+ << ((boxMin.array()<p0.array()).all() && (boxMax.array()>p0.array()).all()) << endl;
cout << "Is (" << p1.transpose() << ") inside the box: "
- << ((boxMin.cwise()<p1).all() && (boxMax.cwise()>p1).all()) << endl;
+ << ((boxMin.array()<p1.array()).all() && (boxMax.array()>p1.array()).all()) << endl;
diff --git a/doc/snippets/MatrixBase_array.cpp b/doc/snippets/MatrixBase_array.cpp
new file mode 100644
index 0000000..f215086
--- /dev/null
+++ b/doc/snippets/MatrixBase_array.cpp
@@ -0,0 +1,4 @@
+Vector3d v(1,2,3);
+v.array() += 3;
+v.array() -= 2;
+cout << v << endl;
diff --git a/doc/snippets/MatrixBase_array_const.cpp b/doc/snippets/MatrixBase_array_const.cpp
new file mode 100644
index 0000000..cd3b26a
--- /dev/null
+++ b/doc/snippets/MatrixBase_array_const.cpp
@@ -0,0 +1,4 @@
+Vector3d v(-1,2,-3);
+cout << "the absolute values:" << endl << v.array().abs() << endl;
+cout << "the absolute values plus one:" << endl << v.array().abs()+1 << endl;
+cout << "sum of the squares: " << v.array().square().sum() << endl;
diff --git a/doc/snippets/MatrixBase_colwise.cpp b/doc/snippets/MatrixBase_colwise.cpp
index c8b380c..a048bef 100644
--- a/doc/snippets/MatrixBase_colwise.cpp
+++ b/doc/snippets/MatrixBase_colwise.cpp
@@ -2,4 +2,4 @@
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the sum of each column:" << endl << m.colwise().sum() << endl;
cout << "Here is the maximum absolute value of each column:"
- << endl << m.cwise().abs().colwise().maxCoeff() << endl;
+ << endl << m.cwiseAbs().colwise().maxCoeff() << endl;
diff --git a/doc/snippets/MatrixBase_cwise.cpp b/doc/snippets/MatrixBase_cwise.cpp
deleted file mode 100644
index f246a1a..0000000
--- a/doc/snippets/MatrixBase_cwise.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-Vector3d v(1,2,3);
-v.cwise() += 3;
-v.cwise() -= 2;
-cout << v << endl;
diff --git a/doc/snippets/MatrixBase_cwise_const.cpp b/doc/snippets/MatrixBase_cwise_const.cpp
deleted file mode 100644
index 2b7e481..0000000
--- a/doc/snippets/MatrixBase_cwise_const.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-Vector3d v(-1,2,-3);
-cout << "the absolute values:" << endl << v.cwise().abs() << endl;
-cout << "the absolute values plus one:" << endl << v.cwise().abs().cwise()+1 << endl;
-cout << "sum of the squares: " << v.cwise().square().sum() << endl;
diff --git a/doc/snippets/MatrixBase_lazy.cpp b/doc/snippets/MatrixBase_lazy.cpp
deleted file mode 100644
index 0177b1e..0000000
--- a/doc/snippets/MatrixBase_lazy.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-Matrix2d m; m << 1,2,3,4;
-cout << (m*m).lazy().row(0) << endl;
- // this computes only one row of the product. By contrast,
- // if we did "(m*m).row(0);" then m*m would first be evaluated into
- // a temporary, because the Product expression has the EvalBeforeNestingBit.
diff --git a/doc/snippets/MatrixBase_noalias.cpp b/doc/snippets/MatrixBase_noalias.cpp
new file mode 100644
index 0000000..3b54a79
--- /dev/null
+++ b/doc/snippets/MatrixBase_noalias.cpp
@@ -0,0 +1,3 @@
+Matrix2d a, b, c; a << 1,2,3,4; b << 5,6,7,8;
+c.noalias() = a * b; // this computes the product directly to c
+cout << c << endl;
diff --git a/doc/snippets/MatrixBase_rowwise.cpp b/doc/snippets/MatrixBase_rowwise.cpp
index 2205465..ae93964 100644
--- a/doc/snippets/MatrixBase_rowwise.cpp
+++ b/doc/snippets/MatrixBase_rowwise.cpp
@@ -2,4 +2,4 @@
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the sum of each row:" << endl << m.rowwise().sum() << endl;
cout << "Here is the maximum absolute value of each row:"
- << endl << m.cwise().abs().rowwise().maxCoeff() << endl;
+ << endl << m.cwiseAbs().rowwise().maxCoeff() << endl;
diff --git a/doc/snippets/MatrixBase_select.cpp b/doc/snippets/MatrixBase_select.cpp
index 54893be..ae5477f 100644
--- a/doc/snippets/MatrixBase_select.cpp
+++ b/doc/snippets/MatrixBase_select.cpp
@@ -1,6 +1,6 @@
MatrixXi m(3, 3);
-m << 1, 2, 3,
- 4, 5, 6,
+m << 1, 2, 3,
+ 4, 5, 6,
7, 8, 9;
-m = (m.cwise() >= 5).select(-m, m);
+m = (m.array() >= 5).select(-m, m);
cout << m << endl;
diff --git a/doc/snippets/PartialRedux_count.cpp b/doc/snippets/PartialRedux_count.cpp
index 914a5de..c7b3097 100644
--- a/doc/snippets/PartialRedux_count.cpp
+++ b/doc/snippets/PartialRedux_count.cpp
@@ -1,3 +1,3 @@
Matrix3d m = Matrix3d::Random();
cout << "Here is the matrix m:" << endl << m << endl;
-cout << "Here is the count of elements larger or equal than 0.5 of each row:" << endl << (m.cwise() >= 0.5).rowwise().count() << endl;
+cout << "Here is the count of elements larger or equal than 0.5 of each row:" << endl << (m.array() >= 0.5).rowwise().count() << endl;