mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-18 23:57:39 +08:00
Added Scaling function overload for vector rvalue reference
This commit is contained in:
parent
ba2cb835aa
commit
2c0ef43b48
@ -200,6 +200,10 @@ class DiagonalMatrix
|
||||
explicit EIGEN_STRONG_INLINE DiagonalMatrix(const std::initializer_list<std::initializer_list<Scalar>>& list)
|
||||
: m_diagonal(list) {}
|
||||
|
||||
/** \brief Constructs a DiagonalMatrix from an r-value diagonal vector type */
|
||||
EIGEN_DEVICE_FUNC
|
||||
explicit inline DiagonalMatrix(DiagonalVectorType&& diag) : m_diagonal(std::move(diag)) {}
|
||||
|
||||
/** Copy constructor. */
|
||||
template<typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC
|
||||
|
@ -162,6 +162,11 @@ template<typename Derived>
|
||||
inline const DiagonalWrapper<const Derived> Scaling(const MatrixBase<Derived>& coeffs)
|
||||
{ return coeffs.asDiagonal(); }
|
||||
|
||||
/** Constructs an axis aligned scaling expression from vector \a coeffs when passed as an rvalue reference */
|
||||
template<typename Derived>
|
||||
inline typename DiagonalWrapper<const Derived>::PlainObject Scaling(MatrixBase<Derived>&& coeffs)
|
||||
{ return typename DiagonalWrapper<const Derived>::PlainObject(std::move(coeffs.derived())); }
|
||||
|
||||
/** \deprecated */
|
||||
typedef DiagonalMatrix<float, 2> AlignedScaling2f;
|
||||
/** \deprecated */
|
||||
|
Loading…
x
Reference in New Issue
Block a user