mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
more renaming to make this file matrix-or-array-agnostic
This commit is contained in:
parent
e8768251db
commit
8d2a10c5c1
@ -38,18 +38,18 @@ namespace internal {
|
|||||||
struct constructor_without_unaligned_array_assert {};
|
struct constructor_without_unaligned_array_assert {};
|
||||||
|
|
||||||
/** \internal
|
/** \internal
|
||||||
* Static array. If the MatrixOptions require auto-alignment, the array will be automatically aligned:
|
* Static array. If the MatrixOrArrayOptions require auto-alignment, the array will be automatically aligned:
|
||||||
* to 16 bytes boundary if the total size is a multiple of 16 bytes.
|
* to 16 bytes boundary if the total size is a multiple of 16 bytes.
|
||||||
*/
|
*/
|
||||||
template <typename T, int Size, int MatrixOptions,
|
template <typename T, int Size, int MatrixOrArrayOptions,
|
||||||
int Alignment = (MatrixOptions&DontAlign) ? 0
|
int Alignment = (MatrixOrArrayOptions&DontAlign) ? 0
|
||||||
: (((Size*sizeof(T))%16)==0) ? 16
|
: (((Size*sizeof(T))%16)==0) ? 16
|
||||||
: 0 >
|
: 0 >
|
||||||
struct matrix_array
|
struct plain_array
|
||||||
{
|
{
|
||||||
T array[Size];
|
T array[Size];
|
||||||
matrix_array() {}
|
plain_array() {}
|
||||||
matrix_array(constructor_without_unaligned_array_assert) {}
|
plain_array(constructor_without_unaligned_array_assert) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
|
#ifdef EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
|
||||||
@ -62,20 +62,20 @@ struct matrix_array
|
|||||||
" **** READ THIS WEB PAGE !!! ****");
|
" **** READ THIS WEB PAGE !!! ****");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <typename T, int Size, int MatrixOptions>
|
template <typename T, int Size, int MatrixOrArrayOptions>
|
||||||
struct matrix_array<T, Size, MatrixOptions, 16>
|
struct plain_array<T, Size, MatrixOrArrayOptions, 16>
|
||||||
{
|
{
|
||||||
EIGEN_ALIGN16 T array[Size];
|
EIGEN_ALIGN16 T array[Size];
|
||||||
matrix_array() { EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(0xf) }
|
plain_array() { EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(0xf) }
|
||||||
matrix_array(constructor_without_unaligned_array_assert) {}
|
plain_array(constructor_without_unaligned_array_assert) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T, int MatrixOptions, int Alignment>
|
template <typename T, int MatrixOrArrayOptions, int Alignment>
|
||||||
struct matrix_array<T, 0, MatrixOptions, Alignment>
|
struct plain_array<T, 0, MatrixOrArrayOptions, Alignment>
|
||||||
{
|
{
|
||||||
EIGEN_ALIGN16 T array[1];
|
EIGEN_ALIGN16 T array[1];
|
||||||
matrix_array() {}
|
plain_array() {}
|
||||||
matrix_array(constructor_without_unaligned_array_assert) {}
|
plain_array(constructor_without_unaligned_array_assert) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace internal
|
} // end namespace internal
|
||||||
@ -97,7 +97,7 @@ template<typename T, int Size, int _Rows, int _Cols, int _Options> class DenseSt
|
|||||||
// purely fixed-size matrix
|
// purely fixed-size matrix
|
||||||
template<typename T, int Size, int _Rows, int _Cols, int _Options> class DenseStorage
|
template<typename T, int Size, int _Rows, int _Cols, int _Options> class DenseStorage
|
||||||
{
|
{
|
||||||
internal::matrix_array<T,Size,_Options> m_data;
|
internal::plain_array<T,Size,_Options> m_data;
|
||||||
public:
|
public:
|
||||||
inline explicit DenseStorage() {}
|
inline explicit DenseStorage() {}
|
||||||
inline DenseStorage(internal::constructor_without_unaligned_array_assert)
|
inline DenseStorage(internal::constructor_without_unaligned_array_assert)
|
||||||
@ -131,7 +131,7 @@ template<typename T, int _Rows, int _Cols, int _Options> class DenseStorage<T, 0
|
|||||||
// dynamic-size matrix with fixed-size storage
|
// dynamic-size matrix with fixed-size storage
|
||||||
template<typename T, int Size, int _Options> class DenseStorage<T, Size, Dynamic, Dynamic, _Options>
|
template<typename T, int Size, int _Options> class DenseStorage<T, Size, Dynamic, Dynamic, _Options>
|
||||||
{
|
{
|
||||||
internal::matrix_array<T,Size,_Options> m_data;
|
internal::plain_array<T,Size,_Options> m_data;
|
||||||
DenseIndex m_rows;
|
DenseIndex m_rows;
|
||||||
DenseIndex m_cols;
|
DenseIndex m_cols;
|
||||||
public:
|
public:
|
||||||
@ -152,7 +152,7 @@ template<typename T, int Size, int _Options> class DenseStorage<T, Size, Dynamic
|
|||||||
// 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, int _Options> class DenseStorage<T, Size, Dynamic, _Cols, _Options>
|
template<typename T, int Size, int _Cols, int _Options> class DenseStorage<T, Size, Dynamic, _Cols, _Options>
|
||||||
{
|
{
|
||||||
internal::matrix_array<T,Size,_Options> m_data;
|
internal::plain_array<T,Size,_Options> m_data;
|
||||||
DenseIndex m_rows;
|
DenseIndex m_rows;
|
||||||
public:
|
public:
|
||||||
inline explicit DenseStorage() : m_rows(0) {}
|
inline explicit DenseStorage() : m_rows(0) {}
|
||||||
@ -171,7 +171,7 @@ template<typename T, int Size, int _Cols, int _Options> class DenseStorage<T, Si
|
|||||||
// 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, int _Options> class DenseStorage<T, Size, _Rows, Dynamic, _Options>
|
template<typename T, int Size, int _Rows, int _Options> class DenseStorage<T, Size, _Rows, Dynamic, _Options>
|
||||||
{
|
{
|
||||||
internal::matrix_array<T,Size,_Options> m_data;
|
internal::plain_array<T,Size,_Options> m_data;
|
||||||
DenseIndex m_cols;
|
DenseIndex m_cols;
|
||||||
public:
|
public:
|
||||||
inline explicit DenseStorage() : m_cols(0) {}
|
inline explicit DenseStorage() : m_cols(0) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user