mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-08 09:49:03 +08:00
fix two bugs dicovered by the previous commit.
This commit is contained in:
parent
bb1f4e44f1
commit
5dbfed1902
@ -94,7 +94,7 @@ template<typename T, int Size, int _Rows, int _Cols> class ei_matrix_storage
|
|||||||
// dynamic-size matrix with fixed-size storage
|
// dynamic-size matrix with fixed-size storage
|
||||||
template<typename T, int Size> class ei_matrix_storage<T, Size, Dynamic, Dynamic>
|
template<typename T, int Size> class ei_matrix_storage<T, Size, Dynamic, Dynamic>
|
||||||
{
|
{
|
||||||
T m_data[Size];
|
ei_aligned_array<T,Size,((Size*sizeof(T))%16)==0> m_data;
|
||||||
int m_rows;
|
int m_rows;
|
||||||
int m_cols;
|
int m_cols;
|
||||||
public:
|
public:
|
||||||
@ -107,14 +107,14 @@ template<typename T, int Size> class ei_matrix_storage<T, Size, Dynamic, Dynamic
|
|||||||
m_rows = rows;
|
m_rows = rows;
|
||||||
m_cols = cols;
|
m_cols = cols;
|
||||||
}
|
}
|
||||||
inline const T *data() const { return m_data; }
|
inline const T *data() const { return m_data.array; }
|
||||||
inline T *data() { return m_data; }
|
inline T *data() { return m_data.array; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// dynamic-size matrix with fixed-size storage and fixed width
|
// dynamic-size matrix with fixed-size storage and fixed width
|
||||||
template<typename T, int Size, int _Cols> class ei_matrix_storage<T, Size, Dynamic, _Cols>
|
template<typename T, int Size, int _Cols> class ei_matrix_storage<T, Size, Dynamic, _Cols>
|
||||||
{
|
{
|
||||||
T m_data[Size];
|
ei_aligned_array<T,Size,((Size*sizeof(T))%16)==0> m_data;
|
||||||
int m_rows;
|
int m_rows;
|
||||||
public:
|
public:
|
||||||
inline ei_matrix_storage(int, int rows, int) : m_rows(rows) {}
|
inline ei_matrix_storage(int, int rows, int) : m_rows(rows) {}
|
||||||
@ -125,14 +125,14 @@ template<typename T, int Size, int _Cols> class ei_matrix_storage<T, Size, Dynam
|
|||||||
{
|
{
|
||||||
m_rows = rows;
|
m_rows = rows;
|
||||||
}
|
}
|
||||||
inline const T *data() const { return m_data; }
|
inline const T *data() const { return m_data.array; }
|
||||||
inline T *data() { return m_data; }
|
inline T *data() { return m_data.array; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// dynamic-size matrix with fixed-size storage and fixed height
|
// dynamic-size matrix with fixed-size storage and fixed height
|
||||||
template<typename T, int Size, int _Rows> class ei_matrix_storage<T, Size, _Rows, Dynamic>
|
template<typename T, int Size, int _Rows> class ei_matrix_storage<T, Size, _Rows, Dynamic>
|
||||||
{
|
{
|
||||||
T m_data[Size];
|
ei_aligned_array<T,Size,((Size*sizeof(T))%16)==0> m_data;
|
||||||
int m_cols;
|
int m_cols;
|
||||||
public:
|
public:
|
||||||
inline ei_matrix_storage(int, int, int cols) : m_cols(cols) {}
|
inline ei_matrix_storage(int, int, int cols) : m_cols(cols) {}
|
||||||
@ -143,8 +143,8 @@ template<typename T, int Size, int _Rows> class ei_matrix_storage<T, Size, _Rows
|
|||||||
{
|
{
|
||||||
m_cols = cols;
|
m_cols = cols;
|
||||||
}
|
}
|
||||||
inline const T *data() const { return m_data; }
|
inline const T *data() const { return m_data.array; }
|
||||||
inline T *data() { return m_data; }
|
inline T *data() { return m_data.array; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// purely dynamic matrix.
|
// purely dynamic matrix.
|
||||||
|
@ -216,7 +216,8 @@ struct ei_traits<Product<Lhs, Rhs, EvalMode> >
|
|||||||
_RowMajor = (RhsFlags & RowMajorBit)
|
_RowMajor = (RhsFlags & RowMajorBit)
|
||||||
&& (EvalMode==(int)CacheFriendlyProduct ? (int)LhsFlags & RowMajorBit : (!_LhsPacketAccess)),
|
&& (EvalMode==(int)CacheFriendlyProduct ? (int)LhsFlags & RowMajorBit : (!_LhsPacketAccess)),
|
||||||
_LostBits = ~((_RowMajor ? 0 : RowMajorBit)
|
_LostBits = ~((_RowMajor ? 0 : RowMajorBit)
|
||||||
| ((RowsAtCompileTime == Dynamic || ColsAtCompileTime == Dynamic) ? 0 : LargeBit)),
|
| ((RowsAtCompileTime == Dynamic || ColsAtCompileTime == Dynamic) ? 0 : LargeBit)
|
||||||
|
| LinearAccessBit),
|
||||||
Flags = ((unsigned int)(LhsFlags | RhsFlags) & HereditaryBits & _LostBits)
|
Flags = ((unsigned int)(LhsFlags | RhsFlags) & HereditaryBits & _LostBits)
|
||||||
| EvalBeforeAssigningBit
|
| EvalBeforeAssigningBit
|
||||||
| EvalBeforeNestingBit
|
| EvalBeforeNestingBit
|
||||||
|
@ -161,7 +161,7 @@ class ei_corrected_matrix_flags
|
|||||||
= ei_packet_traits<Scalar>::size > 1
|
= ei_packet_traits<Scalar>::size > 1
|
||||||
&& (is_big || inner_size%ei_packet_traits<Scalar>::size==0)
|
&& (is_big || inner_size%ei_packet_traits<Scalar>::size==0)
|
||||||
? PacketAccessBit : 0,
|
? PacketAccessBit : 0,
|
||||||
|
|
||||||
_flags1 = (SuggestedFlags & ~(EvalBeforeNestingBit | EvalBeforeAssigningBit | PacketAccessBit | RowMajorBit))
|
_flags1 = (SuggestedFlags & ~(EvalBeforeNestingBit | EvalBeforeAssigningBit | PacketAccessBit | RowMajorBit))
|
||||||
| LinearAccessBit | DirectAccessBit
|
| LinearAccessBit | DirectAccessBit
|
||||||
};
|
};
|
||||||
@ -215,7 +215,7 @@ template<typename T, int n=1> struct ei_nested
|
|||||||
T,
|
T,
|
||||||
typename ei_meta_if<
|
typename ei_meta_if<
|
||||||
(int(ei_traits<T>::Flags) & EvalBeforeNestingBit)
|
(int(ei_traits<T>::Flags) & EvalBeforeNestingBit)
|
||||||
|| ((n+1) * int(NumTraits<typename ei_traits<T>::Scalar>::ReadCost) < (n-1) * int(T::CoeffReadCost)),
|
|| ((n+1) * int(NumTraits<typename ei_traits<T>::Scalar>::ReadCost) <= (n-1) * int(T::CoeffReadCost)),
|
||||||
typename ei_eval<T>::type,
|
typename ei_eval<T>::type,
|
||||||
const T&
|
const T&
|
||||||
>::ret
|
>::ret
|
||||||
|
Loading…
x
Reference in New Issue
Block a user