diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-10-20 09:34:13 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-10-20 09:34:13 -0400 |
commit | 8c17fab8f5cfaea1ed613883caaeed5f58a7df85 (patch) | |
tree | de5537327f4e17f1b9e7028da3d4df2f27ce132e /doc | |
parent | 9cf748757e246db1c555e9a207e6427498016392 (diff) |
renaming: ei_matrix_storage -> DenseStorage
DenseStorageBase -> PlainObjectBase
Diffstat (limited to 'doc')
-rw-r--r-- | doc/C01_TutorialMatrixClass.dox | 4 | ||||
-rw-r--r-- | doc/D11_UnalignedArrayAssert.dox | 2 | ||||
-rw-r--r-- | doc/I03_InsideEigenExample.dox | 18 | ||||
-rw-r--r-- | doc/I12_ClassHierarchy.dox | 14 |
4 files changed, 19 insertions, 19 deletions
diff --git a/doc/C01_TutorialMatrixClass.dox b/doc/C01_TutorialMatrixClass.dox index 15a745a84..4860616e5 100644 --- a/doc/C01_TutorialMatrixClass.dox +++ b/doc/C01_TutorialMatrixClass.dox @@ -168,7 +168,7 @@ The right-hand side can also contain matrix expressions as discussed in \ref Tut \section TutorialMatrixSizesResizing Resizing -The current size of a matrix can be retrieved by \link EigenBase::rows() rows()\endlink, \link EigenBase::cols() cols() \endlink and \link EigenBase::size() size()\endlink. These methods return the number of rows, the number of columns and the number of coefficients, respectively. Resizing a dynamic-size matrix is done by the \link DenseStorageBase::resize(Index,Index) resize() \endlink method. +The current size of a matrix can be retrieved by \link EigenBase::rows() rows()\endlink, \link EigenBase::cols() cols() \endlink and \link EigenBase::size() size()\endlink. These methods return the number of rows, the number of columns and the number of coefficients, respectively. Resizing a dynamic-size matrix is done by the \link PlainObjectBase::resize(Index,Index) resize() \endlink method. <table class="example"> <tr><th>Example:</th><th>Output:</th></tr> @@ -178,7 +178,7 @@ The current size of a matrix can be retrieved by \link EigenBase::rows() rows()\ </tr></table> The resize() method is a no-operation if the actual matrix size doesn't change; otherwise it is destructive: the values of the coefficients may change. -If you want a conservative variant of resize() which does not change the coefficients, use \link DenseStorageBase::conservativeResize() conservativeResize()\endlink, see \ref TopicResizing "this page" for more details. +If you want a conservative variant of resize() which does not change the coefficients, use \link PlainObjectBase::conservativeResize() conservativeResize()\endlink, see \ref TopicResizing "this page" for more details. All these methods are still available on fixed-size matrices, for the sake of API uniformity. Of course, you can't actually resize a fixed-size matrix. Trying to change a fixed size to an actually different value will trigger an assertion failure; diff --git a/doc/D11_UnalignedArrayAssert.dox b/doc/D11_UnalignedArrayAssert.dox index 1a0e5140c..5b9ac5a2a 100644 --- a/doc/D11_UnalignedArrayAssert.dox +++ b/doc/D11_UnalignedArrayAssert.dox @@ -4,7 +4,7 @@ namespace Eigen { Hello! You are seeing this webpage because your program terminated on an assertion failure like this one: <pre> -my_program: path/to/eigen/Eigen/src/Core/MatrixStorage.h:44: +my_program: path/to/eigen/Eigen/src/Core/DenseStorage.h:44: Eigen::ei_matrix_array<T, Size, MatrixOptions, Align>::ei_matrix_array() [with T = double, int Size = 2, int MatrixOptions = 2, bool Align = true]: Assertion `(reinterpret_cast<size_t>(array) & 0xf) == 0 && "this assertion diff --git a/doc/I03_InsideEigenExample.dox b/doc/I03_InsideEigenExample.dox index e0f8d52a9..9ee253133 100644 --- a/doc/I03_InsideEigenExample.dox +++ b/doc/I03_InsideEigenExample.dox @@ -87,30 +87,30 @@ When we do \code Eigen::VectorXf u(size); \endcode -the constructor that is called is Matrix::Matrix(int), in src/Core/Matrix.h. Besides some assertions, all it does is to construct the \a m_storage member, which is of type ei_matrix_storage\<float, Dynamic, Dynamic, 1\>. +the constructor that is called is Matrix::Matrix(int), in src/Core/Matrix.h. Besides some assertions, all it does is to construct the \a m_storage member, which is of type DenseStorage\<float, Dynamic, Dynamic, 1\>. -You may wonder, isn't it overengineering to have the storage in a separate class? The reason is that the Matrix class template covers all kinds of matrices and vector: both fixed-size and dynamic-size. The storage method is not the same in these two cases. For fixed-size, the matrix coefficients are stored as a plain member array. For dynamic-size, the coefficients will be stored as a pointer to a dynamically-allocated array. Because of this, we need to abstract storage away from the Matrix class. That's ei_matrix_storage. +You may wonder, isn't it overengineering to have the storage in a separate class? The reason is that the Matrix class template covers all kinds of matrices and vector: both fixed-size and dynamic-size. The storage method is not the same in these two cases. For fixed-size, the matrix coefficients are stored as a plain member array. For dynamic-size, the coefficients will be stored as a pointer to a dynamically-allocated array. Because of this, we need to abstract storage away from the Matrix class. That's DenseStorage. -Let's look at this constructor, in src/Core/MatrixStorage.h. You can see that there are many partial template specializations of ei_matrix_storages here, treating separately the cases where dimensions are Dynamic or fixed at compile-time. The partial specialization that we are looking at is: +Let's look at this constructor, in src/Core/DenseStorage.h. You can see that there are many partial template specializations of DenseStorages here, treating separately the cases where dimensions are Dynamic or fixed at compile-time. The partial specialization that we are looking at is: \code -template<typename T, int _Cols> class ei_matrix_storage<T, Dynamic, Dynamic, _Cols> +template<typename T, int _Cols> class DenseStorage<T, Dynamic, Dynamic, _Cols> \endcode -Here, the constructor called is ei_matrix_storage::ei_matrix_storage(int size, int rows, int columns) +Here, the constructor called is DenseStorage::DenseStorage(int size, int rows, int columns) with size=50, rows=50, columns=1. Here is this constructor: \code -inline ei_matrix_storage(int size, int rows, int) : m_data(ei_aligned_new<T>(size)), m_rows(rows) {} +inline DenseStorage(int size, int rows, int) : m_data(ei_aligned_new<T>(size)), m_rows(rows) {} \endcode Here, the \a m_data member is the actual array of coefficients of the matrix. As you see, it is dynamically allocated. Rather than calling new[] or malloc(), as you can see, we have our own ei_aligned_new defined in src/Core/util/Memory.h. What it does is that if vectorization is enabled, then it uses a platform-specific call to allocate a 128-bit-aligned array, as that is very useful for vectorization with both SSE2 and AltiVec. If vectorization is disabled, it amounts to the standard new[]. -As you can see, the constructor also sets the \a m_rows member to \a size. Notice that there is no \a m_columns member: indeed, in this partial specialization of ei_matrix_storage, we know the number of columns at compile-time, since the _Cols template parameter is different from Dynamic. Namely, in our case, _Cols is 1, which is to say that our vector is just a matrix with 1 column. Hence, there is no need to store the number of columns as a runtime variable. +As you can see, the constructor also sets the \a m_rows member to \a size. Notice that there is no \a m_columns member: indeed, in this partial specialization of DenseStorage, we know the number of columns at compile-time, since the _Cols template parameter is different from Dynamic. Namely, in our case, _Cols is 1, which is to say that our vector is just a matrix with 1 column. Hence, there is no need to store the number of columns as a runtime variable. -When you call VectorXf::data() to get the pointer to the array of coefficients, it returns ei_matrix_storage::data() which returns the \a m_data member. +When you call VectorXf::data() to get the pointer to the array of coefficients, it returns DenseStorage::data() which returns the \a m_data member. -When you call VectorXf::size() to get the size of the vector, this is actually a method in the base class MatrixBase. It determines that the vector is a column-vector, since ColsAtCompileTime==1 (this comes from the template parameters in the typedef VectorXf). It deduces that the size is the number of rows, so it returns VectorXf::rows(), which returns ei_matrix_storage::rows(), which returns the \a m_rows member, which was set to \a size by the constructor. +When you call VectorXf::size() to get the size of the vector, this is actually a method in the base class MatrixBase. It determines that the vector is a column-vector, since ColsAtCompileTime==1 (this comes from the template parameters in the typedef VectorXf). It deduces that the size is the number of rows, so it returns VectorXf::rows(), which returns DenseStorage::rows(), which returns the \a m_rows member, which was set to \a size by the constructor. \section ConstructionOfSumXpr Construction of the sum expression diff --git a/doc/I12_ClassHierarchy.dox b/doc/I12_ClassHierarchy.dox index 2351957f1..700d01802 100644 --- a/doc/I12_ClassHierarchy.dox +++ b/doc/I12_ClassHierarchy.dox @@ -52,13 +52,13 @@ objects. These classes serve as base classes for the five core classes mentioned above. They are more internal and so less interesting for users of the Eigen library. - - DenseStorageBase means dense (matrix or array) plain object, i.e. something that stores its own dense - array of coefficients. This is where, for instance, the \link DenseStorageBase::resize() resize() \endlink - methods go. \c %DenseStorageBase is inherited by \c %Matrix and by \c %Array. But above, we said that + - PlainObjectBase means dense (matrix or array) plain object, i.e. something that stores its own dense + array of coefficients. This is where, for instance, the \link PlainObjectBase::resize() resize() \endlink + methods go. \c %PlainObjectBase is inherited by \c %Matrix and by \c %Array. But above, we said that \c %Matrix inherits \c %MatrixBase and \c %Array inherits \c %ArrayBase. So does that mean multiple - inheritance? No, because \c %DenseStorageBase \e itself inherits \c %MatrixBase or \c %ArrayBase depending + inheritance? No, because \c %PlainObjectBase \e itself inherits \c %MatrixBase or \c %ArrayBase depending on whether we are in the matrix or array case. When we said above that \c %Matrix inherited - \c %MatrixBase, we omitted to say it does so indirectly via \c %DenseStorageBase. Same for \c %Array. + \c %MatrixBase, we omitted to say it does so indirectly via \c %PlainObjectBase. Same for \c %Array. - DenseCoeffsBase means something that has dense coefficient accessors. It is a base class for \c %DenseBase. The reason for \c %DenseCoeffsBase to exist is that the set of available coefficient accessors is very different depending on whether a dense expression has direct memory access or not (the @@ -82,7 +82,7 @@ EigenBase<%Matrix> <-- DenseCoeffsBase<%Matrix> (direct access case) <-- DenseBase<%Matrix> <-- MatrixBase<%Matrix> - <-- DenseStorageBase<%Matrix> (matrix case) + <-- PlainObjectBase<%Matrix> (matrix case) <-- Matrix </pre> @@ -93,7 +93,7 @@ EigenBase<%Array> <-- DenseCoeffsBase<%Array> (direct access case) <-- DenseBase<%Array> <-- ArrayBase<%Array> - <-- DenseStorageBase<%Array> (array case) + <-- PlainObjectBase<%Array> (array case) <-- Array </pre> |