mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Several changes in comments to keep Doxygen happy.
This commit is contained in:
@@ -87,7 +87,7 @@ Output: \verbinclude Tutorial_AdvancedInitialization_LinSpaced.out
|
||||
|
||||
This example shows that objects like the ones returned by LinSpaced() can be assigned to variables (and
|
||||
expressions). Eigen defines utility functions like \link DenseBase::setZero() setZero()\endlink,
|
||||
\link MatrixBase::setIdentity() \endlink and \link DenseBase:setLinSpaced() \endlink to do this
|
||||
\link MatrixBase::setIdentity() \endlink and \link DenseBase::setLinSpaced() \endlink to do this
|
||||
conveniently. The following example contrasts three ways to construct the matrix
|
||||
\f$ J = \bigl[ \begin{smallmatrix} O & I \\ I & O \end{smallmatrix} \bigr] \f$: using static methods and
|
||||
assignment, using static methods and the comma-initializer, or using the setXxx() methods.
|
||||
|
||||
@@ -37,7 +37,7 @@ The \em trace of a matrix, as returned by the function \c trace(), is the sum of
|
||||
|
||||
|
||||
\subsection TutorialReductionsVisitorsBroadcastingReductionsNorm Norm reductions
|
||||
Eigen also provides reductions to obtain the Euclidean norm or squared norm of a vector with \link MatrixBase::norm() norm() \endlink and \link Matrix::squaredNorm() squaredNorm() \endlink respectively.
|
||||
Eigen also provides reductions to obtain the Euclidean norm or squared norm of a vector with \link MatrixBase::norm() norm() \endlink and \link MatrixBase::squaredNorm() squaredNorm() \endlink respectively.
|
||||
These operations can also operate on matrices; in that case, they use the Frobenius norm. The following example shows these methods.
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
@@ -190,7 +190,7 @@ reductions and partial reductions.
|
||||
|
||||
Now that broadcasting, reductions and partial reductions have been introduced, we can dive into a more advanced example that finds
|
||||
the nearest neighbour of a vector <tt>v</tt> within the columns of matrix <tt>m</tt>. The Euclidean distance will be used in this example,
|
||||
computing the squared Euclidean distance with the partial reduction named \link DenseBase::squaredNorm() squaredNorm() \endlink:
|
||||
computing the squared Euclidean distance with the partial reduction named \link MatrixBase::squaredNorm() squaredNorm() \endlink:
|
||||
|
||||
<table class="tutorial_code"><tr><td>
|
||||
Example: \include Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp
|
||||
|
||||
@@ -457,7 +457,7 @@ mat = 2 7 8
|
||||
\endcode</td></tr>
|
||||
</table>
|
||||
|
||||
Special versions of \link DenseBase::minCoeff(int*,int*) minCoeff \endlink and \link DenseBase::maxCoeff(int*,int*) maxCoeff \endlink:
|
||||
Special versions of \link DenseBase::minCoeff(Index*,Index*) minCoeff \endlink and \link DenseBase::maxCoeff(Index*,Index*) maxCoeff \endlink:
|
||||
<div class="desired_tutorial_width">
|
||||
\code
|
||||
int i, j;
|
||||
@@ -476,8 +476,8 @@ if((array1 < array2).any()) ... // if there exist a pair i,j such that array1(i,
|
||||
|
||||
<a href="#" class="top">top</a>\section QuickRef_Blocks Sub-matrices
|
||||
|
||||
Read-write access to a \link DenseBase::col(int) column \endlink
|
||||
or a \link DenseBase::row(int) row \endlink of a matrix (or array):
|
||||
Read-write access to a \link DenseBase::col(Index) column \endlink
|
||||
or a \link DenseBase::row(Index) row \endlink of a matrix (or array):
|
||||
<div class="desired_tutorial_width">
|
||||
\code
|
||||
mat1.row(i) = mat2.col(j);
|
||||
@@ -501,9 +501,9 @@ Read-write access to sub-vectors:
|
||||
Read-write access to sub-matrices:</td><td></td><td></td></tr>
|
||||
<tr>
|
||||
<td>\code mat1.block(i,j,rows,cols)\endcode
|
||||
\link DenseBase::block(int,int,int,int) (more) \endlink</td>
|
||||
\link DenseBase::block(Index,Index,Index,Index) (more) \endlink</td>
|
||||
<td>\code mat1.block<rows,cols>(i,j)\endcode
|
||||
\link DenseBase::block(int,int) (more) \endlink</td>
|
||||
\link DenseBase::block(Index,Index) (more) \endlink</td>
|
||||
<td>the \c rows x \c cols sub-matrix \n starting from position (\c i,\c j)</td></tr>
|
||||
<tr><td>\code
|
||||
mat1.topLeftCorner(rows,cols)
|
||||
@@ -547,7 +547,7 @@ Declare a diagonal matrix</td><td>\code
|
||||
DiagonalMatrix<Scalar,SizeAtCompileTime> diag1(size);
|
||||
diag1.diagonal() = vector;\endcode
|
||||
</td></tr>
|
||||
<tr><td>Access the \link MatrixBase::diagonal() diagonal \endlink and \link MatrixBase::diagonal(int) super/sub diagonals \endlink of a matrix as a vector (read/write)</td>
|
||||
<tr><td>Access the \link MatrixBase::diagonal() diagonal \endlink and \link MatrixBase::diagonal(Index) super/sub diagonals \endlink of a matrix as a vector (read/write)</td>
|
||||
<td>\code
|
||||
vec1 = mat1.diagonal(); mat1.diagonal() = vec1; // main diagonal
|
||||
vec1 = mat1.diagonal(+n); mat1.diagonal(+n) = vec1; // n-th super diagonal
|
||||
|
||||
Reference in New Issue
Block a user