This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
View | Details | Raw Unified | Return to bug 259 | Differences between
and this patch

Collapse All | Expand All

(-)a/Eigen/src/Core/Replicate.h (-1 / +8 lines)
Lines 128-134 Link Here
128
    }
128
    }
129
129
130
  protected:
130
  protected:
131
    const typename MatrixType::Nested m_matrix;
131
    typedef typename internal::eval<MatrixType>::type PlainObjectType;
132
    typedef typename internal::conditional<
133
      internal::is_same<PlainObjectType,MatrixType>::value,
134
      PlainObjectType&,
135
      PlainObjectType
136
    >::type NestedType;
137
138
    const NestedType m_matrix;
132
    const internal::variable_if_dynamic<Index, RowFactor> m_rowFactor;
139
    const internal::variable_if_dynamic<Index, RowFactor> m_rowFactor;
133
    const internal::variable_if_dynamic<Index, ColFactor> m_colFactor;
140
    const internal::variable_if_dynamic<Index, ColFactor> m_colFactor;
134
};
141
};
(-)a/Eigen/src/Core/VectorwiseOp.h (-3 / +23 lines)
Lines 429-446 Link Here
429
    ExpressionType& operator+=(const DenseBase<OtherDerived>& other)
429
    ExpressionType& operator+=(const DenseBase<OtherDerived>& other)
430
    {
430
    {
431
      EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
431
      EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
432
433
      // nest expressions by value and plain objects by reference
434
      typedef typename internal::eval<OtherDerived>::type PlainObjectType;
435
      typedef typename internal::conditional<
436
        internal::is_same<PlainObjectType,OtherDerived>::value,
437
        PlainObjectType&,
438
        PlainObjectType
439
      >::type NestedType;
440
441
      const NestedType other_nested(other.derived());
432
      for(Index j=0; j<subVectors(); ++j)
442
      for(Index j=0; j<subVectors(); ++j)
433
        subVector(j) += other.derived();
443
        subVector(j) += other_nested;
434
      return const_cast<ExpressionType&>(m_matrix);
444
      return const_cast<ExpressionType&>(m_matrix);
435
    }
445
    }
436
446
437
    /** Substracts the vector \a other to each subvector of \c *this */
447
    /** Subtracts the vector \a other to each subvector of \c *this */
438
    template<typename OtherDerived>
448
    template<typename OtherDerived>
439
    ExpressionType& operator-=(const DenseBase<OtherDerived>& other)
449
    ExpressionType& operator-=(const DenseBase<OtherDerived>& other)
440
    {
450
    {
441
      EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
451
      EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
452
453
      // nest expressions by value and plain objects by reference
454
      typedef typename internal::eval<OtherDerived>::type PlainObjectType;
455
      typedef typename internal::conditional<
456
        internal::is_same<PlainObjectType,OtherDerived>::value,
457
        PlainObjectType&,
458
        PlainObjectType
459
      >::type NestedType;
460
461
      const NestedType other_nested(other.derived());
442
      for(Index j=0; j<subVectors(); ++j)
462
      for(Index j=0; j<subVectors(); ++j)
443
        subVector(j) -= other.derived();
463
        subVector(j) -= other_nested;
444
      return const_cast<ExpressionType&>(m_matrix);
464
      return const_cast<ExpressionType&>(m_matrix);
445
    }
465
    }
446
466

Return to bug 259