mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-21 09:09:36 +08:00
allows blocks of code to be larger than the page body (like tables)
This commit is contained in:
parent
e19c6b89f5
commit
e5073746f3
@ -40,26 +40,22 @@ The Eigen library is divided in a Core module and several additional modules. Ea
|
||||
|
||||
|
||||
\b Recall: Eigen provides two kinds of dense objects: mathematical matrices and vectors which are both represented by the template class Matrix, and general 1D and 2D arrays represented by the template class Array:
|
||||
<div class="desired_tutorial_width">
|
||||
\code
|
||||
typedef Matrix<Scalar, RowsAtCompileTime, ColsAtCompileTime, Options> MyMatrixType;
|
||||
typedef Array<Scalar, RowsAtCompileTime, ColsAtCompileTime, Options> MyArrayType;
|
||||
\endcode
|
||||
</div>
|
||||
|
||||
\li \c Scalar is the scalar type of the coefficients (e.g., \c float, \c double, \c bool, \c int, etc.).
|
||||
\li \c RowsAtCompileTime and \c ColsAtCompileTime are the number of rows and columns of the matrix as known at compile-time or \c Dynamic.
|
||||
\li \c Options can be \c ColMajor or \c RowMajor, default is \c ColMajor. (see class Matrix for more options)
|
||||
|
||||
All combinations are allowed: you can have a matrix with a fixed number of rows and a dynamic number of columns, etc. The following are all valid:
|
||||
<div class="desired_tutorial_width">
|
||||
\code
|
||||
Matrix<double, 6, Dynamic> // Dynamic number of columns (heap allocation)
|
||||
Matrix<double, Dynamic, 2> // Dynamic number of rows (heap allocation)
|
||||
Matrix<double, Dynamic, Dynamic, RowMajor> // Fully dynamic, row major (heap allocation)
|
||||
Matrix<double, 13, 3> // Fully fixed (static allocation)
|
||||
\endcode
|
||||
</div>
|
||||
|
||||
In most cases, you can simply use one of the convenience typedefs for \ref matrixtypedefs "matrices" and \ref arraytypedefs "arrays". Some examples:
|
||||
<table class="example">
|
||||
@ -80,7 +76,6 @@ Array<float,4,1> <=> Array4f
|
||||
</table>
|
||||
|
||||
Conversion between the matrix and array worlds:
|
||||
<div class="desired_tutorial_width">
|
||||
\code
|
||||
Array44f a1, a1;
|
||||
Matrix4f m1, m2;
|
||||
@ -91,7 +86,6 @@ m2 = a1.matrix() + m1; // and explicit conversion is required.
|
||||
ArrayWrapper<Matrix4f> m1a(m1); // m1a is an alias for m1.array(), they share the same coefficients
|
||||
MatrixWrapper<Array44f> a1m(a1);
|
||||
\endcode
|
||||
</div>
|
||||
|
||||
In the rest of this document we will use the following symbols to emphasize the features which are specifics to a given kind of object:
|
||||
\li <a name="matrixonly"><a/>\matrixworld linear algebra matrix and vector only
|
||||
@ -459,32 +453,26 @@ mat = 2 7 8
|
||||
</table>
|
||||
|
||||
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;
|
||||
s = vector.minCoeff(&i); // s == vector[i]
|
||||
s = matrix.maxCoeff(&i, &j); // s == matrix(i,j)
|
||||
\endcode
|
||||
</div>
|
||||
Typical use cases of all() and any():
|
||||
<div class="desired_tutorial_width">
|
||||
\code
|
||||
if((array1 > 0).all()) ... // if all coefficients of array1 are greater than 0 ...
|
||||
if((array1 < array2).any()) ... // if there exist a pair i,j such that array1(i,j) < array2(i,j) ...
|
||||
\endcode
|
||||
</div>
|
||||
|
||||
|
||||
<a href="#" class="top">top</a>\section QuickRef_Blocks Sub-matrices
|
||||
|
||||
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);
|
||||
mat1.col(j1).swap(mat1.col(j2));
|
||||
\endcode
|
||||
</div>
|
||||
|
||||
Read-write access to sub-vectors:
|
||||
<table class="manual">
|
||||
|
@ -142,7 +142,7 @@ pre.fragment {
|
||||
padding: 4px 6px;
|
||||
margin: 4px 8px 4px 2px;
|
||||
overflow: auto;
|
||||
word-wrap: break-word;
|
||||
/*word-wrap: break-word;*/
|
||||
font-size: 9pt;
|
||||
line-height: 125%;
|
||||
}
|
||||
@ -700,14 +700,20 @@ img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
img.logo {
|
||||
a.logo {
|
||||
float:right;
|
||||
margin:10px;
|
||||
}
|
||||
|
||||
/* position:absolute;
|
||||
border:none;
|
||||
right:10px;
|
||||
top:10px */
|
||||
div.fragment {
|
||||
display:table; /* this allows the element to be larger than its parent */
|
||||
padding: 0pt;
|
||||
}
|
||||
pre.fragment {
|
||||
border: 1px solid #cccccc;
|
||||
|
||||
margin: 2px 0px 2px 0px ;
|
||||
padding: 3px 5px 3px 5px;
|
||||
}
|
||||
|
||||
/* Common style for all Eigen's tables */
|
||||
@ -872,7 +878,7 @@ table.tutorial_code td.note p.starttd {
|
||||
border: none;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/*
|
||||
div.fragment {
|
||||
font-family: monospace, fixed;
|
||||
font-size: 95%;
|
||||
@ -888,10 +894,7 @@ pre.fragment {
|
||||
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
div.desired_tutorial_width {
|
||||
width: 90%;
|
||||
}
|
||||
*/
|
||||
|
||||
div.eimainmenu {
|
||||
text-align: center;
|
||||
|
Loading…
x
Reference in New Issue
Block a user