From cf29a237230abd4547d4435d5a5ab4cdcd46b332 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 20 Oct 2009 09:50:24 +0000 Subject: Use Eigen2 2.0 head version rather then 2.0.6. It contains various bug fix. --- extern/Eigen2/Eigen/src/Array/Functors.h | 4 ++ extern/Eigen2/Eigen/src/Array/PartialRedux.h | 5 +++ extern/Eigen2/Eigen/src/Core/CommaInitializer.h | 3 ++ extern/Eigen2/Eigen/src/Core/Cwise.h | 3 ++ extern/Eigen2/Eigen/src/Core/Flagged.h | 3 ++ extern/Eigen2/Eigen/src/Core/Functors.h | 10 +++++ extern/Eigen2/Eigen/src/Core/Matrix.h | 4 +- extern/Eigen2/Eigen/src/Core/NestByValue.h | 3 ++ extern/Eigen2/Eigen/src/Core/Part.h | 4 +- extern/Eigen2/Eigen/src/Core/Swap.h | 3 ++ extern/Eigen2/Eigen/src/Core/util/Memory.h | 49 +++++++++++++++------- extern/Eigen2/Eigen/src/SVD/SVD.h | 1 + extern/Eigen2/Eigen/src/Sparse/AmbiVector.h | 10 ++++- .../Eigen2/Eigen/src/Sparse/DynamicSparseMatrix.h | 4 +- extern/Eigen2/Eigen/src/Sparse/SparseBlock.h | 5 +++ extern/Eigen2/Eigen/src/Sparse/SparseCwise.h | 3 ++ .../Eigen2/Eigen/src/Sparse/SparseCwiseBinaryOp.h | 11 +++++ .../Eigen2/Eigen/src/Sparse/SparseCwiseUnaryOp.h | 3 ++ .../Eigen/src/Sparse/SparseDiagonalProduct.h | 2 + extern/Eigen2/Eigen/src/Sparse/SparseFlagged.h | 7 +++- extern/Eigen2/Eigen/src/Sparse/SparseMatrix.h | 11 +++-- extern/Eigen2/Eigen/src/Sparse/SparseTranspose.h | 7 +++- extern/Eigen2/Eigen/src/Sparse/SparseVector.h | 3 ++ extern/Eigen2/eigen-update.sh | 2 +- 24 files changed, 135 insertions(+), 25 deletions(-) (limited to 'extern') diff --git a/extern/Eigen2/Eigen/src/Array/Functors.h b/extern/Eigen2/Eigen/src/Array/Functors.h index 0aae7fd2c40..c2c325a788e 100644 --- a/extern/Eigen2/Eigen/src/Array/Functors.h +++ b/extern/Eigen2/Eigen/src/Array/Functors.h @@ -43,6 +43,8 @@ struct ei_scalar_add_op { inline const PacketScalar packetOp(const PacketScalar& a) const { return ei_padd(a, ei_pset1(m_other)); } const Scalar m_other; +private: + ei_scalar_add_op& operator=(const ei_scalar_add_op&); }; template struct ei_functor_traits > @@ -138,6 +140,8 @@ struct ei_scalar_pow_op { inline ei_scalar_pow_op(const Scalar& exponent) : m_exponent(exponent) {} inline Scalar operator() (const Scalar& a) const { return ei_pow(a, m_exponent); } const Scalar m_exponent; +private: + ei_scalar_pow_op& operator=(const ei_scalar_pow_op&); }; template struct ei_functor_traits > diff --git a/extern/Eigen2/Eigen/src/Array/PartialRedux.h b/extern/Eigen2/Eigen/src/Array/PartialRedux.h index b1e8fd4babd..3a052ca8a3d 100644 --- a/extern/Eigen2/Eigen/src/Array/PartialRedux.h +++ b/extern/Eigen2/Eigen/src/Array/PartialRedux.h @@ -133,6 +133,8 @@ struct ei_member_redux { inline result_type operator()(const MatrixBase& mat) const { return mat.redux(m_functor); } const BinaryOp m_functor; +private: + ei_member_redux& operator=(const ei_member_redux&); }; /** \array_module \ingroup Array @@ -290,6 +292,9 @@ template class PartialRedux protected: ExpressionTypeNested m_matrix; + + private: + PartialRedux& operator=(const PartialRedux&); }; /** \array_module diff --git a/extern/Eigen2/Eigen/src/Core/CommaInitializer.h b/extern/Eigen2/Eigen/src/Core/CommaInitializer.h index ed28e0ca371..f66cbd6d5e1 100644 --- a/extern/Eigen2/Eigen/src/Core/CommaInitializer.h +++ b/extern/Eigen2/Eigen/src/Core/CommaInitializer.h @@ -116,6 +116,9 @@ struct CommaInitializer int m_row; // current row id int m_col; // current col id int m_currentBlockRows; // current block height + +private: + CommaInitializer& operator=(const CommaInitializer&); }; /** \anchor MatrixBaseCommaInitRef diff --git a/extern/Eigen2/Eigen/src/Core/Cwise.h b/extern/Eigen2/Eigen/src/Core/Cwise.h index 0e92dce4e12..4dc9d514b04 100644 --- a/extern/Eigen2/Eigen/src/Core/Cwise.h +++ b/extern/Eigen2/Eigen/src/Core/Cwise.h @@ -178,6 +178,9 @@ template class Cwise protected: ExpressionTypeNested m_matrix; + + private: + Cwise& operator=(const Cwise&); }; /** \returns a Cwise wrapper of *this providing additional coefficient-wise operations diff --git a/extern/Eigen2/Eigen/src/Core/Flagged.h b/extern/Eigen2/Eigen/src/Core/Flagged.h index ce50246cb67..e3d25341d9e 100644 --- a/extern/Eigen2/Eigen/src/Core/Flagged.h +++ b/extern/Eigen2/Eigen/src/Core/Flagged.h @@ -109,6 +109,9 @@ template clas protected: ExpressionTypeNested m_matrix; + +private: + Flagged& operator=(const Flagged&); }; /** \returns an expression of *this with added flags diff --git a/extern/Eigen2/Eigen/src/Core/Functors.h b/extern/Eigen2/Eigen/src/Core/Functors.h index c8ca3dac1cf..969cad78d8f 100644 --- a/extern/Eigen2/Eigen/src/Core/Functors.h +++ b/extern/Eigen2/Eigen/src/Core/Functors.h @@ -279,6 +279,8 @@ struct ei_scalar_multiple_op { EIGEN_STRONG_INLINE const PacketScalar packetOp(const PacketScalar& a) const { return ei_pmul(a, ei_pset1(m_other)); } const Scalar m_other; +private: + ei_scalar_multiple_op& operator=(const ei_scalar_multiple_op&); }; template struct ei_functor_traits > @@ -294,6 +296,8 @@ struct ei_scalar_quotient1_impl { EIGEN_STRONG_INLINE const PacketScalar packetOp(const PacketScalar& a) const { return ei_pmul(a, ei_pset1(m_other)); } const Scalar m_other; +private: + ei_scalar_quotient1_impl& operator=(const ei_scalar_quotient1_impl&); }; template struct ei_functor_traits > @@ -306,6 +310,8 @@ struct ei_scalar_quotient1_impl { EIGEN_STRONG_INLINE ei_scalar_quotient1_impl(const Scalar& other) : m_other(other) {} EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a / m_other; } const Scalar m_other; +private: + ei_scalar_quotient1_impl& operator=(const ei_scalar_quotient1_impl&); }; template struct ei_functor_traits > @@ -323,6 +329,8 @@ template struct ei_scalar_quotient1_op : ei_scalar_quotient1_impl::HasFloatingPoint > { EIGEN_STRONG_INLINE ei_scalar_quotient1_op(const Scalar& other) : ei_scalar_quotient1_impl::HasFloatingPoint >(other) {} +private: + ei_scalar_quotient1_op& operator=(const ei_scalar_quotient1_op&); }; // nullary functors @@ -335,6 +343,8 @@ struct ei_scalar_constant_op { EIGEN_STRONG_INLINE const Scalar operator() (int, int = 0) const { return m_other; } EIGEN_STRONG_INLINE const PacketScalar packetOp() const { return ei_pset1(m_other); } const Scalar m_other; +private: + ei_scalar_constant_op& operator=(const ei_scalar_constant_op&); }; template struct ei_functor_traits > diff --git a/extern/Eigen2/Eigen/src/Core/Matrix.h b/extern/Eigen2/Eigen/src/Core/Matrix.h index ffd16d37606..22090c777da 100644 --- a/extern/Eigen2/Eigen/src/Core/Matrix.h +++ b/extern/Eigen2/Eigen/src/Core/Matrix.h @@ -505,7 +505,9 @@ class Matrix template EIGEN_STRONG_INLINE Matrix& _set(const MatrixBase& other) { - _set_selector(other.derived(), typename ei_meta_if::ret()); + // this enum introduced to fix compilation with gcc 3.3 + enum { cond = int(OtherDerived::Flags) & EvalBeforeAssigningBit }; + _set_selector(other.derived(), typename ei_meta_if::ret()); return *this; } diff --git a/extern/Eigen2/Eigen/src/Core/NestByValue.h b/extern/Eigen2/Eigen/src/Core/NestByValue.h index da79315bffe..2a14ab1f156 100644 --- a/extern/Eigen2/Eigen/src/Core/NestByValue.h +++ b/extern/Eigen2/Eigen/src/Core/NestByValue.h @@ -100,6 +100,9 @@ template class NestByValue protected: const ExpressionType m_expression; + + private: + NestByValue& operator=(const NestByValue&); }; /** \returns an expression of the temporary version of *this. diff --git a/extern/Eigen2/Eigen/src/Core/Part.h b/extern/Eigen2/Eigen/src/Core/Part.h index 9c273f249ec..96229f43b68 100644 --- a/extern/Eigen2/Eigen/src/Core/Part.h +++ b/extern/Eigen2/Eigen/src/Core/Part.h @@ -124,8 +124,10 @@ template class Part } protected: - const typename MatrixType::Nested m_matrix; + + private: + Part& operator=(const Part&); }; /** \nonstableyet diff --git a/extern/Eigen2/Eigen/src/Core/Swap.h b/extern/Eigen2/Eigen/src/Core/Swap.h index 77d562cd3ac..9aaac652fd8 100644 --- a/extern/Eigen2/Eigen/src/Core/Swap.h +++ b/extern/Eigen2/Eigen/src/Core/Swap.h @@ -117,6 +117,9 @@ template class SwapWrapper protected: ExpressionType& m_expression; + + private: + SwapWrapper& operator=(const SwapWrapper&); }; /** swaps *this with the expression \a other. diff --git a/extern/Eigen2/Eigen/src/Core/util/Memory.h b/extern/Eigen2/Eigen/src/Core/util/Memory.h index 09ad39d5be9..0a43e7f7bf2 100644 --- a/extern/Eigen2/Eigen/src/Core/util/Memory.h +++ b/extern/Eigen2/Eigen/src/Core/util/Memory.h @@ -1,5 +1,5 @@ // This file is part of Eigen, a lightweight C++ template library -// for linear algebra. Eigen itself is part of the KDE project. +// for linear algebra. // // Copyright (C) 2008 Gael Guennebaud // Copyright (C) 2008-2009 Benoit Jacob @@ -27,7 +27,17 @@ #ifndef EIGEN_MEMORY_H #define EIGEN_MEMORY_H -#if defined(__APPLE__) || defined(_WIN64) +// FreeBSD 6 seems to have 16-byte aligned malloc +// See http://svn.freebsd.org/viewvc/base/stable/6/lib/libc/stdlib/malloc.c?view=markup +// FreeBSD 7 seems to have 16-byte aligned malloc except on ARM and MIPS architectures +// See http://svn.freebsd.org/viewvc/base/stable/7/lib/libc/stdlib/malloc.c?view=markup +#if defined(__FreeBSD__) && !defined(__arm__) && !defined(__mips__) +#define EIGEN_FREEBSD_MALLOC_ALREADY_ALIGNED 1 +#else +#define EIGEN_FREEBSD_MALLOC_ALREADY_ALIGNED 0 +#endif + +#if defined(__APPLE__) || defined(_WIN64) || EIGEN_FREEBSD_MALLOC_ALREADY_ALIGNED #define EIGEN_MALLOC_ALREADY_ALIGNED 1 #else #define EIGEN_MALLOC_ALREADY_ALIGNED 0 @@ -65,7 +75,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 undefined, but if exceptions are enabled then a std::bad_alloc is thrown. + * 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(size_t size) { @@ -96,7 +106,7 @@ inline void* ei_aligned_malloc(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 undefined, but if exceptions are enabled then a std::bad_alloc is thrown. + * On allocation error, the returned pointer is null, and if exceptions are enabled then a std::bad_alloc is thrown. */ template inline void* ei_conditional_aligned_malloc(size_t size) { @@ -116,20 +126,29 @@ template<> inline void* ei_conditional_aligned_malloc(size_t size) return result; } +/** \internal construct the elements of an array. + * The \a size parameter tells on how many objects to call the constructor of T. + */ +template inline T* ei_construct_elements_of_array(T *ptr, size_t size) +{ + for (size_t i=0; i < size; ++i) ::new (ptr + i) T; + return ptr; +} + /** allocates \a size objects of type T. The returned pointer is guaranteed to have 16 bytes alignment. * 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 inline T* ei_aligned_new(size_t size) { - void *void_result = ei_aligned_malloc(sizeof(T)*size); - return ::new(void_result) T[size]; + T *result = reinterpret_cast(ei_aligned_malloc(sizeof(T)*size)); + return ei_construct_elements_of_array(result, size); } template inline T* ei_conditional_aligned_new(size_t size) { - void *void_result = ei_conditional_aligned_malloc(sizeof(T)*size); - return ::new(void_result) T[size]; + T *result = reinterpret_cast(ei_conditional_aligned_malloc(sizeof(T)*size)); + return ei_construct_elements_of_array(result, size); } /** \internal free memory allocated with ei_aligned_malloc @@ -163,10 +182,10 @@ template<> inline void ei_conditional_aligned_free(void *ptr) free(ptr); } -/** \internal delete the elements of an array. +/** \internal destruct the elements of an array. * The \a size parameters tells on how many objects to call the destructor of T. */ -template inline void ei_delete_elements_of_array(T *ptr, size_t size) +template 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(); @@ -177,7 +196,7 @@ template inline void ei_delete_elements_of_array(T *ptr, size_t size */ template inline void ei_aligned_delete(T *ptr, size_t size) { - ei_delete_elements_of_array(ptr, size); + ei_destruct_elements_of_array(ptr, size); ei_aligned_free(ptr); } @@ -186,7 +205,7 @@ template inline void ei_aligned_delete(T *ptr, size_t size) */ template inline void ei_conditional_aligned_delete(T *ptr, size_t size) { - ei_delete_elements_of_array(ptr, size); + ei_destruct_elements_of_array(ptr, size); ei_conditional_aligned_free(ptr); } @@ -225,8 +244,8 @@ inline static int ei_alignmentOffset(const Scalar* ptr, int maxOffset) #define ei_aligned_stack_free(PTR,SIZE) ei_aligned_free(PTR) #endif -#define ei_aligned_stack_new(TYPE,SIZE) ::new(ei_aligned_stack_alloc(sizeof(TYPE)*SIZE)) TYPE[SIZE] -#define ei_aligned_stack_delete(TYPE,PTR,SIZE) do {ei_delete_elements_of_array(PTR, SIZE); \ +#define ei_aligned_stack_new(TYPE,SIZE) ei_construct_elements_of_array(reinterpret_cast(ei_aligned_stack_alloc(sizeof(TYPE)*SIZE)), SIZE) +#define ei_aligned_stack_delete(TYPE,PTR,SIZE) do {ei_destruct_elements_of_array(PTR, SIZE); \ ei_aligned_stack_free(PTR,sizeof(TYPE)*SIZE);} while(0) @@ -244,7 +263,7 @@ inline static int ei_alignmentOffset(const Scalar* ptr, int maxOffset) return Eigen::ei_conditional_aligned_malloc(size); \ } #endif - + #define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) \ void *operator new(size_t size) { \ return Eigen::ei_conditional_aligned_malloc(size); \ diff --git a/extern/Eigen2/Eigen/src/SVD/SVD.h b/extern/Eigen2/Eigen/src/SVD/SVD.h index 0a52acf3d5b..d117c158397 100644 --- a/extern/Eigen2/Eigen/src/SVD/SVD.h +++ b/extern/Eigen2/Eigen/src/SVD/SVD.h @@ -107,6 +107,7 @@ void SVD::compute(const MatrixType& matrix) const int m = matrix.rows(); const int n = matrix.cols(); const int nu = std::min(m,n); + ei_assert(m>=n && "In Eigen 2.0, SVD only works for MxN matrices with M>=N. Sorry!"); m_matU.resize(m, nu); m_matU.setZero(); diff --git a/extern/Eigen2/Eigen/src/Sparse/AmbiVector.h b/extern/Eigen2/Eigen/src/Sparse/AmbiVector.h index 75001a2fa25..f279e80f00a 100644 --- a/extern/Eigen2/Eigen/src/Sparse/AmbiVector.h +++ b/extern/Eigen2/Eigen/src/Sparse/AmbiVector.h @@ -99,6 +99,8 @@ template class AmbiVector allocSize = allocSize/sizeof(Scalar) + (allocSize%sizeof(Scalar)>0?1:0); Scalar* newBuffer = new Scalar[allocSize]; memcpy(newBuffer, m_buffer, copyElements * sizeof(ListEl)); + delete[] m_buffer; + m_buffer = newBuffer; } protected: @@ -238,8 +240,11 @@ Scalar& AmbiVector::coeffRef(int i) else { if (m_llSize>=m_allocatedElements) + { reallocateSparse(); - ei_internal_assert(m_llSize(m_buffer); + } + ei_internal_assert(m_llSize::Iterator int m_cachedIndex; // current coordinate Scalar m_cachedValue; // current value bool m_isDense; // mode of the vector + + private: + Iterator& operator=(const Iterator&); }; diff --git a/extern/Eigen2/Eigen/src/Sparse/DynamicSparseMatrix.h b/extern/Eigen2/Eigen/src/Sparse/DynamicSparseMatrix.h index 7119a84bd51..01f97cd6d94 100644 --- a/extern/Eigen2/Eigen/src/Sparse/DynamicSparseMatrix.h +++ b/extern/Eigen2/Eigen/src/Sparse/DynamicSparseMatrix.h @@ -289,9 +289,11 @@ class DynamicSparseMatrix::InnerIterator : public SparseVector, Size> inline InnerIterator(const SparseInnerVectorSet& xpr, int outer) : MatrixType::InnerIterator(xpr.m_matrix, xpr.m_outerStart + outer) {} + private: + InnerIterator& operator=(const InnerIterator&); }; inline SparseInnerVectorSet(const MatrixType& matrix, int outerStart, int outerSize) diff --git a/extern/Eigen2/Eigen/src/Sparse/SparseCwise.h b/extern/Eigen2/Eigen/src/Sparse/SparseCwise.h index 2206883cc76..ac285ec1aa3 100644 --- a/extern/Eigen2/Eigen/src/Sparse/SparseCwise.h +++ b/extern/Eigen2/Eigen/src/Sparse/SparseCwise.h @@ -156,6 +156,9 @@ template class SparseCwise protected: ExpressionTypeNested m_matrix; + + private: + SparseCwise& operator=(const SparseCwise&); }; template diff --git a/extern/Eigen2/Eigen/src/Sparse/SparseCwiseBinaryOp.h b/extern/Eigen2/Eigen/src/Sparse/SparseCwiseBinaryOp.h index d19970efcb1..da9746e2099 100644 --- a/extern/Eigen2/Eigen/src/Sparse/SparseCwiseBinaryOp.h +++ b/extern/Eigen2/Eigen/src/Sparse/SparseCwiseBinaryOp.h @@ -126,6 +126,8 @@ class SparseCwiseBinaryOp::InnerIterator EIGEN_STRONG_INLINE InnerIterator(const SparseCwiseBinaryOp& binOp, int outer) : Base(binOp,outer) {} + private: + InnerIterator& operator=(const InnerIterator&); }; /*************************************************************************** @@ -197,6 +199,9 @@ class ei_sparse_cwise_binary_op_inner_iterator_selector, LhsIterator m_lhsIter; RhsIterator m_rhsIter; const BinaryFunc& m_functor; + + private: + ei_sparse_cwise_binary_op_inner_iterator_selector& operator=(const ei_sparse_cwise_binary_op_inner_iterator_selector&); }; // sparse - dense (product) @@ -290,6 +298,9 @@ class ei_sparse_cwise_binary_op_inner_iterator_selector, LhsIterator m_lhsIter; const BinaryFunc m_functor; const int m_outer; + + private: + ei_sparse_cwise_binary_op_inner_iterator_selector& operator=(const ei_sparse_cwise_binary_op_inner_iterator_selector&); }; // sparse - dense (product) diff --git a/extern/Eigen2/Eigen/src/Sparse/SparseCwiseUnaryOp.h b/extern/Eigen2/Eigen/src/Sparse/SparseCwiseUnaryOp.h index b11c0f8a377..2ed7a15579f 100644 --- a/extern/Eigen2/Eigen/src/Sparse/SparseCwiseUnaryOp.h +++ b/extern/Eigen2/Eigen/src/Sparse/SparseCwiseUnaryOp.h @@ -90,6 +90,9 @@ class SparseCwiseUnaryOp::InnerIterator protected: MatrixTypeIterator m_iter; const UnaryOp m_functor; + + private: + InnerIterator& operator=(const InnerIterator&); }; template diff --git a/extern/Eigen2/Eigen/src/Sparse/SparseDiagonalProduct.h b/extern/Eigen2/Eigen/src/Sparse/SparseDiagonalProduct.h index 932daf220b9..9b7432a8216 100644 --- a/extern/Eigen2/Eigen/src/Sparse/SparseDiagonalProduct.h +++ b/extern/Eigen2/Eigen/src/Sparse/SparseDiagonalProduct.h @@ -120,6 +120,8 @@ class ei_sparse_diagonal_product_inner_iterator_selector const SparseDiagonalProductType& expr, int outer) : Base(expr.rhs().innerVector(outer) .cwise()* expr.lhs().diagonal(), 0) {} + private: + ei_sparse_diagonal_product_inner_iterator_selector& operator=(const ei_sparse_diagonal_product_inner_iterator_selector&); }; template diff --git a/extern/Eigen2/Eigen/src/Sparse/SparseFlagged.h b/extern/Eigen2/Eigen/src/Sparse/SparseFlagged.h index c47e162f538..315ec4af39f 100644 --- a/extern/Eigen2/Eigen/src/Sparse/SparseFlagged.h +++ b/extern/Eigen2/Eigen/src/Sparse/SparseFlagged.h @@ -64,16 +64,21 @@ template clas protected: ExpressionTypeNested m_matrix; + + private: + SparseFlagged& operator=(const SparseFlagged&); }; template class SparseFlagged::InnerIterator : public ExpressionType::InnerIterator { public: - EIGEN_STRONG_INLINE InnerIterator(const SparseFlagged& xpr, int outer) : ExpressionType::InnerIterator(xpr.m_matrix, outer) {} + + private: + InnerIterator& operator=(const InnerIterator&); }; template diff --git a/extern/Eigen2/Eigen/src/Sparse/SparseMatrix.h b/extern/Eigen2/Eigen/src/Sparse/SparseMatrix.h index 3f09596bc64..65c609686d2 100644 --- a/extern/Eigen2/Eigen/src/Sparse/SparseMatrix.h +++ b/extern/Eigen2/Eigen/src/Sparse/SparseMatrix.h @@ -259,19 +259,21 @@ class SparseMatrix m_data.resize(k,0); } + /** Resizes the matrix to a \a rows x \a cols matrix and initializes it to zero + * \sa resizeNonZeros(int), reserve(), setZero() + */ void resize(int rows, int cols) { -// std::cerr << this << " resize " << rows << "x" << cols << "\n"; const int outerSize = IsRowMajor ? rows : cols; m_innerSize = IsRowMajor ? cols : rows; m_data.clear(); - if (m_outerSize != outerSize) + if (m_outerSize != outerSize || m_outerSize==0) { delete[] m_outerIndex; m_outerIndex = new int [outerSize+1]; m_outerSize = outerSize; - memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(int)); } + memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(int)); } void resizeNonZeros(int size) { @@ -442,6 +444,9 @@ class SparseMatrix::InnerIterator int m_id; const int m_start; const int m_end; + + private: + InnerIterator& operator=(const InnerIterator&); }; #endif // EIGEN_SPARSEMATRIX_H diff --git a/extern/Eigen2/Eigen/src/Sparse/SparseTranspose.h b/extern/Eigen2/Eigen/src/Sparse/SparseTranspose.h index 89a14d70707..7386294e4d4 100644 --- a/extern/Eigen2/Eigen/src/Sparse/SparseTranspose.h +++ b/extern/Eigen2/Eigen/src/Sparse/SparseTranspose.h @@ -62,15 +62,20 @@ template class SparseTranspose protected: const typename MatrixType::Nested m_matrix; + + private: + SparseTranspose& operator=(const SparseTranspose&); }; template class SparseTranspose::InnerIterator : public MatrixType::InnerIterator { public: - EIGEN_STRONG_INLINE InnerIterator(const SparseTranspose& trans, int outer) : MatrixType::InnerIterator(trans.m_matrix, outer) {} + + private: + InnerIterator& operator=(const InnerIterator&); }; template class SparseTranspose::ReverseInnerIterator : public MatrixType::ReverseInnerIterator diff --git a/extern/Eigen2/Eigen/src/Sparse/SparseVector.h b/extern/Eigen2/Eigen/src/Sparse/SparseVector.h index 8e5a6efeda8..5d47209f790 100644 --- a/extern/Eigen2/Eigen/src/Sparse/SparseVector.h +++ b/extern/Eigen2/Eigen/src/Sparse/SparseVector.h @@ -360,6 +360,9 @@ class SparseVector::InnerIterator const CompressedStorage& m_data; int m_id; const int m_end; + + private: + InnerIterator& operator=(const InnerIterator&); }; #endif // EIGEN_SPARSEVECTOR_H diff --git a/extern/Eigen2/eigen-update.sh b/extern/Eigen2/eigen-update.sh index 926a36ef120..797c710c196 100755 --- a/extern/Eigen2/eigen-update.sh +++ b/extern/Eigen2/eigen-update.sh @@ -17,7 +17,7 @@ if [ -d eigen2 ] then cd eigen2 # put here the version you want to use - hg up 2.0.6 + hg up 2.0 rm -f `find Eigen/ -type f -name "CMakeLists.txt"` cp -r Eigen .. cd .. -- cgit v1.2.3