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)
|
explicit EIGEN_STRONG_INLINE DiagonalMatrix(const std::initializer_list<std::initializer_list<Scalar>>& list)
|
||||||
: m_diagonal(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. */
|
/** Copy constructor. */
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
|
@ -162,6 +162,11 @@ template<typename Derived>
|
|||||||
inline const DiagonalWrapper<const Derived> Scaling(const MatrixBase<Derived>& coeffs)
|
inline const DiagonalWrapper<const Derived> Scaling(const MatrixBase<Derived>& coeffs)
|
||||||
{ return coeffs.asDiagonal(); }
|
{ 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 */
|
/** \deprecated */
|
||||||
typedef DiagonalMatrix<float, 2> AlignedScaling2f;
|
typedef DiagonalMatrix<float, 2> AlignedScaling2f;
|
||||||
/** \deprecated */
|
/** \deprecated */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user