12 #ifndef EIGEN_MATRIXSTORAGE_H    13 #define EIGEN_MATRIXSTORAGE_H    15 #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN    16   #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN EIGEN_DENSE_STORAGE_CTOR_PLUGIN;    18   #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN    31 template <
typename T, 
int Size, 
int MatrixOrArrayOptions,
    32           int Alignment = (MatrixOrArrayOptions&
DontAlign) ? 0
    33                         : (((Size*
sizeof(T))%16)==0) ? 16
    41     EIGEN_STATIC_ASSERT(Size * 
sizeof(T) <= 128 * 128 * 8, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG);
    46     EIGEN_STATIC_ASSERT(Size * 
sizeof(T) <= 128 * 128 * 8, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG);
    50 #if defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT)    51   #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask)    52 #elif EIGEN_GNUC_AT_LEAST(4,7)     56   template<
typename PtrType>
    57   EIGEN_ALWAYS_INLINE PtrType eigen_unaligned_array_assert_workaround_gcc47(PtrType array) { 
return array; }
    58   #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \    59     eigen_assert((reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & sizemask) == 0 \    60               && "this assertion is explained here: " \    61               "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \    62               " **** READ THIS WEB PAGE !!! ****");    64   #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \    65     eigen_assert((reinterpret_cast<size_t>(array) & sizemask) == 0 \    66               && "this assertion is explained here: " \    67               "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \    68               " **** READ THIS WEB PAGE !!! ****");    71 template <
typename T, 
int Size, 
int MatrixOrArrayOptions>
    79     EIGEN_STATIC_ASSERT(Size * 
sizeof(T) <= 128 * 128 * 8, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG);
    84     EIGEN_STATIC_ASSERT(Size * 
sizeof(T) <= 128 * 128 * 8, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG);
    88 template <
typename T, 
int MatrixOrArrayOptions, 
int Alignment>
   110 template<
typename T, 
int Size, 
int _Rows, 
int _Cols, 
int _Options> 
class DenseStorage;
   113 template<
typename T, 
int Size, 
int _Rows, 
int _Cols, 
int _Options> 
class DenseStorage
   119       : m_data(
internal::constructor_without_unaligned_array_assert()) {}
   121     inline void swap(DenseStorage& other) { std::swap(m_data,other.
m_data); }
   137     inline void swap(DenseStorage& ) {}
   142     inline const T *
data()
 const { 
return 0; }
   165       : m_data(
internal::constructor_without_unaligned_array_assert()), m_rows(0), m_cols(0) {}
   167     inline void swap(DenseStorage& other)
   168     { std::swap(m_data,other.
m_data); std::swap(m_rows,other.m_rows); std::swap(m_cols,other.m_cols); }
   185       : m_data(
internal::constructor_without_unaligned_array_assert()), m_rows(0) {}
   187     inline void swap(DenseStorage& other) { std::swap(m_data,other.
m_data); std::swap(m_rows,other.m_rows); }
   204       : m_data(
internal::constructor_without_unaligned_array_assert()), m_cols(0) {}
   206     inline void swap(DenseStorage& other) { std::swap(m_data,other.
m_data); std::swap(m_cols,other.m_cols); }
   224        : m_data(0), m_rows(0), m_cols(0) {}
   228     inline ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, m_rows*m_cols); }
   229     inline void swap(DenseStorage& other)
   230     { std::swap(m_data,other.
m_data); std::swap(m_rows,other.m_rows); std::swap(m_cols,other.m_cols); }
   235       m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size, m_rows*m_cols);
   241       if(size != m_rows*m_cols)
   243         internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, m_rows*m_cols);
   245           m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
   253     inline const T *
data()
 const { 
return m_data; }
   254     inline T *
data() { 
return m_data; }
   267     inline ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Rows*m_cols); }
   268     inline void swap(DenseStorage& other) { std::swap(m_data,other.
m_data); std::swap(m_cols,other.m_cols); }
   273       m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size, _Rows*m_cols);
   278       if(size != _Rows*m_cols)
   280         internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Rows*m_cols);
   282           m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
   289     inline const T *
data()
 const { 
return m_data; }
   290     inline T *
