diff options
author | 2010-03-03 09:55:46 -0500 | |
---|---|---|
committer | 2010-03-03 09:55:46 -0500 | |
commit | 7dbe806711dc29cf3d13122579f1da89f6398257 (patch) | |
tree | 5bede74075f5cddbfef02a8dfa7ae1dc3465931b /Eigen | |
parent | aa6570c3a39fd0d8094b8aa32a2710b95eec6894 (diff) | |
parent | 6a92168915ed91c77abf24d641e263e3876157f3 (diff) |
merge
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Array/Array.h | 3 | ||||
-rw-r--r-- | Eigen/src/Core/DenseStorageBase.h | 9 | ||||
-rw-r--r-- | Eigen/src/Core/Matrix.h | 3 | ||||
-rw-r--r-- | Eigen/src/Core/util/XprHelper.h | 9 |
4 files changed, 9 insertions, 15 deletions
diff --git a/Eigen/src/Array/Array.h b/Eigen/src/Array/Array.h index 5a398d849..91a091152 100644 --- a/Eigen/src/Array/Array.h +++ b/Eigen/src/Array/Array.h @@ -213,6 +213,9 @@ class Array void swap(ArrayBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other) { this->_swap(other.derived()); } + inline int innerStride() const { return 1; } + inline int outerStride() const { return this->innerSize(); } + #ifdef EIGEN_ARRAY_PLUGIN #include EIGEN_ARRAY_PLUGIN #endif diff --git a/Eigen/src/Core/DenseStorageBase.h b/Eigen/src/Core/DenseStorageBase.h index a0f3de542..c7f903c7a 100644 --- a/Eigen/src/Core/DenseStorageBase.h +++ b/Eigen/src/Core/DenseStorageBase.h @@ -139,13 +139,6 @@ class DenseStorageBase : public _Base<Derived> EIGEN_STRONG_INLINE Scalar *data() { return m_storage.data(); } - inline int innerStride() const { return 1; } - inline int outerStride() const - { - static const int MaxInnerSize = Base::IsRowMajor ? MaxColsAtCompileTime : MaxRowsAtCompileTime; - return (!IsVectorAtCompileTime) && MaxInnerSize!=Dynamic ? MaxInnerSize : this->innerSize(); - } - /** Resizes \c *this to a \a rows x \a cols matrix. * * This method is intended for dynamic-size matrices, although it is legal to call it on any @@ -608,7 +601,7 @@ struct ei_conservative_resize_like_impl<Derived,OtherDerived,true> const int new_rows = Derived::RowsAtCompileTime==1 ? 1 : other.rows(); const int new_cols = Derived::RowsAtCompileTime==1 ? other.cols() : 1; _this.derived().m_storage.conservativeResize(other.size(),new_rows,new_cols); - + if (num_new_elements > 0) _this.tail(num_new_elements) = other.tail(num_new_elements); } diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 3cd3f7814..e7422457c 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -318,6 +318,9 @@ class Matrix void swap(MatrixBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other) { this->_swap(other.derived()); } + inline int innerStride() const { return 1; } + inline int outerStride() const { return this->innerSize(); } + /////////// Geometry module /////////// template<typename OtherDerived> diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h index fc4c01468..a09475e20 100644 --- a/Eigen/src/Core/util/XprHelper.h +++ b/Eigen/src/Core/util/XprHelper.h @@ -90,19 +90,14 @@ class ei_compute_matrix_flags inner_max_size = MaxCols==1 ? MaxRows : MaxRows==1 ? MaxCols : row_major_bit ? MaxCols : MaxRows, - inner_size = Cols==1 ? Rows - : Rows==1 ? Cols - : row_major_bit ? Cols : Rows, is_big = inner_max_size == Dynamic, - is_matrix = Cols!=1 && Rows!=1, is_packet_size_multiple = MaxRows==Dynamic || MaxCols==Dynamic || ((MaxCols*MaxRows) % ei_packet_traits<Scalar>::size) == 0, aligned_bit = (((Options&DontAlign)==0) && (is_big || is_packet_size_multiple)) ? AlignedBit : 0, - packet_access_bit = ei_packet_traits<Scalar>::size > 1 && aligned_bit ? PacketAccessBit : 0, - linear_access_bit = (inner_max_size!=Dynamic && inner_size!=inner_max_size && is_matrix) ? 0 : LinearAccessBit + packet_access_bit = ei_packet_traits<Scalar>::size > 1 && aligned_bit ? PacketAccessBit : 0 }; public: - enum { ret = DirectAccessBit | NestByRefBit | packet_access_bit | row_major_bit | aligned_bit | linear_access_bit }; + enum { ret = LinearAccessBit | DirectAccessBit | NestByRefBit | packet_access_bit | row_major_bit | aligned_bit }; }; template<int _Rows, int _Cols> struct ei_size_at_compile_time |