aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Eigen/Core4
-rw-r--r--Eigen/src/Core/MapBase.h2
-rw-r--r--Eigen/src/Core/MatrixStorage.h2
-rw-r--r--Eigen/src/Core/products/SelfadjointMatrixVector.h14
-rw-r--r--Eigen/src/Core/util/Memory.h36
5 files changed, 31 insertions, 27 deletions
diff --git a/Eigen/Core b/Eigen/Core
index b9241a730..72c64d917 100644
--- a/Eigen/Core
+++ b/Eigen/Core
@@ -252,6 +252,10 @@ struct Dense {};
#include "src/Array/ArrayWrapper.h"
#include "src/Array/Array.h"
+// we use size_t frequently and we'll never remember to prepend it with std:: everytime just to
+// ensure QNX/QCC support
+using std::size_t;
+
} // namespace Eigen
#include "src/Array/GlobalFunctions.h"
diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h
index 81feb0b5a..a922d8bb0 100644
--- a/Eigen/src/Core/MapBase.h
+++ b/Eigen/src/Core/MapBase.h
@@ -170,7 +170,7 @@ template<typename Derived, typename Base> class MapBase
void checkDataAlignment() const
{
ei_assert( ((!(ei_traits<Derived>::Flags&AlignedBit))
- || ((std::size_t(m_data)&0xf)==0)) && "data is not aligned");
+ || ((size_t(m_data)&0xf)==0)) && "data is not aligned");
}
const Scalar* EIGEN_RESTRICT m_data;
diff --git a/Eigen/src/Core/MatrixStorage.h b/Eigen/src/Core/MatrixStorage.h
index 22da59f3b..046670452 100644
--- a/Eigen/src/Core/MatrixStorage.h
+++ b/Eigen/src/Core/MatrixStorage.h
@@ -53,7 +53,7 @@ struct ei_matrix_array
#define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask)
#else
#define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \
- ei_assert((reinterpret_cast<std::size_t>(array) & sizemask) == 0 \
+ ei_assert((reinterpret_cast<size_t>(array) & sizemask) == 0 \
&& "this assertion is explained here: " \
"http://eigen.tuxfamily.org/dox/UnalignedArrayAssert.html" \
" **** READ THIS WEB PAGE !!! ****");
diff --git a/Eigen/src/Core/products/SelfadjointMatrixVector.h b/Eigen/src/Core/products/SelfadjointMatrixVector.h
index 8fd09ac95..1c48208b3 100644
--- a/Eigen/src/Core/products/SelfadjointMatrixVector.h
+++ b/Eigen/src/Core/products/SelfadjointMatrixVector.h
@@ -83,10 +83,10 @@ static EIGEN_DONT_INLINE void ei_product_selfadjoint_vector(
Scalar t3 = 0;
Packet ptmp3 = ei_pset1(t3);
- std::size_t starti = FirstTriangular ? 0 : j+2;
- std::size_t endi = FirstTriangular ? j : size;
- std::size_t alignedEnd = starti;
- std::size_t alignedStart = (starti) + ei_first_aligned(&res[starti], endi-starti);
+ size_t starti = FirstTriangular ? 0 : j+2;
+ size_t endi = FirstTriangular ? j : size;
+ size_t alignedEnd = starti;
+ size_t alignedStart = (starti) + ei_first_aligned(&res[starti], endi-starti);
alignedEnd = alignedStart + ((endi-alignedStart)/(PacketSize))*(PacketSize);
res[j] += cj0.pmul(A0[j], t0);
@@ -102,7 +102,7 @@ static EIGEN_DONT_INLINE void ei_product_selfadjoint_vector(
t2 += cj1.pmul(A0[j+1], rhs[j+1]);
}
- for (std::size_t i=starti; i<alignedStart; ++i)
+ for (size_t i=starti; i<alignedStart; ++i)
{
res[i] += t0 * A0[i] + t1 * A1[i];
t2 += ei_conj(A0[i]) * rhs[i];
@@ -114,7 +114,7 @@ static EIGEN_DONT_INLINE void ei_product_selfadjoint_vector(
const Scalar* EIGEN_RESTRICT a1It = A1 + alignedStart;
const Scalar* EIGEN_RESTRICT rhsIt = rhs + alignedStart;
Scalar* EIGEN_RESTRICT resIt = res + alignedStart;
- for (std::size_t i=alignedStart; i<alignedEnd; i+=PacketSize)
+ for (size_t i=alignedStart; i<alignedEnd; i+=PacketSize)
{
Packet A0i = ei_ploadu(a0It); a0It += PacketSize;
Packet A1i = ei_ploadu(a1It); a1It += PacketSize;
@@ -126,7 +126,7 @@ static EIGEN_DONT_INLINE void ei_product_selfadjoint_vector(
ptmp3 = cj1.pmadd(A1i, Bi, ptmp3);
ei_pstore(resIt,Xi); resIt += PacketSize;
}
- for (std::size_t i=alignedEnd; i<endi; i++)
+ for (size_t i=alignedEnd; i<endi; i++)
{
res[i] += cj0.pmul(A0[i], t0) + cj0.pmul(A1[i],t1);
t2 += cj1.pmul(A0[i], rhs[i]);
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h
index ebc367424..d4920d213 100644
--- a/Eigen/src/Core/util/Memory.h
+++ b/Eigen/src/Core/util/Memory.h
@@ -59,10 +59,10 @@
* Fast, but wastes 16 additional bytes of memory.
* Does not throw any exception.
*/
-inline void* ei_handmade_aligned_malloc(std::size_t size)
+inline void* ei_handmade_aligned_malloc(size_t size)
{
void *original = std::malloc(size+16);
- void *aligned = reinterpret_cast<void*>((reinterpret_cast<std::size_t>(original) & ~(std::size_t(15))) + 16);
+ void *aligned = reinterpret_cast<void*>((reinterpret_cast<size_t>(original) & ~(size_t(15))) + 16);
*(reinterpret_cast<void**>(aligned) - 1) = original;
return aligned;
}
@@ -77,7 +77,7 @@ inline void ei_handmade_aligned_free(void *ptr)
/** \internal allocates \a size bytes. The returned pointer is guaranteed to have 16 bytes alignment.
* On allocation error, the returned pointer is null, and if exceptions are enabled then a std::bad_alloc is thrown.
*/
-inline void* ei_aligned_malloc(std::size_t size)
+inline void* ei_aligned_malloc(size_t size)
{
#ifdef EIGEN_NO_MALLOC
ei_assert(false && "heap allocation is forbidden (EIGEN_NO_MALLOC is defined)");
@@ -108,12 +108,12 @@ inline void* ei_aligned_malloc(std::size_t size)
/** allocates \a size bytes. If Align is true, then the returned ptr is 16-byte-aligned.
* On allocation error, the returned pointer is null, and if exceptions are enabled then a std::bad_alloc is thrown.
*/
-template<bool Align> inline void* ei_conditional_aligned_malloc(std::size_t size)
+template<bool Align> inline void* ei_conditional_aligned_malloc(size_t size)
{
return ei_aligned_malloc(size);
}
-template<> inline void* ei_conditional_aligned_malloc<false>(std::size_t size)
+template<> inline void* ei_conditional_aligned_malloc<false>(size_t size)
{
#ifdef EIGEN_NO_MALLOC
ei_assert(false && "heap allocation is forbidden (EIGEN_NO_MALLOC is defined)");
@@ -129,9 +129,9 @@ template<> inline void* ei_conditional_aligned_malloc<false>(std::size_t size)
/** \internal construct the elements of an array.
* The \a size parameter tells on how many objects to call the constructor of T.
*/
-template<typename T> inline T* ei_construct_elements_of_array(T *ptr, std::size_t size)
+template<typename T> inline T* ei_construct_elements_of_array(T *ptr, size_t size)
{
- for (std::size_t i=0; i < size; ++i) ::new (ptr + i) T;
+ for (size_t i=0; i < size; ++i) ::new (ptr + i) T;
return ptr;
}
@@ -139,13 +139,13 @@ template<typename T> inline T* ei_construct_elements_of_array(T *ptr, std::size_
* On allocation error, the returned pointer is undefined, but if exceptions are enabled then a std::bad_alloc is thrown.
* The default constructor of T is called.
*/
-template<typename T> inline T* ei_aligned_new(std::size_t size)
+template<typename T> inline T* ei_aligned_new(size_t size)
{
T *result = reinterpret_cast<T*>(ei_aligned_malloc(sizeof(T)*size));
return ei_construct_elements_of_array(result, size);
}
-template<typename T, bool Align> inline T* ei_conditional_aligned_new(std::size_t size)
+template<typename T, bool Align> inline T* ei_conditional_aligned_new(size_t size)
{
T *result = reinterpret_cast<T*>(ei_conditional_aligned_malloc<Align>(sizeof(T)*size));
return ei_construct_elements_of_array(result, size);
@@ -185,7 +185,7 @@ template<> inline void ei_conditional_aligned_free<false>(void *ptr)
/** \internal destruct the elements of an array.
* The \a size parameters tells on how many objects to call the destructor of T.
*/
-template<typename T> inline void ei_destruct_elements_of_array(T *ptr, std::size_t size)
+template<typename T> inline void ei_destruct_elements_of_array(T *ptr, size_t size)
{
// always destruct an array starting from the end.
while(size) ptr[--size].~T();
@@ -194,7 +194,7 @@ template<typename T> inline void ei_destruct_elements_of_array(T *ptr, std::size
/** \internal delete objects constructed with ei_aligned_new
* The \a size parameters tells on how many objects to call the destructor of T.
*/
-template<typename T> inline void ei_aligned_delete(T *ptr, std::size_t size)
+template<typename T> inline void ei_aligned_delete(T *ptr, size_t size)
{
ei_destruct_elements_of_array<T>(ptr, size);
ei_aligned_free(ptr);
@@ -203,7 +203,7 @@ template<typename T> inline void ei_aligned_delete(T *ptr, std::size_t size)
/** \internal delete objects constructed with ei_conditional_aligned_new
* The \a size parameters tells on how many objects to call the destructor of T.
*/
-template<typename T, bool Align> inline void ei_conditional_aligned_delete(T *ptr, std::size_t size)
+template<typename T, bool Align> inline void ei_conditional_aligned_delete(T *ptr, size_t size)
{
ei_destruct_elements_of_array<T>(ptr, size);
ei_conditional_aligned_free<Align>(ptr);
@@ -282,23 +282,23 @@ inline static Integer ei_first_aligned(const Scalar* array, Integer size)
#if EIGEN_ALIGN
#ifdef EIGEN_EXCEPTIONS
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_NOTHROW(NeedsToAlign) \
- void* operator new(std::size_t size, const std::nothrow_t&) throw() { \
+ void* operator new(size_t size, const std::nothrow_t&) throw() { \
try { return Eigen::ei_conditional_aligned_malloc<NeedsToAlign>(size); } \
catch (...) { return 0; } \
return 0; \
}
#else
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_NOTHROW(NeedsToAlign) \
- void* operator new(std::size_t size, const std::nothrow_t&) throw() { \
+ void* operator new(size_t size, const std::nothrow_t&) throw() { \
return Eigen::ei_conditional_aligned_malloc<NeedsToAlign>(size); \
}
#endif
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) \
- void *operator new(std::size_t size) { \
+ void *operator new(size_t size) { \
return Eigen::ei_conditional_aligned_malloc<NeedsToAlign>(size); \
} \
- void *operator new[](std::size_t size) { \
+ void *operator new[](size_t size) { \
return Eigen::ei_conditional_aligned_malloc<NeedsToAlign>(size); \
} \
void operator delete(void * ptr) throw() { Eigen::ei_conditional_aligned_free<NeedsToAlign>(ptr); } \
@@ -306,7 +306,7 @@ inline static Integer ei_first_aligned(const Scalar* array, Integer size)
/* in-place new and delete. since (at least afaik) there is no actual */ \
/* memory allocated we can safely let the default implementation handle */ \
/* this particular case. */ \
- static void *operator new(std::size_t size, void *ptr) { return ::operator new(size,ptr); } \
+ static void *operator new(size_t size, void *ptr) { return ::operator new(size,ptr); } \
void operator delete(void * memory, void *ptr) throw() { return ::operator delete(memory,ptr); } \
/* nothrow-new (returns zero instead of std::bad_alloc) */ \
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_NOTHROW(NeedsToAlign) \
@@ -340,7 +340,7 @@ template<class T>
class aligned_allocator
{
public:
- typedef std::size_t size_type;
+ typedef size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef T* pointer;
typedef const T* const_pointer;