data() { 
return m_data; }
   303     inline ~DenseStorage() { internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Cols*m_rows); }
   304     inline void swap(DenseStorage& other) { std::swap(m_data,other.
m_data); std::swap(m_rows,other.m_rows); }
   309       m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size, m_rows*_Cols);
   314       if(size != m_rows*_Cols)
   316         internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, _Cols*m_rows);
   318           m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
   325     inline const T *
data()
 const { 
return m_data; }
   326     inline T *
data() { 
return m_data; }
   331 #endif // EIGEN_MATRIX_H 
void swap(DenseStorage &other)
DenseStorage(DenseIndex size, DenseIndex, DenseIndex nbCols)
DenseIndex cols(void) const 
static DenseIndex rows(void)
#define EIGEN_STRONG_INLINE
DenseStorage(DenseIndex size, DenseIndex nbRows, DenseIndex)
DenseStorage(internal::constructor_without_unaligned_array_assert)
DenseIndex cols(void) const 
DenseIndex cols(void) const 
DenseStorage(internal::constructor_without_unaligned_array_assert)
internal::plain_array< T, Size, _Options > m_data
void swap(DenseStorage &)
DenseStorage(DenseIndex size, DenseIndex nbRows, DenseIndex nbCols)
void resize(DenseIndex, DenseIndex, DenseIndex nbCols)
DenseStorage(internal::constructor_without_unaligned_array_assert)
DenseStorage(DenseIndex, DenseIndex, DenseIndex)
DenseStorage(internal::constructor_without_unaligned_array_assert)
EIGEN_STRONG_INLINE void resize(DenseIndex size, DenseIndex, DenseIndex nbCols)
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
void conservativeResize(DenseIndex size, DenseIndex, DenseIndex nbCols)
void swap(DenseStorage &other)
DenseStorage(DenseIndex, DenseIndex, DenseIndex nbCols)
T * conditional_aligned_new_auto(size_t size)
void swap(DenseStorage &other)
DenseIndex rows(void) const 
DenseIndex rows(void) const 
internal::plain_array< T, Size, _Options > m_data
void conservativeResize(DenseIndex, DenseIndex, DenseIndex)
void conservativeResize(DenseIndex, DenseIndex nbRows, DenseIndex nbCols)
DenseStorage(DenseIndex, DenseIndex nbRows, DenseIndex nbCols)
static DenseIndex cols(void)
static DenseIndex cols(void)
DenseStorage(internal::constructor_without_unaligned_array_assert)
void resize(DenseIndex, DenseIndex nbRows, DenseIndex)
void swap(DenseStorage &other)
void resize(DenseIndex size, DenseIndex nbRows, DenseIndex nbCols)
void resize(DenseIndex, DenseIndex, DenseIndex)
#define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
plain_array(constructor_without_unaligned_array_assert)
#define EIGEN_USER_ALIGN16
void conservativeResize(DenseIndex, DenseIndex nbRows, DenseIndex)
static DenseIndex rows(void)
void conservativeResize(DenseIndex, DenseIndex, DenseIndex)
#define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask)
EIGEN_STRONG_INLINE void resize(DenseIndex size, DenseIndex nbRows, DenseIndex)
void resize(DenseIndex, DenseIndex nbRows, DenseIndex nbCols)
DenseIndex rows(void) const 
static DenseIndex cols(void)
static DenseIndex rows(void)
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
plain_array(constructor_without_unaligned_array_assert)
void resize(DenseIndex, DenseIndex, DenseIndex)
void conservativeResize(DenseIndex size, DenseIndex nbRows, DenseIndex nbCols)
void swap(DenseStorage &other)
DenseStorage(internal::constructor_without_unaligned_array_assert)
DenseStorage(internal::constructor_without_unaligned_array_assert)
#define EIGEN_ALWAYS_INLINE
void conservativeResize(DenseIndex, DenseIndex, DenseIndex nbCols)
internal::plain_array< T, Size, _Options > m_data
DenseIndex rows(void) const 
plain_array(constructor_without_unaligned_array_assert)
DenseStorage(DenseIndex, DenseIndex, DenseIndex)
DenseStorage(internal::constructor_without_unaligned_array_assert)
internal::plain_array< T, Size, _Options > m_data
void swap(DenseStorage &other)
void conservativeResize(DenseIndex size, DenseIndex nbRows, DenseIndex)
DenseStorage(DenseIndex, DenseIndex nbRows, DenseIndex)
DenseIndex cols(void) const 
void swap(DenseStorage &other)