aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/QuickReference.dox
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-06-30 18:27:27 +0200
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-06-30 18:27:27 +0200
commit7b74d376d39c88f086a314840c95950694cb5708 (patch)
treea53c5df8fbc1a15f5fa3164aca96643f425d881b /doc/QuickReference.dox
parente1348b9cc9b31e01da1b1e1e4313d925effc7b5d (diff)
More style fixes.
Diffstat (limited to 'doc/QuickReference.dox')
-rw-r--r--doc/QuickReference.dox14
1 files changed, 12 insertions, 2 deletions
diff --git a/doc/QuickReference.dox b/doc/QuickReference.dox
index 43ef61a95..1ded32a5f 100644
--- a/doc/QuickReference.dox
+++ b/doc/QuickReference.dox
@@ -37,23 +37,26 @@ namespace Eigen {
\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="tutorial_code">
@@ -73,6 +76,7 @@ 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;
@@ -83,6 +87,7 @@ 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
@@ -444,27 +449,32 @@ mat = 2 7 8
</table>
Special versions of \link DenseBase::minCoeff(int*,int*) minCoeff \endlink and \link DenseBase::maxCoeff(int*,int*) 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(int) column \endlink
or a \link DenseBase::row(int) 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="tutorial_code">