allows blocks of code to be larger than the page body (like tables)

This commit is contained in:
Gael Guennebaud 2010-10-19 16:55:49 +02:00
parent e19c6b89f5
commit e5073746f3
2 changed files with 14 additions and 23 deletions

View File

@ -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: \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 \code
typedef Matrix<Scalar, RowsAtCompileTime, ColsAtCompileTime, Options> MyMatrixType; typedef Matrix<Scalar, RowsAtCompileTime, ColsAtCompileTime, Options> MyMatrixType;
typedef Array<Scalar, RowsAtCompileTime, ColsAtCompileTime, Options> MyArrayType; typedef Array<Scalar, RowsAtCompileTime, ColsAtCompileTime, Options> MyArrayType;
\endcode \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 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 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) \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: 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 \code
Matrix<double, 6, Dynamic> // Dynamic number of columns (heap allocation) Matrix<double, 6, Dynamic> // Dynamic number of columns (heap allocation)
Matrix<double, Dynamic, 2> // Dynamic number of rows (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, Dynamic, Dynamic, RowMajor> // Fully dynamic, row major (heap allocation)
Matrix<double, 13, 3> // Fully fixed (static allocation) Matrix<double, 13, 3> // Fully fixed (static allocation)
\endcode \endcode
</div>
In most cases, you can simply use one of the convenience typedefs for \ref matrixtypedefs "matrices" and \ref arraytypedefs "arrays". Some examples: 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"> <table class="example">
@ -80,7 +76,6 @@ Array<float,4,1> <=> Array4f
</table> </table>
Conversion between the matrix and array worlds: Conversion between the matrix and array worlds:
<div class="desired_tutorial_width">
\code \code
Array44f a1, a1; Array44f a1, a1;
Matrix4f m1, m2; 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 ArrayWrapper<Matrix4f> m1a(m1); // m1a is an alias for m1.array(), they share the same coefficients
MatrixWrapper<Array44f> a1m(a1); MatrixWrapper<Array44f> a1m(a1);
\endcode \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: 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 \li <a name="matrixonly"><a/>\matrixworld linear algebra matrix and vector only
@ -459,32 +453,26 @@ mat = 2 7 8
</table> </table>
Special versions of \link DenseBase::minCoeff(Index*,Index*) minCoeff \endlink and \link DenseBase::maxCoeff(Index*,Index*) 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 \code
int i, j; int i, j;
s = vector.minCoeff(&i); // s == vector[i] s = vector.minCoeff(&i); // s == vector[i]
s = matrix.maxCoeff(&i, &j); // s == matrix(i,j) s = matrix.maxCoeff(&i, &j); // s == matrix(i,j)
\endcode \endcode
</div>
Typical use cases of all() and any(): Typical use cases of all() and any():
<div class="desired_tutorial_width">
\code \code
if((array1 > 0).all()) ... // if all coefficients of array1 are greater than 0 ... 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) ... if((array1 < array2).any()) ... // if there exist a pair i,j such that array1(i,j) < array2(i,j) ...
\endcode \endcode
</div>
<a href="#" class="top">top</a>\section QuickRef_Blocks Sub-matrices <a href="#" class="top">top</a>\section QuickRef_Blocks Sub-matrices
Read-write access to a \link DenseBase::col(Index) column \endlink Read-write access to a \link DenseBase::col(Index) column \endlink
or a \link DenseBase::row(Index) row \endlink of a matrix (or array): or a \link DenseBase::row(Index) row \endlink of a matrix (or array):
<div class="desired_tutorial_width">
\code \code
mat1.row(i) = mat2.col(j); mat1.row(i) = mat2.col(j);
mat1.col(j1).swap(mat1.col(j2)); mat1.col(j1).swap(mat1.col(j2));
\endcode \endcode
</div>
Read-write access to sub-vectors: Read-write access to sub-vectors:
<table class="manual"> <table class="manual">

View File

@ -142,7 +142,7 @@ pre.fragment {
padding: 4px 6px; padding: 4px 6px;
margin: 4px 8px 4px 2px; margin: 4px 8px 4px 2px;
overflow: auto; overflow: auto;
word-wrap: break-word; /*word-wrap: break-word;*/
font-size: 9pt; font-size: 9pt;
line-height: 125%; line-height: 125%;
} }
@ -700,14 +700,20 @@ img {
border: 0; border: 0;
} }
img.logo { a.logo {
float:right; float:right;
margin:10px; margin:10px;
}
/* position:absolute; div.fragment {
border:none; display:table; /* this allows the element to be larger than its parent */
right:10px; padding: 0pt;
top:10px */ }
pre.fragment {
border: 1px solid #cccccc;
margin: 2px 0px 2px 0px ;
padding: 3px 5px 3px 5px;
} }
/* Common style for all Eigen's tables */ /* Common style for all Eigen's tables */
@ -872,7 +878,7 @@ table.tutorial_code td.note p.starttd {
border: none; border: none;
padding: 0px; padding: 0px;
} }
/*
div.fragment { div.fragment {
font-family: monospace, fixed; font-family: monospace, fixed;
font-size: 95%; font-size: 95%;
@ -888,10 +894,7 @@ pre.fragment {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
*/
div.desired_tutorial_width {
width: 90%;
}
div.eimainmenu { div.eimainmenu {
text-align: center; text-align: center;