From b0eded878d5d162d61583a286c0d8a45406ad1bc Mon Sep 17 00:00:00 2001 From: Rohit Goswami <308505-HaoZeke@users.noreply.gitlab.com> Date: Thu, 6 Apr 2023 19:20:41 +0000 Subject: [PATCH] DOC: Update documentation for 3.4.x --- doc/TutorialSlicingIndexing.dox | 2 +- doc/examples/matrixfree_cg.cpp | 2 +- doc/snippets/Tridiagonalization_decomposeInPlace.cpp | 3 ++- doc/snippets/compile_snippet.cpp.in | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/TutorialSlicingIndexing.dox b/doc/TutorialSlicingIndexing.dox index 8b067df0d..645a7cd07 100644 --- a/doc/TutorialSlicingIndexing.dox +++ b/doc/TutorialSlicingIndexing.dox @@ -14,7 +14,7 @@ In particular, it supports \b slicing that consists in taking a set of rows, col All the aforementioned operations are handled through the generic DenseBase::operator()(const RowIndices&, const ColIndices&) method. Each argument can be: - An integer indexing a single row or column, including symbolic indices. - - The symbol Eigen::all representing the whole set of respective rows or columns in increasing order. + - The symbol Eigen::placeholders::all representing the whole set of respective rows or columns in increasing order. - An ArithmeticSequence as constructed by the Eigen::seq, Eigen::seqN, or Eigen::placeholders::lastN functions. - Any 1D vector/array of integers including %Eigen's vector/array, expressions, std::vector, std::array, as well as plain C arrays: `int[N]`. diff --git a/doc/examples/matrixfree_cg.cpp b/doc/examples/matrixfree_cg.cpp index 413c9a3f8..cc0eead13 100644 --- a/doc/examples/matrixfree_cg.cpp +++ b/doc/examples/matrixfree_cg.cpp @@ -66,7 +66,7 @@ namespace internal { { // This method should implement "dst += alpha * lhs * rhs" inplace, // however, for iterative solvers, alpha is always equal to 1, so let's not bother about it. - assert(alpha==Scalar(1) && "scaling is not implemented"); + eigen_assert(alpha==Scalar(1) && "scaling is not implemented"); EIGEN_ONLY_USED_FOR_DEBUG(alpha); // Here we could simply call dst.noalias() += lhs.my_matrix() * rhs, diff --git a/doc/snippets/Tridiagonalization_decomposeInPlace.cpp b/doc/snippets/Tridiagonalization_decomposeInPlace.cpp index 3cdce679b..9a66baa76 100644 --- a/doc/snippets/Tridiagonalization_decomposeInPlace.cpp +++ b/doc/snippets/Tridiagonalization_decomposeInPlace.cpp @@ -5,7 +5,8 @@ cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl; VectorXd diag(5); VectorXd subdiag(4); VectorXd hcoeffs(4); // Scratch space for householder reflector. -internal::tridiagonalization_inplace(A, diag, subdiag, hcoeffs, true); +VectorXd workspace(5); +internal::tridiagonalization_inplace(A, diag, subdiag, hcoeffs, workspace, true); cout << "The orthogonal matrix Q is:" << endl << A << endl; cout << "The diagonal of the tridiagonal matrix T is:" << endl << diag << endl; cout << "The subdiagonal of the tridiagonal matrix T is:" << endl << subdiag << endl; diff --git a/doc/snippets/compile_snippet.cpp.in b/doc/snippets/compile_snippet.cpp.in index c11457a3f..04f276d0b 100644 --- a/doc/snippets/compile_snippet.cpp.in +++ b/doc/snippets/compile_snippet.cpp.in @@ -2,6 +2,7 @@ static bool eigen_did_assert = false; #define eigen_assert(X) if(!eigen_did_assert && !(X)){ std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X << "\n### The following would happen without assertions:\n"; eigen_did_assert = true;} #include +#include #include #ifndef M_PI