mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
* move memory related stuff to util/Memory.h
* clean ugly doxygen inheritence of expressions * keep improving the documentation... slowly !
This commit is contained in:
@@ -39,44 +39,6 @@
|
||||
*/
|
||||
template<typename T, int Size, int _Rows, int _Cols> class ei_matrix_storage;
|
||||
|
||||
template <typename T, int Size, bool Align> struct ei_aligned_array
|
||||
{
|
||||
EIGEN_ALIGN_128 T array[Size];
|
||||
};
|
||||
|
||||
template <typename T, int Size> struct ei_aligned_array<T,Size,false>
|
||||
{
|
||||
T array[Size];
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
inline T* ei_aligned_malloc(size_t size)
|
||||
{
|
||||
#ifdef EIGEN_VECTORIZE
|
||||
if (ei_packet_traits<T>::size>1)
|
||||
{
|
||||
void* ptr;
|
||||
if (posix_memalign(&ptr, 16, size*sizeof(T))==0)
|
||||
return static_cast<T*>(ptr);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return new T[size];
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void ei_aligned_free(T* ptr)
|
||||
{
|
||||
#ifdef EIGEN_VECTORIZE
|
||||
if (ei_packet_traits<T>::size>1)
|
||||
free(ptr);
|
||||
else
|
||||
#endif
|
||||
delete[] ptr;
|
||||
}
|
||||
|
||||
// purely fixed-size matrix
|
||||
template<typename T, int Size, int _Rows, int _Cols> class ei_matrix_storage
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user