From 5dbfed190264dd39afa9d97f2bb9a1fc18e85e94 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 16 Jun 2008 16:39:58 +0000 Subject: [PATCH] fix two bugs dicovered by the previous commit. --- Eigen/src/Core/MatrixStorage.h | 18 +++++++++--------- Eigen/src/Core/Product.h | 3 ++- Eigen/src/Core/util/Meta.h | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Eigen/src/Core/MatrixStorage.h b/Eigen/src/Core/MatrixStorage.h index 94336f1a8..72b9965b6 100644 --- a/Eigen/src/Core/MatrixStorage.h +++ b/Eigen/src/Core/MatrixStorage.h @@ -94,7 +94,7 @@ template class ei_matrix_storage // dynamic-size matrix with fixed-size storage template class ei_matrix_storage { - T m_data[Size]; + ei_aligned_array m_data; int m_rows; int m_cols; public: @@ -107,14 +107,14 @@ template class ei_matrix_storage class ei_matrix_storage { - T m_data[Size]; + ei_aligned_array m_data; int m_rows; public: inline ei_matrix_storage(int, int rows, int) : m_rows(rows) {} @@ -125,14 +125,14 @@ template class ei_matrix_storage class ei_matrix_storage { - T m_data[Size]; + ei_aligned_array m_data; int m_cols; public: inline ei_matrix_storage(int, int, int cols) : m_cols(cols) {} @@ -143,8 +143,8 @@ template class ei_matrix_storage > _RowMajor = (RhsFlags & RowMajorBit) && (EvalMode==(int)CacheFriendlyProduct ? (int)LhsFlags & RowMajorBit : (!_LhsPacketAccess)), _LostBits = ~((_RowMajor ? 0 : RowMajorBit) - | ((RowsAtCompileTime == Dynamic || ColsAtCompileTime == Dynamic) ? 0 : LargeBit)), + | ((RowsAtCompileTime == Dynamic || ColsAtCompileTime == Dynamic) ? 0 : LargeBit) + | LinearAccessBit), Flags = ((unsigned int)(LhsFlags | RhsFlags) & HereditaryBits & _LostBits) | EvalBeforeAssigningBit | EvalBeforeNestingBit diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index de732f373..33a09f87c 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -161,7 +161,7 @@ class ei_corrected_matrix_flags = ei_packet_traits::size > 1 && (is_big || inner_size%ei_packet_traits::size==0) ? PacketAccessBit : 0, - + _flags1 = (SuggestedFlags & ~(EvalBeforeNestingBit | EvalBeforeAssigningBit | PacketAccessBit | RowMajorBit)) | LinearAccessBit | DirectAccessBit }; @@ -215,7 +215,7 @@ template struct ei_nested T, typename ei_meta_if< (int(ei_traits::Flags) & EvalBeforeNestingBit) - || ((n+1) * int(NumTraits::Scalar>::ReadCost) < (n-1) * int(T::CoeffReadCost)), + || ((n+1) * int(NumTraits::Scalar>::ReadCost) <= (n-1) * int(T::CoeffReadCost)), typename ei_eval::type, const T& >::ret