diff --git a/Eigen/src/Sparse/CompressedStorage.h b/Eigen/src/Sparse/CompressedStorage.h index 4e8074b98..4dbd32309 100644 --- a/Eigen/src/Sparse/CompressedStorage.h +++ b/Eigen/src/Sparse/CompressedStorage.h @@ -37,7 +37,7 @@ class CompressedStorage : m_values(0), m_indices(0), m_size(0), m_allocatedSize(0) {} - CompressedStorage(int size) + CompressedStorage(size_t size) : m_values(0), m_indices(0), m_size(0), m_allocatedSize(0) { resize(size); @@ -71,9 +71,9 @@ class CompressedStorage delete[] m_indices; } - void reserve(int size) + void reserve(size_t size) { - int newAllocatedSize = m_size + size; + size_t newAllocatedSize = m_size + size; if (newAllocatedSize > m_allocatedSize) reallocate(newAllocatedSize); } @@ -84,10 +84,10 @@ class CompressedStorage reallocate(m_size); } - void resize(int size, float reserveSizeFactor = 0) + void resize(size_t size, float reserveSizeFactor = 0) { if (m_allocatedSizestart) { - int mid = (end+start)>>1; + size_t mid = (end+start)>>1; if (m_indices[mid]=m_size || m_indices[id]!=key) { resize(m_size+1,1); - for (int j=m_size-1; j>id; --j) + for (size_t j=m_size-1; j>id; --j) { m_indices[j] = m_indices[j-1]; m_values[j] = m_values[j-1]; @@ -187,9 +187,9 @@ class CompressedStorage void prune(Scalar reference, RealScalar epsilon = precision()) { - int k = 0; - int n = size(); - for (int i=0; i -bool test_random_setter(SparseType& sm, const DenseType& ref, const std::vector& nonzeroCoords) +template +bool test_random_setter(SparseMatrix& sm, const DenseType& ref, const std::vector& nonzeroCoords) { + typedef SparseMatrix SparseType; { sm.setZero(); SetterType w(sm); diff --git a/test/testsuite.cmake b/test/testsuite.cmake index 6be90317d..9bbe01dcb 100644 --- a/test/testsuite.cmake +++ b/test/testsuite.cmake @@ -26,6 +26,7 @@ # default: Nightly # - EIGEN_WORK_DIR: directory used to download the source files and make the builds # default: folder which contains this script +# - EIGEN_CMAKE_ARGS: additional arguments passed to cmake # - CTEST_SOURCE_DIRECTORY: path to eigen's src (use a new and empty folder, not the one you are working on) # default: /src # - CTEST_BINARY_DIRECTORY: build directory @@ -189,3 +190,7 @@ if(DEFINED EIGEN_EXPLICIT_VECTORIZATION) message(FATAL_ERROR "Invalid value for EIGEN_EXPLICIT_VECTORIZATION (${EIGEN_EXPLICIT_VECTORIZATION}), must be: novec, SSE2, SSE3, Altivec") endif(EIGEN_EXPLICIT_VECTORIZATION MATCHES SSE2) endif(DEFINED EIGEN_EXPLICIT_VECTORIZATION) + +if(DEFINED EIGEN_CMAKE_ARGS) + set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} ${EIGEN_CMAKE_ARGS}") +endif(DEFINED EIGEN_CMAKE_ARGS)