diff options
author | 2009-02-09 09:54:48 +0000 | |
---|---|---|
committer | 2009-02-09 09:54:48 +0000 | |
commit | 666ade0c9384aee1d35fe48a837d6de4d175f7c9 (patch) | |
tree | 7bec9bdb2f2eb5db4f98d93fab74ef3c428d73a5 /Eigen/src | |
parent | 5b4c3b21f30231d5a9526d79396752057cb5cfd2 (diff) |
add "remap" snippet using placement new
Diffstat (limited to 'Eigen/src')
-rw-r--r-- | Eigen/src/Core/Map.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h index 5fe13005f..4c2c455ce 100644 --- a/Eigen/src/Core/Map.h +++ b/Eigen/src/Core/Map.h @@ -39,6 +39,12 @@ * This class represents a matrix or vector expression mapping an existing array of data. * It can be used to let Eigen interface without any overhead with non-Eigen data structures, * such as plain C arrays or structures from other libraries. + * + * \b Tips: to change the array of data mapped by a Map object, you can use the C++ + * placement new syntax: + * + * Example: \include Map_placement_new.cpp + * Output: \verbinclude Map_placement_new.out * * This class is the return type of Matrix::Map() but can also be used directly. * @@ -79,7 +85,7 @@ template<typename MatrixType, int PacketAccess> class Map inline Map(const Scalar* data, int size) : Base(data, size) {} inline Map(const Scalar* data, int rows, int cols) : Base(data, rows, cols) {} - + inline void resize(int rows, int cols) { EIGEN_ONLY_USED_FOR_DEBUG(rows); |