Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Geometry_Module
+ Collaboration diagram for Geometry_Module:

Modules

 Global aligned box typedefs
 

Classes

class  Eigen::Map< const Quaternion< _Scalar >, _Options >
 Quaternion expression mapping a constant memory buffer. More...
 
class  Eigen::Map< Quaternion< _Scalar >, _Options >
 Expression of a quaternion from a memory buffer. More...
 
class  Eigen::AlignedBox< _Scalar, _AmbientDim >
 An axis aligned box. More...
 
class  Eigen::AngleAxis< _Scalar >
 Represents a 3D rotation as a rotation angle around an arbitrary 3D axis. More...
 
class  Eigen::Homogeneous< MatrixType, _Direction >
 Expression of one (or a set of) homogeneous vector(s) More...
 
class  Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >
 A hyperplane. More...
 
class  Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >
 A parametrized line. More...
 
class  Eigen::QuaternionBase< Derived >
 Base class for quaternion expressions. More...
 
class  Eigen::Quaternion< _Scalar, _Options >
 The quaternion class used to represent 3D orientations and rotations. More...
 
class  Eigen::Rotation2D< _Scalar >
 Represents a rotation/orientation in a 2 dimensional space. More...
 
class  Scaling
 Represents a generic uniform scaling transformation. More...
 
class  Eigen::Transform< _Scalar, _Dim, _Mode, _Options >
 Represents an homogeneous transformation in a N dimensional space. More...
 
class  Eigen::Translation< _Scalar, _Dim >
 Represents a translation transformation. More...
 

Typedefs

typedef AngleAxis< float > Eigen::AngleAxisf
 
typedef AngleAxis< double > Eigen::AngleAxisd
 
typedef Quaternion< float > Eigen::Quaternionf
 
typedef Quaternion< double > Eigen::Quaterniond
 
typedef Map< Quaternion< float >, 0 > Eigen::QuaternionMapf
 
typedef Map< Quaternion< double >, 0 > Eigen::QuaternionMapd
 
typedef Map< Quaternion< float >, AlignedEigen::QuaternionMapAlignedf
 
typedef Map< Quaternion< double >, AlignedEigen::QuaternionMapAlignedd
 
typedef Rotation2D< float > Eigen::Rotation2Df
 
typedef Rotation2D< double > Eigen::Rotation2Dd
 
typedef Transform< float, 2, IsometryEigen::Isometry2f
 
typedef Transform< float, 3, IsometryEigen::Isometry3f
 
typedef Transform< double, 2, IsometryEigen::Isometry2d
 
typedef Transform< double, 3, IsometryEigen::Isometry3d
 
typedef Transform< float, 2, AffineEigen::Affine2f
 
typedef Transform< float, 3, AffineEigen::Affine3f
 
typedef Transform< double, 2, AffineEigen::Affine2d
 
typedef Transform< double, 3, AffineEigen::Affine3d
 
typedef Transform< float, 2, AffineCompactEigen::AffineCompact2f
 
typedef Transform< float, 3, AffineCompactEigen::AffineCompact3f
 
typedef Transform< double, 2, AffineCompactEigen::AffineCompact2d
 
typedef Transform< double, 3, AffineCompactEigen::AffineCompact3d
 
typedef Transform< float, 2, ProjectiveEigen::Projective2f
 
typedef Transform< float, 3, ProjectiveEigen::Projective3f
 
typedef Transform< double, 2, ProjectiveEigen::Projective2d
 
typedef Transform< double, 3, ProjectiveEigen::Projective3d
 

Functions

template<typename Derived , typename OtherDerived >
internal::umeyama_transform_matrix_type< Derived, OtherDerived >::type Eigen::umeyama (const MatrixBase< Derived > &src, const MatrixBase< OtherDerived > &dst, bool with_scaling=true)
 Returns the transformation between two point sets.
 
EIGEN_DEVICE_FUNC Matrix< Scalar, 3, 1 > Eigen::MatrixBase< Derived >::eulerAngles (Index a0, Index a1, Index a2) const
 
EIGEN_DEVICE_FUNC HomogeneousReturnType Eigen::MatrixBase< Derived >::homogeneous () const
 
EIGEN_DEVICE_FUNC HomogeneousReturnType Eigen::VectorwiseOp< ExpressionType, Direction >::homogeneous () const
 
EIGEN_DEVICE_FUNC const HNormalizedReturnType Eigen::MatrixBase< Derived >::hnormalized () const
 homogeneous normalization
 
EIGEN_DEVICE_FUNC const HNormalizedReturnType Eigen::VectorwiseOp< ExpressionType, Direction >::hnormalized () const
 column or row-wise homogeneous normalization
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC MatrixBase< Derived >::template cross_product_return_type< OtherDerived >::type Eigen::MatrixBase< Derived >::cross (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC PlainObject Eigen::MatrixBase< Derived >::cross3 (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC const CrossReturnType Eigen::VectorwiseOp< ExpressionType, Direction >::cross (const MatrixBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC PlainObject Eigen::MatrixBase< Derived >::unitOrthogonal (void) const
 

Detailed Description


Class Documentation

◆ Eigen::Map< const Quaternion< _Scalar >, _Options >

class Eigen::Map< const Quaternion< _Scalar >, _Options >
template<typename _Scalar, int _Options>
class Eigen::Map< const Quaternion< _Scalar >, _Options >

Quaternion expression mapping a constant memory buffer.

Template Parameters
_Scalarthe type of the Quaternion coefficients
_Optionssee class Map

This is a specialization of class Map for Quaternion. This class allows to view a 4 scalar memory buffer as an Eigen's Quaternion object.

See also
class Map, class Quaternion, class QuaternionBase
+ Inheritance diagram for Eigen::Map< const Quaternion< _Scalar >, _Options >:
+ Collaboration diagram for Eigen::Map< const Quaternion< _Scalar >, _Options >:

Public Types

typedef QuaternionBase< Map< const Quaternion< _Scalar >, _Options > > Base
 
typedef _Scalar Scalar
 
typedef internal::traits< Map >::Coefficients Coefficients
 
enum  
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef Coefficients::CoeffReturnType CoeffReturnType
 
typedef internal::conditional< bool(internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Flags &LvalueBit), Scalar &, CoeffReturnType >::type NonConstCoeffReturnType
 
typedef Matrix< Scalar, 3, 1 > Vector3
 
typedef Matrix< Scalar, 3, 3 > Matrix3
 
typedef AngleAxis< ScalarAngleAxisType
 
enum  { Dim = _Dim }
 
typedef Matrix< Scalar, Dim, DimRotationMatrixType
 
typedef Matrix< Scalar, Dim, 1 > VectorType
 

Public Member Functions

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Map (const Scalar *coeffs)
 
EIGEN_DEVICE_FUNC const Coefficientscoeffs () const
 
EIGEN_DEVICE_FUNC CoeffReturnType x () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType x ()
 
EIGEN_DEVICE_FUNC CoeffReturnType y () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType y ()
 
EIGEN_DEVICE_FUNC CoeffReturnType z () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType z ()
 
EIGEN_DEVICE_FUNC CoeffReturnType w () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType w ()
 
EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > vec () const
 
EIGEN_DEVICE_FUNC VectorBlock< Coefficients, 3 > vec ()
 
EIGEN_DEVICE_FUNC internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Coefficientscoeffs ()
 
EIGEN_DEVICE_FUNC QuaternionBasesetIdentity ()
 
EIGEN_DEVICE_FUNC Scalar squaredNorm () const
 
EIGEN_DEVICE_FUNC Scalar norm () const
 
EIGEN_DEVICE_FUNC void normalize ()
 
EIGEN_DEVICE_FUNC Quaternion< Scalarnormalized () const
 
EIGEN_DEVICE_FUNC Scalar dot (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Matrix3 toRotationMatrix () const
 
EIGEN_DEVICE_FUNC Map< const Quaternion< _Scalar >, _Options > & setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< Scalaroperator* (const QuaternionBase< OtherDerived > &q) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Scalaroperator* (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometryoperator* (const Translation< Scalar, Dim > &t) const
 
EIGEN_DEVICE_FUNC RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator* (const EigenBase< OtherDerived > &e) const
 
template<int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Map< const Quaternion< _Scalar >, _Options > & operator*= (const QuaternionBase< OtherDerived > &q)
 
EIGEN_DEVICE_FUNC Quaternion< Scalarinverse () const
 
EIGEN_DEVICE_FUNC Quaternion< Scalarconjugate () const
 
EIGEN_DEVICE_FUNC Quaternion< Scalarslerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Scalarslerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC bool isApprox (const QuaternionBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Vector3 _transformVector (const Vector3 &v) const
 
template<typename OtherVectorType >
EIGEN_DEVICE_FUNC VectorType _transformVector (const OtherVectorType &v) const
 
EIGEN_DEVICE_FUNC internal::cast_return_type< Map< const Quaternion< _Scalar >, _Options >, Quaternion< NewScalarType > >::type cast () const
 
EIGEN_DEVICE_FUNC const Derived & derived () const
 
EIGEN_DEVICE_FUNC Derived & derived ()
 
EIGEN_DEVICE_FUNC RotationMatrixType matrix () const
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC Quaternion< ScalarIdentity ()
 

Protected Attributes

const Coefficients m_coeffs
 

Member Typedef Documentation

◆ AngleAxisType

typedef AngleAxis<Scalar> Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::AngleAxisType
inherited

the equivalent angle-axis type

◆ Base

template<typename _Scalar , int _Options>
typedef QuaternionBase<Map<const Quaternion<_Scalar>, _Options> > Eigen::Map< const Quaternion< _Scalar >, _Options >::Base

◆ Coefficients

template<typename _Scalar , int _Options>
typedef internal::traits<Map>::Coefficients Eigen::Map< const Quaternion< _Scalar >, _Options >::Coefficients

◆ CoeffReturnType

typedef Coefficients::CoeffReturnType Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::CoeffReturnType
inherited

◆ Matrix3

typedef Matrix<Scalar,3,3> Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::Matrix3
inherited

the equivalent rotation matrix type

◆ NonConstCoeffReturnType

typedef internal::conditional<bool(internal::traits<Map< const Quaternion< _Scalar >, _Options > >::Flags&LvalueBit),Scalar&,CoeffReturnType>::type Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::NonConstCoeffReturnType
inherited

◆ RealScalar

typedef NumTraits<Scalar>::Real Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::RealScalar
inherited

◆ RotationMatrixType

template<typename Derived , int _Dim>
typedef Matrix<Scalar,Dim,Dim> Eigen::RotationBase< Derived, _Dim >::RotationMatrixType
inherited

corresponding linear transformation matrix type

◆ Scalar

template<typename _Scalar , int _Options>
typedef _Scalar Eigen::Map< const Quaternion< _Scalar >, _Options >::Scalar

◆ Vector3

typedef Matrix<Scalar,3,1> Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::Vector3
inherited

the type of a 3D vector

◆ VectorType

template<typename Derived , int _Dim>
typedef Matrix<Scalar,Dim,1> Eigen::RotationBase< Derived, _Dim >::VectorType
inherited

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived , int _Dim>
anonymous enum
inherited
Enumerator
Dim 
32{ Dim = _Dim };
@ Dim
Definition RotationBase.h:32

◆ anonymous enum

anonymous enum
inherited

Constructor & Destructor Documentation

◆ Map()

template<typename _Scalar , int _Options>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Map< const Quaternion< _Scalar >, _Options >::Map ( const Scalar coeffs)
inlineexplicit

Constructs a Mapped Quaternion object from the pointer coeffs

The pointer coeffs must reference the four coefficients of Quaternion in the following order:

*coeffs == {x, y, z, w}
EIGEN_DEVICE_FUNC const Coefficients & coeffs() const
Definition Quaternion.h:367
EIGEN_DEVICE_FUNC CoeffReturnType w() const
Definition Quaternion.h:72
EIGEN_DEVICE_FUNC CoeffReturnType y() const
Definition Quaternion.h:68
EIGEN_DEVICE_FUNC CoeffReturnType x() const
Definition Quaternion.h:66
EIGEN_DEVICE_FUNC CoeffReturnType z() const
Definition Quaternion.h:70

If the template parameter _Options is set to Aligned, then the pointer coeffs must be aligned.

365: m_coeffs(coeffs) {}
const Coefficients m_coeffs
Definition Quaternion.h:370

Member Function Documentation

◆ _transformVector() [1/2]

template<typename Derived , int _Dim>
template<typename OtherVectorType >
EIGEN_DEVICE_FUNC VectorType Eigen::RotationBase< Derived, _Dim >::_transformVector ( const OtherVectorType &  v) const
inlineinherited
94 { return toRotationMatrix() * v; }
EIGEN_DEVICE_FUNC RotationMatrixType toRotationMatrix() const
Definition RotationBase.h:45

References Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

◆ _transformVector() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::Vector3 Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::_transformVector ( const Vector3 v) const
inherited

return the result vector of v through the rotation

Rotation of a vector by a quaternion.

Remarks
If the quaternion is used to rotate several points (>1) then it is much more efficient to first convert it to a 3x3 Matrix. Comparison of the operation cost for n transformations:
  • Quaternion2: 30n
  • Via a Matrix3: 24 + 15n
476{
477 // Note that this algorithm comes from the optimization by hand
478 // of the conversion to a Matrix followed by a Matrix/Vector product.
479 // It appears to be much faster than the common algorithm found
480 // in the literature (30 versus 39 flops). It also requires two
481 // Vector3 as temporaries.
482 Vector3 uv = this->vec().cross(v);
483 uv += uv;
484 return v + this->w() * uv + this->vec().cross(uv);
485}
Matrix< Scalar, 3, 1 > Vector3
Definition Quaternion.h:57
EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > vec() const
Definition Quaternion.h:84

◆ angularDistance() [1/2]

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::angularDistance ( const QuaternionBase< OtherDerived > &  other) const
inherited

◆ angularDistance() [2/2]

EIGEN_DEVICE_FUNC internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Scalar Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::angularDistance ( const QuaternionBase< OtherDerived > &  other) const
inlineinherited
Returns
the angle (in radian) between two rotations
See also
dot()
709{
710 EIGEN_USING_STD_MATH(atan2)
711 Quaternion<Scalar> d = (*this) * other.conjugate();
712 return Scalar(2) * atan2( d.vec().norm(), numext::abs(d.w()) );
713}
internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Scalar Scalar
Definition Quaternion.h:43

◆ cast()

EIGEN_DEVICE_FUNC internal::cast_return_type< Map< const Quaternion< _Scalar >, _Options > , Quaternion< NewScalarType > >::type Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::cast ( ) const
inlineinherited
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

179 {
180 return typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type(derived());
181 }
EIGEN_DEVICE_FUNC const Derived & derived() const
Definition RotationBase.h:41

◆ coeffs() [1/2]

EIGEN_DEVICE_FUNC internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Coefficients & Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::coeffs ( )
inlineinherited
Returns
a vector expression of the coefficients (x,y,z,w)
93{ return derived().coeffs(); }

◆ coeffs() [2/2]

template<typename _Scalar , int _Options>
EIGEN_DEVICE_FUNC const Coefficients & Eigen::Map< const Quaternion< _Scalar >, _Options >::coeffs ( ) const
inline
367{ return m_coeffs;}

◆ conjugate()

EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Scalar > Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::conjugate
inlineinherited
Returns
the conjugated quaternion
the conjugate of the *this which is equal to the multiplicative inverse if the quaternion is normalized. The conjugate of a quaternion represents the opposite rotation.
See also
Quaternion2::inverse()
696{
697 return internal::quat_conj<Architecture::Target, Derived,
698 typename internal::traits<Derived>::Scalar>::run(*this);
699
700}

◆ derived() [1/2]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC Derived & Eigen::RotationBase< Derived, _Dim >::derived ( )
inlineinherited
42{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC const Derived & Eigen::RotationBase< Derived, _Dim >::derived ( ) const
inlineinherited
41{ return *static_cast<const Derived*>(this); }

Referenced by Eigen::RotationBase< Derived, _Dim >::inverse(), Eigen::RotationBase< Derived, _Dim >::matrix(), Eigen::RotationBase< Derived, _Dim >::operator*(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*(), Eigen::QuaternionBase< Derived >::operator*=(), and Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the caller graph for this function:

◆ dot()

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::dot ( const QuaternionBase< OtherDerived > &  other) const
inlineinherited
Returns
the dot product of *this and other Geometrically speaking, the dot product of two unit quaternions corresponds to the cosine of half the angle between the two rotations.
See also
angularDistance()
139{ return coeffs().dot(other.coeffs()); }
EIGEN_DEVICE_FUNC const internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Coefficients & coeffs() const
Definition Quaternion.h:90

◆ Identity()

static EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::Identity ( )
inlinestaticinherited
Returns
a quaternion representing an identity rotation
See also
MatrixBase::Identity()
111{ return Quaternion<Scalar>(Scalar(1), Scalar(0), Scalar(0), Scalar(0)); }

◆ inverse()

EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Scalar > Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::inverse
inlineinherited
Returns
the quaternion describing the inverse rotation
the multiplicative inverse of *this Note that in most cases, i.e., if you simply want the opposite rotation, and/or the quaternion is normalized, then it is enough to use the conjugate.
See also
QuaternionBase::conjugate()
665{
666 // FIXME should this function be called multiplicativeInverse and conjugate() be called inverse() or opposite() ??
667 Scalar n2 = this->squaredNorm();
668 if (n2 > Scalar(0))
669 return Quaternion<Scalar>(conjugate().coeffs() / n2);
670 else
671 {
672 // return an invalid result to flag the error
673 return Quaternion<Scalar>(Coefficients::Zero());
674 }
675}
EIGEN_DEVICE_FUNC ConjugateReturnType conjugate() const
Definition CommonCwiseUnaryOps.h:74
EIGEN_DEVICE_FUNC Scalar squaredNorm() const
Definition Quaternion.h:120

◆ isApprox()

EIGEN_DEVICE_FUNC bool Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::isApprox ( const QuaternionBase< OtherDerived > &  other,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
inlineinherited
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()
167 { return coeffs().isApprox(other.coeffs(), prec); }

◆ matrix()

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< Derived, _Dim >::matrix ( ) const
inlineinherited
Returns
an equivalent rotation matrix This function is added to be conform with the Transform class' naming scheme.
50{ return derived().toRotationMatrix(); }

References Eigen::RotationBase< Derived, _Dim >::derived().

Referenced by Slic3r::Emboss::create_transformation_onto_surface(), and igl::snap_to_fixed_up().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ norm()

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::norm ( ) const
inlineinherited
Returns
the norm of the quaternion's coefficients
See also
QuaternionBase::squaredNorm(), MatrixBase::norm()
125{ return coeffs().norm(); }

◆ normalize()

EIGEN_DEVICE_FUNC void Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::normalize ( )
inlineinherited

Normalizes the quaternion *this

See also
normalized(), MatrixBase::normalize()
129{ coeffs().normalize(); }

◆ normalized()

EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::normalized ( ) const
inlineinherited
Returns
a normalized copy of *this
See also
normalize(), MatrixBase::normalized()
132{ return Quaternion<Scalar>(coeffs().normalized()); }
EIGEN_DEVICE_FUNC Quaternion< Scalar > normalized() const
Definition Quaternion.h:132

◆ operator*() [1/6]

template<typename Derived , int _Dim>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType Eigen::RotationBase< Derived, _Dim >::operator* ( const EigenBase< OtherDerived > &  e) const
inlineinherited
Returns
the concatenation of the rotation *this with a generic expression e e can be:
  • a DimxDim linear transformation matrix
  • a DimxDim diagonal matrix (axis aligned scaling)
  • a vector of size Dim
72 { return internal::rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); }

References Eigen::EigenBase< Derived >::derived(), and Eigen::RotationBase< Derived, _Dim >::derived().

+ Here is the call graph for this function:

◆ operator*() [2/6]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Scalar > Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::operator* ( const QuaternionBase< OtherDerived > &  other) const
inherited
Returns
the concatenation of two rotations as a quaternion-quaternion product
450{
451 EIGEN_STATIC_ASSERT((internal::is_same<typename Derived::Scalar, typename OtherDerived::Scalar>::value),
452 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
453 return internal::quat_product<Architecture::Target, Derived, OtherDerived,
454 typename internal::traits<Derived>::Scalar>::run(*this, other);
455}
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition StaticAssert.h:124

◆ operator*() [3/6]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< Scalar > Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::operator* ( const QuaternionBase< OtherDerived > &  q) const
inherited

◆ operator*() [4/6]

template<typename Derived , int _Dim>
template<int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > Eigen::RotationBase< Derived, _Dim >::operator* ( const Transform< Scalar, Dim, Mode, Options > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a transformation t
90 { return toRotationMatrix() * t; }

References Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

◆ operator*() [5/6]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometry > Eigen::RotationBase< Derived, _Dim >::operator* ( const Translation< Scalar, Dim > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a translation t
57 { return Transform<Scalar,Dim,Isometry>(*this) * t; }

◆ operator*() [6/6]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< Derived, _Dim >::operator* ( const UniformScaling< Scalar > &  s) const
inlineinherited
Returns
the concatenation of the rotation *this with a uniform scaling s
61 { return toRotationMatrix() * s.factor(); }

References Eigen::UniformScaling< _Scalar >::factor(), and Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

◆ operator*=()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Map< const Quaternion< _Scalar >, _Options > & Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::operator*= ( const QuaternionBase< OtherDerived > &  other)
inherited
See also
operator*(Quaternion)
461{
462 derived() = derived() * other.derived();
463 return derived();
464}

◆ setFromTwoVectors()

EIGEN_DEVICE_FUNC Map< const Quaternion< _Scalar >, _Options > & Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::setFromTwoVectors ( const MatrixBase< Derived1 > &  a,
const MatrixBase< Derived2 > &  b 
)
inlineinherited
Returns
the quaternion which transform a into b through a rotation

Sets *this to be a quaternion representing a rotation between the two arbitrary vectors a and b. In other words, the built rotation represent a rotation sending the line of direction a to the line of direction b, both lines passing through the origin.

Returns
a reference to *this.

Note that the two input vectors do not have to be normalized, and do not need to have the same norm.

583{
584 EIGEN_USING_STD_MATH(sqrt)
585 Vector3 v0 = a.normalized();
586 Vector3 v1 = b.normalized();
587 Scalar c = v1.dot(v0);
588
589 // if dot == -1, vectors are nearly opposites
590 // => accurately compute the rotation axis by computing the
591 // intersection of the two planes. This is done by solving:
592 // x^T v0 = 0
593 // x^T v1 = 0
594 // under the constraint:
595 // ||x|| = 1
596 // which yields a singular value problem
597 if (c < Scalar(-1)+NumTraits<Scalar>::dummy_precision())
598 {
599 c = numext::maxi(c,Scalar(-1));
600 Matrix<Scalar,2,3> m; m << v0.transpose(), v1.transpose();
601 JacobiSVD<Matrix<Scalar,2,3> > svd(m, ComputeFullV);
602 Vector3 axis = svd.matrixV().col(2);
603
604 Scalar w2 = (Scalar(1)+c)*Scalar(0.5);
605 this->w() = sqrt(w2);
606 this->vec() = axis * sqrt(Scalar(1) - w2);
607 return derived();
608 }
609 Vector3 axis = v0.cross(v1);
610 Scalar s = sqrt((Scalar(1)+c)*Scalar(2));
611 Scalar invs = Scalar(1)/s;
612 this->vec() = axis * invs;
613 this->w() = s * Scalar(0.5);
614
615 return derived();
616}
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Definition ArrayCwiseUnaryOps.h:152

◆ setIdentity()

EIGEN_DEVICE_FUNC QuaternionBase & Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::setIdentity ( )
inlineinherited
See also
QuaternionBase::Identity(), MatrixBase::setIdentity()
115{ coeffs() << Scalar(0), Scalar(0), Scalar(0), Scalar(1); return *this; }

◆ slerp() [1/2]

EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::slerp ( const Scalar t,
const QuaternionBase< OtherDerived > &  other 
) const
inherited

◆ slerp() [2/2]

EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Map< const Quaternion< _Scalar >, _Options > >::Scalar > Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::slerp ( const Scalar t,
const QuaternionBase< OtherDerived > &  other 
) const
inherited
Returns
the spherical linear interpolation between the two quaternions *this and other at the parameter t in [0;1].

This represents an interpolation for a constant motion between *this and other, see also http://en.wikipedia.org/wiki/Slerp.

727{
728 EIGEN_USING_STD_MATH(acos)
729 EIGEN_USING_STD_MATH(sin)
730 const Scalar one = Scalar(1) - NumTraits<Scalar>::epsilon();
731 Scalar d = this->dot(other);
732 Scalar absD = numext::abs(d);
733
734 Scalar scale0;
735 Scalar scale1;
736
737 if(absD>=one)
738 {
739 scale0 = Scalar(1) - t;
740 scale1 = t;
741 }
742 else
743 {
744 // theta is the angle between the 2 quaternions
745 Scalar theta = acos(absD);
746 Scalar sinTheta = sin(theta);
747
748 scale0 = sin( ( Scalar(1) - t ) * theta) / sinTheta;
749 scale1 = sin( ( t * theta) ) / sinTheta;
750 }
751 if(d<Scalar(0)) scale1 = -scale1;
752
753 return Quaternion<Scalar>(scale0 * coeffs() + scale1 * other.coeffs());
754}
EIGEN_DEVICE_FUNC const AcosReturnType acos() const
Definition ArrayCwiseUnaryOps.h:262
EIGEN_DEVICE_FUNC const SinReturnType sin() const
Definition ArrayCwiseUnaryOps.h:220
EIGEN_DEVICE_FUNC Scalar dot(const QuaternionBase< OtherDerived > &other) const
Definition Quaternion.h:139

◆ squaredNorm()

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::squaredNorm ( ) const
inlineinherited
Returns
the squared norm of the quaternion's coefficients
See also
QuaternionBase::norm(), MatrixBase::squaredNorm()
120{ return coeffs().squaredNorm(); }

◆ toRotationMatrix()

EIGEN_DEVICE_FUNC QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::Matrix3 Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::toRotationMatrix ( void  ) const
inlineinherited
Returns
an equivalent 3x3 rotation matrix

Convert the quaternion to a 3x3 rotation matrix. The quaternion is required to be normalized, otherwise the result is undefined.

537{
538 // NOTE if inlined, then gcc 4.2 and 4.4 get rid of the temporary (not gcc 4.3 !!)
539 // if not inlined then the cost of the return by value is huge ~ +35%,
540 // however, not inlining this function is an order of magnitude slower, so
541 // it has to be inlined, and so the return by value is not an issue
542 Matrix3 res;
543
544 const Scalar tx = Scalar(2)*this->x();
545 const Scalar ty = Scalar(2)*this->y();
546 const Scalar tz = Scalar(2)*this->z();
547 const Scalar twx = tx*this->w();
548 const Scalar twy = ty*this->w();
549 const Scalar twz = tz*this->w();
550 const Scalar txx = tx*this->x();
551 const Scalar txy = ty*this->x();
552 const Scalar txz = tz*this->x();
553 const Scalar tyy = ty*this->y();
554 const Scalar tyz = tz*this->y();
555 const Scalar tzz = tz*this->z();
556
557 res.coeffRef(0,0) = Scalar(1)-(tyy+tzz);
558 res.coeffRef(0,1) = txy-twz;
559 res.coeffRef(0,2) = txz+twy;
560 res.coeffRef(1,0) = txy+twz;
561 res.coeffRef(1,1) = Scalar(1)-(txx+tzz);
562 res.coeffRef(1,2) = tyz-twx;
563 res.coeffRef(2,0) = txz-twy;
564 res.coeffRef(2,1) = tyz+twx;
565 res.coeffRef(2,2) = Scalar(1)-(txx+tyy);
566
567 return res;
568}
Matrix< Scalar, 3, 3 > Matrix3
Definition Quaternion.h:59

◆ vec() [1/2]

EIGEN_DEVICE_FUNC VectorBlock< Coefficients, 3 > Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::vec ( )
inlineinherited
Returns
a vector expression of the imaginary part (x,y,z)
87{ return coeffs().template head<3>(); }

◆ vec() [2/2]

EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::vec ( ) const
inlineinherited
Returns
a read-only vector expression of the imaginary part (x,y,z)
84{ return coeffs().template head<3>(); }

◆ w() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::w ( )
inlineinherited
Returns
a reference to the w coefficient (if Derived is a non-const lvalue)
81{ return this->derived().coeffs().w(); }

◆ w() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::w ( ) const
inlineinherited
Returns
the w coefficient
72{ return this->derived().coeffs().coeff(3); }

◆ x() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::x ( )
inlineinherited
Returns
a reference to the x coefficient (if Derived is a non-const lvalue)
75{ return this->derived().coeffs().x(); }

◆ x() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::x ( ) const
inlineinherited
Returns
the x coefficient
66{ return this->derived().coeffs().coeff(0); }

◆ y() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::y ( )
inlineinherited
Returns
a reference to the y coefficient (if Derived is a non-const lvalue)
77{ return this->derived().coeffs().y(); }

◆ y() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::y ( ) const
inlineinherited
Returns
the y coefficient
68{ return this->derived().coeffs().coeff(1); }

◆ z() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::z ( )
inlineinherited
Returns
a reference to the z coefficient (if Derived is a non-const lvalue)
79{ return this->derived().coeffs().z(); }

◆ z() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Map< const Quaternion< _Scalar >, _Options > >::z ( ) const
inlineinherited
Returns
the z coefficient
70{ return this->derived().coeffs().coeff(2); }

Member Data Documentation

◆ m_coeffs

template<typename _Scalar , int _Options>
const Coefficients Eigen::Map< const Quaternion< _Scalar >, _Options >::m_coeffs
protected

◆ Eigen::Map< Quaternion< _Scalar >, _Options >

class Eigen::Map< Quaternion< _Scalar >, _Options >
template<typename _Scalar, int _Options>
class Eigen::Map< Quaternion< _Scalar >, _Options >

Expression of a quaternion from a memory buffer.

Template Parameters
_Scalarthe type of the Quaternion coefficients
_Optionssee class Map

This is a specialization of class Map for Quaternion. This class allows to view a 4 scalar memory buffer as an Eigen's Quaternion object.

See also
class Map, class Quaternion, class QuaternionBase
+ Inheritance diagram for Eigen::Map< Quaternion< _Scalar >, _Options >:
+ Collaboration diagram for Eigen::Map< Quaternion< _Scalar >, _Options >:

Public Types

typedef QuaternionBase< Map< Quaternion< _Scalar >, _Options > > Base
 
typedef _Scalar Scalar
 
typedef internal::traits< Map >::Coefficients Coefficients
 
enum  
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef Coefficients::CoeffReturnType CoeffReturnType
 
typedef internal::conditional< bool(internal::traits< Map< Quaternion< _Scalar >, _Options > >::Flags &LvalueBit), Scalar &, CoeffReturnType >::type NonConstCoeffReturnType
 
typedef Matrix< Scalar, 3, 1 > Vector3
 
typedef Matrix< Scalar, 3, 3 > Matrix3
 
typedef AngleAxis< ScalarAngleAxisType
 
enum  { Dim = _Dim }
 
typedef Matrix< Scalar, Dim, DimRotationMatrixType
 
typedef Matrix< Scalar, Dim, 1 > VectorType
 

Public Member Functions

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Map (Scalar *coeffs)
 
EIGEN_DEVICE_FUNC Coefficientscoeffs ()
 
EIGEN_DEVICE_FUNC const Coefficientscoeffs () const
 
EIGEN_DEVICE_FUNC CoeffReturnType x () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType x ()
 
EIGEN_DEVICE_FUNC CoeffReturnType y () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType y ()
 
EIGEN_DEVICE_FUNC CoeffReturnType z () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType z ()
 
EIGEN_DEVICE_FUNC CoeffReturnType w () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType w ()
 
EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > vec () const
 
EIGEN_DEVICE_FUNC VectorBlock< Coefficients, 3 > vec ()
 
EIGEN_DEVICE_FUNC QuaternionBasesetIdentity ()
 
EIGEN_DEVICE_FUNC Scalar squaredNorm () const
 
EIGEN_DEVICE_FUNC Scalar norm () const
 
EIGEN_DEVICE_FUNC void normalize ()
 
EIGEN_DEVICE_FUNC Quaternion< Scalarnormalized () const
 
EIGEN_DEVICE_FUNC Scalar dot (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC internal::traits< Map< Quaternion< _Scalar >, _Options > >::Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Matrix3 toRotationMatrix () const
 
EIGEN_DEVICE_FUNC Map< Quaternion< _Scalar >, _Options > & setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< Scalaroperator* (const QuaternionBase< OtherDerived > &q) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Map< Quaternion< _Scalar >, _Options > >::Scalaroperator* (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometryoperator* (const Translation< Scalar, Dim > &t) const
 
EIGEN_DEVICE_FUNC RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator* (const EigenBase< OtherDerived > &e) const
 
template<int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Map< Quaternion< _Scalar >, _Options > & operator*= (const QuaternionBase< OtherDerived > &q)
 
EIGEN_DEVICE_FUNC Quaternion< Scalarinverse () const
 
EIGEN_DEVICE_FUNC Quaternion< Scalarconjugate () const
 
EIGEN_DEVICE_FUNC Quaternion< Scalarslerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Map< Quaternion< _Scalar >, _Options > >::Scalarslerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC bool isApprox (const QuaternionBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Vector3 _transformVector (const Vector3 &v) const
 
template<typename OtherVectorType >
EIGEN_DEVICE_FUNC VectorType _transformVector (const OtherVectorType &v) const
 
EIGEN_DEVICE_FUNC internal::cast_return_type< Map< Quaternion< _Scalar >, _Options >, Quaternion< NewScalarType > >::type cast () const
 
EIGEN_DEVICE_FUNC const Derived & derived () const
 
EIGEN_DEVICE_FUNC Derived & derived ()
 
EIGEN_DEVICE_FUNC RotationMatrixType matrix () const
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC Quaternion< ScalarIdentity ()
 

Protected Attributes

Coefficients m_coeffs
 

Member Typedef Documentation

◆ AngleAxisType

typedef AngleAxis<Scalar> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::AngleAxisType
inherited

the equivalent angle-axis type

◆ Base

template<typename _Scalar , int _Options>
typedef QuaternionBase<Map<Quaternion<_Scalar>, _Options> > Eigen::Map< Quaternion< _Scalar >, _Options >::Base

◆ Coefficients

template<typename _Scalar , int _Options>
typedef internal::traits<Map>::Coefficients Eigen::Map< Quaternion< _Scalar >, _Options >::Coefficients

◆ CoeffReturnType

typedef Coefficients::CoeffReturnType Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::CoeffReturnType
inherited

◆ Matrix3

typedef Matrix<Scalar,3,3> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::Matrix3
inherited

the equivalent rotation matrix type

◆ NonConstCoeffReturnType

typedef internal::conditional<bool(internal::traits<Map< Quaternion< _Scalar >, _Options > >::Flags&LvalueBit),Scalar&,CoeffReturnType>::type Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::NonConstCoeffReturnType
inherited

◆ RealScalar

typedef NumTraits<Scalar>::Real Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::RealScalar
inherited

◆ RotationMatrixType

template<typename Derived , int _Dim>
typedef Matrix<Scalar,Dim,Dim> Eigen::RotationBase< Derived, _Dim >::RotationMatrixType
inherited

corresponding linear transformation matrix type

◆ Scalar

template<typename _Scalar , int _Options>
typedef _Scalar Eigen::Map< Quaternion< _Scalar >, _Options >::Scalar

◆ Vector3

typedef Matrix<Scalar,3,1> Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::Vector3
inherited

the type of a 3D vector

◆ VectorType

template<typename Derived , int _Dim>
typedef Matrix<Scalar,Dim,1> Eigen::RotationBase< Derived, _Dim >::VectorType
inherited

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived , int _Dim>
anonymous enum
inherited
Enumerator
Dim 
32{ Dim = _Dim };

◆ anonymous enum

anonymous enum
inherited

Constructor & Destructor Documentation

◆ Map()

template<typename _Scalar , int _Options>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Map< Quaternion< _Scalar >, _Options >::Map ( Scalar coeffs)
inlineexplicit

Constructs a Mapped Quaternion object from the pointer coeffs

The pointer coeffs must reference the four coefficients of Quaternion in the following order:

*coeffs == {x, y, z, w}
EIGEN_DEVICE_FUNC Coefficients & coeffs()
Definition Quaternion.h:404

If the template parameter _Options is set to Aligned, then the pointer coeffs must be aligned.

402: m_coeffs(coeffs) {}
Coefficients m_coeffs
Definition Quaternion.h:408

Member Function Documentation

◆ _transformVector() [1/2]

template<typename Derived , int _Dim>
template<typename OtherVectorType >
EIGEN_DEVICE_FUNC VectorType Eigen::RotationBase< Derived, _Dim >::_transformVector ( const OtherVectorType &  v) const
inlineinherited
94 { return toRotationMatrix() * v; }

References Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

◆ _transformVector() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::Vector3 Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::_transformVector ( const Vector3 v) const
inherited

return the result vector of v through the rotation

Rotation of a vector by a quaternion.

Remarks
If the quaternion is used to rotate several points (>1) then it is much more efficient to first convert it to a 3x3 Matrix. Comparison of the operation cost for n transformations:
  • Quaternion2: 30n
  • Via a Matrix3: 24 + 15n
476{
477 // Note that this algorithm comes from the optimization by hand
478 // of the conversion to a Matrix followed by a Matrix/Vector product.
479 // It appears to be much faster than the common algorithm found
480 // in the literature (30 versus 39 flops). It also requires two
481 // Vector3 as temporaries.
482 Vector3 uv = this->vec().cross(v);
483 uv += uv;
484 return v + this->w() * uv + this->vec().cross(uv);
485}

◆ angularDistance() [1/2]

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::angularDistance ( const QuaternionBase< OtherDerived > &  other) const
inherited

◆ angularDistance() [2/2]

EIGEN_DEVICE_FUNC internal::traits< Map< Quaternion< _Scalar >, _Options > >::Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::angularDistance ( const QuaternionBase< OtherDerived > &  other) const
inlineinherited
Returns
the angle (in radian) between two rotations
See also
dot()
709{
710 EIGEN_USING_STD_MATH(atan2)
711 Quaternion<Scalar> d = (*this) * other.conjugate();
712 return Scalar(2) * atan2( d.vec().norm(), numext::abs(d.w()) );
713}

◆ cast()

EIGEN_DEVICE_FUNC internal::cast_return_type< Map< Quaternion< _Scalar >, _Options > , Quaternion< NewScalarType > >::type Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::cast ( ) const
inlineinherited
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

179 {
180 return typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type(derived());
181 }

◆ coeffs() [1/2]

template<typename _Scalar , int _Options>
EIGEN_DEVICE_FUNC Coefficients & Eigen::Map< Quaternion< _Scalar >, _Options >::coeffs ( )
inline
404{ return m_coeffs; }

◆ coeffs() [2/2]

template<typename _Scalar , int _Options>
EIGEN_DEVICE_FUNC const Coefficients & Eigen::Map< Quaternion< _Scalar >, _Options >::coeffs ( ) const
inline
405{ return m_coeffs; }

◆ conjugate()

EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Map< Quaternion< _Scalar >, _Options > >::Scalar > Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::conjugate
inlineinherited
Returns
the conjugated quaternion
the conjugate of the *this which is equal to the multiplicative inverse if the quaternion is normalized. The conjugate of a quaternion represents the opposite rotation.
See also
Quaternion2::inverse()
696{
697 return internal::quat_conj<Architecture::Target, Derived,
698 typename internal::traits<Derived>::Scalar>::run(*this);
699
700}

◆ derived() [1/2]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC Derived & Eigen::RotationBase< Derived, _Dim >::derived ( )
inlineinherited
42{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC const Derived & Eigen::RotationBase< Derived, _Dim >::derived ( ) const
inlineinherited
41{ return *static_cast<const Derived*>(this); }

Referenced by Eigen::RotationBase< Derived, _Dim >::inverse(), Eigen::RotationBase< Derived, _Dim >::matrix(), Eigen::RotationBase< Derived, _Dim >::operator*(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*(), Eigen::QuaternionBase< Derived >::operator*=(), and Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the caller graph for this function:

◆ dot()

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::dot ( const QuaternionBase< OtherDerived > &  other) const
inlineinherited
Returns
the dot product of *this and other Geometrically speaking, the dot product of two unit quaternions corresponds to the cosine of half the angle between the two rotations.
See also
angularDistance()
139{ return coeffs().dot(other.coeffs()); }

◆ Identity()

static EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::Identity ( )
inlinestaticinherited
Returns
a quaternion representing an identity rotation
See also
MatrixBase::Identity()
111{ return Quaternion<Scalar>(Scalar(1), Scalar(0), Scalar(0), Scalar(0)); }

◆ inverse()

EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Map< Quaternion< _Scalar >, _Options > >::Scalar > Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::inverse
inlineinherited
Returns
the quaternion describing the inverse rotation
the multiplicative inverse of *this Note that in most cases, i.e., if you simply want the opposite rotation, and/or the quaternion is normalized, then it is enough to use the conjugate.
See also
QuaternionBase::conjugate()
665{
666 // FIXME should this function be called multiplicativeInverse and conjugate() be called inverse() or opposite() ??
667 Scalar n2 = this->squaredNorm();
668 if (n2 > Scalar(0))
669 return Quaternion<Scalar>(conjugate().coeffs() / n2);
670 else
671 {
672 // return an invalid result to flag the error
673 return Quaternion<Scalar>(Coefficients::Zero());
674 }
675}

◆ isApprox()

EIGEN_DEVICE_FUNC bool Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::isApprox ( const QuaternionBase< OtherDerived > &  other,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
inlineinherited
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()
167 { return coeffs().isApprox(other.coeffs(), prec); }

◆ matrix()

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< Derived, _Dim >::matrix ( ) const
inlineinherited
Returns
an equivalent rotation matrix This function is added to be conform with the Transform class' naming scheme.
50{ return derived().toRotationMatrix(); }

References Eigen::RotationBase< Derived, _Dim >::derived().

Referenced by Slic3r::Emboss::create_transformation_onto_surface(), and igl::snap_to_fixed_up().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ norm()

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::norm ( ) const
inlineinherited
Returns
the norm of the quaternion's coefficients
See also
QuaternionBase::squaredNorm(), MatrixBase::norm()
125{ return coeffs().norm(); }

◆ normalize()

EIGEN_DEVICE_FUNC void Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::normalize ( )
inlineinherited

Normalizes the quaternion *this

See also
normalized(), MatrixBase::normalize()
129{ coeffs().normalize(); }

◆ normalized()

EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::normalized ( ) const
inlineinherited
Returns
a normalized copy of *this
See also
normalize(), MatrixBase::normalized()
132{ return Quaternion<Scalar>(coeffs().normalized()); }

◆ operator*() [1/6]

template<typename Derived , int _Dim>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType Eigen::RotationBase< Derived, _Dim >::operator* ( const EigenBase< OtherDerived > &  e) const
inlineinherited
Returns
the concatenation of the rotation *this with a generic expression e e can be:
  • a DimxDim linear transformation matrix
  • a DimxDim diagonal matrix (axis aligned scaling)
  • a vector of size Dim
72 { return internal::rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); }

References Eigen::EigenBase< Derived >::derived(), and Eigen::RotationBase< Derived, _Dim >::derived().

+ Here is the call graph for this function:

◆ operator*() [2/6]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Map< Quaternion< _Scalar >, _Options > >::Scalar > Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::operator* ( const QuaternionBase< OtherDerived > &  other) const
inherited
Returns
the concatenation of two rotations as a quaternion-quaternion product
450{
451 EIGEN_STATIC_ASSERT((internal::is_same<typename Derived::Scalar, typename OtherDerived::Scalar>::value),
452 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
453 return internal::quat_product<Architecture::Target, Derived, OtherDerived,
454 typename internal::traits<Derived>::Scalar>::run(*this, other);
455}

◆ operator*() [3/6]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< Scalar > Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::operator* ( const QuaternionBase< OtherDerived > &  q) const
inherited

◆ operator*() [4/6]

template<typename Derived , int _Dim>
template<int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > Eigen::RotationBase< Derived, _Dim >::operator* ( const Transform< Scalar, Dim, Mode, Options > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a transformation t
90 { return toRotationMatrix() * t; }

References Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

◆ operator*() [5/6]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometry > Eigen::RotationBase< Derived, _Dim >::operator* ( const Translation< Scalar, Dim > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a translation t
57 { return Transform<Scalar,Dim,Isometry>(*this) * t; }

◆ operator*() [6/6]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< Derived, _Dim >::operator* ( const UniformScaling< Scalar > &  s) const
inlineinherited
Returns
the concatenation of the rotation *this with a uniform scaling s
61 { return toRotationMatrix() * s.factor(); }

References Eigen::UniformScaling< _Scalar >::factor(), and Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

◆ operator*=()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Map< Quaternion< _Scalar >, _Options > & Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::operator*= ( const QuaternionBase< OtherDerived > &  other)
inherited
See also
operator*(Quaternion)
461{
462 derived() = derived() * other.derived();
463 return derived();
464}

◆ setFromTwoVectors()

EIGEN_DEVICE_FUNC Map< Quaternion< _Scalar >, _Options > & Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::setFromTwoVectors ( const MatrixBase< Derived1 > &  a,
const MatrixBase< Derived2 > &  b 
)
inlineinherited
Returns
the quaternion which transform a into b through a rotation

Sets *this to be a quaternion representing a rotation between the two arbitrary vectors a and b. In other words, the built rotation represent a rotation sending the line of direction a to the line of direction b, both lines passing through the origin.

Returns
a reference to *this.

Note that the two input vectors do not have to be normalized, and do not need to have the same norm.

583{
584 EIGEN_USING_STD_MATH(sqrt)
585 Vector3 v0 = a.normalized();
586 Vector3 v1 = b.normalized();
587 Scalar c = v1.dot(v0);
588
589 // if dot == -1, vectors are nearly opposites
590 // => accurately compute the rotation axis by computing the
591 // intersection of the two planes. This is done by solving:
592 // x^T v0 = 0
593 // x^T v1 = 0
594 // under the constraint:
595 // ||x|| = 1
596 // which yields a singular value problem
597 if (c < Scalar(-1)+NumTraits<Scalar>::dummy_precision())
598 {
599 c = numext::maxi(c,Scalar(-1));
600 Matrix<Scalar,2,3> m; m << v0.transpose(), v1.transpose();
601 JacobiSVD<Matrix<Scalar,2,3> > svd(m, ComputeFullV);
602 Vector3 axis = svd.matrixV().col(2);
603
604 Scalar w2 = (Scalar(1)+c)*Scalar(0.5);
605 this->w() = sqrt(w2);
606 this->vec() = axis * sqrt(Scalar(1) - w2);
607 return derived();
608 }
609 Vector3 axis = v0.cross(v1);
610 Scalar s = sqrt((Scalar(1)+c)*Scalar(2));
611 Scalar invs = Scalar(1)/s;
612 this->vec() = axis * invs;
613 this->w() = s * Scalar(0.5);
614
615 return derived();
616}

◆ setIdentity()

EIGEN_DEVICE_FUNC QuaternionBase & Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::setIdentity ( )
inlineinherited
See also
QuaternionBase::Identity(), MatrixBase::setIdentity()
115{ coeffs() << Scalar(0), Scalar(0), Scalar(0), Scalar(1); return *this; }

◆ slerp() [1/2]

EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::slerp ( const Scalar t,
const QuaternionBase< OtherDerived > &  other 
) const
inherited

◆ slerp() [2/2]

EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Map< Quaternion< _Scalar >, _Options > >::Scalar > Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::slerp ( const Scalar t,
const QuaternionBase< OtherDerived > &  other 
) const
inherited
Returns
the spherical linear interpolation between the two quaternions *this and other at the parameter t in [0;1].

This represents an interpolation for a constant motion between *this and other, see also http://en.wikipedia.org/wiki/Slerp.

727{
728 EIGEN_USING_STD_MATH(acos)
729 EIGEN_USING_STD_MATH(sin)
730 const Scalar one = Scalar(1) - NumTraits<Scalar>::epsilon();
731 Scalar d = this->dot(other);
732 Scalar absD = numext::abs(d);
733
734 Scalar scale0;
735 Scalar scale1;
736
737 if(absD>=one)
738 {
739 scale0 = Scalar(1) - t;
740 scale1 = t;
741 }
742 else
743 {
744 // theta is the angle between the 2 quaternions
745 Scalar theta = acos(absD);
746 Scalar sinTheta = sin(theta);
747
748 scale0 = sin( ( Scalar(1) - t ) * theta) / sinTheta;
749 scale1 = sin( ( t * theta) ) / sinTheta;
750 }
751 if(d<Scalar(0)) scale1 = -scale1;
752
753 return Quaternion<Scalar>(scale0 * coeffs() + scale1 * other.coeffs());
754}

◆ squaredNorm()

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::squaredNorm ( ) const
inlineinherited
Returns
the squared norm of the quaternion's coefficients
See also
QuaternionBase::norm(), MatrixBase::squaredNorm()
120{ return coeffs().squaredNorm(); }

◆ toRotationMatrix()

EIGEN_DEVICE_FUNC QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::Matrix3 Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::toRotationMatrix ( void  ) const
inlineinherited
Returns
an equivalent 3x3 rotation matrix

Convert the quaternion to a 3x3 rotation matrix. The quaternion is required to be normalized, otherwise the result is undefined.

537{
538 // NOTE if inlined, then gcc 4.2 and 4.4 get rid of the temporary (not gcc 4.3 !!)
539 // if not inlined then the cost of the return by value is huge ~ +35%,
540 // however, not inlining this function is an order of magnitude slower, so
541 // it has to be inlined, and so the return by value is not an issue
542 Matrix3 res;
543
544 const Scalar tx = Scalar(2)*this->x();
545 const Scalar ty = Scalar(2)*this->y();
546 const Scalar tz = Scalar(2)*this->z();
547 const Scalar twx = tx*this->w();
548 const Scalar twy = ty*this->w();
549 const Scalar twz = tz*this->w();
550 const Scalar txx = tx*this->x();
551 const Scalar txy = ty*this->x();
552 const Scalar txz = tz*this->x();
553 const Scalar tyy = ty*this->y();
554 const Scalar tyz = tz*this->y();
555 const Scalar tzz = tz*this->z();
556
557 res.coeffRef(0,0) = Scalar(1)-(tyy+tzz);
558 res.coeffRef(0,1) = txy-twz;
559 res.coeffRef(0,2) = txz+twy;
560 res.coeffRef(1,0) = txy+twz;
561 res.coeffRef(1,1) = Scalar(1)-(txx+tzz);
562 res.coeffRef(1,2) = tyz-twx;
563 res.coeffRef(2,0) = txz-twy;
564 res.coeffRef(2,1) = tyz+twx;
565 res.coeffRef(2,2) = Scalar(1)-(txx+tyy);
566
567 return res;
568}

◆ vec() [1/2]

EIGEN_DEVICE_FUNC VectorBlock< Coefficients, 3 > Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::vec ( )
inlineinherited
Returns
a vector expression of the imaginary part (x,y,z)
87{ return coeffs().template head<3>(); }

◆ vec() [2/2]

EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::vec ( ) const
inlineinherited
Returns
a read-only vector expression of the imaginary part (x,y,z)
84{ return coeffs().template head<3>(); }

◆ w() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::w ( )
inlineinherited
Returns
a reference to the w coefficient (if Derived is a non-const lvalue)
81{ return this->derived().coeffs().w(); }

◆ w() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::w ( ) const
inlineinherited
Returns
the w coefficient
72{ return this->derived().coeffs().coeff(3); }

◆ x() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::x ( )
inlineinherited
Returns
a reference to the x coefficient (if Derived is a non-const lvalue)
75{ return this->derived().coeffs().x(); }

◆ x() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::x ( ) const
inlineinherited
Returns
the x coefficient
66{ return this->derived().coeffs().coeff(0); }

◆ y() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::y ( )
inlineinherited
Returns
a reference to the y coefficient (if Derived is a non-const lvalue)
77{ return this->derived().coeffs().y(); }

◆ y() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::y ( ) const
inlineinherited
Returns
the y coefficient
68{ return this->derived().coeffs().coeff(1); }

◆ z() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::z ( )
inlineinherited
Returns
a reference to the z coefficient (if Derived is a non-const lvalue)
79{ return this->derived().coeffs().z(); }

◆ z() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Map< Quaternion< _Scalar >, _Options > >::z ( ) const
inlineinherited
Returns
the z coefficient
70{ return this->derived().coeffs().coeff(2); }

Member Data Documentation

◆ m_coeffs

template<typename _Scalar , int _Options>
Coefficients Eigen::Map< Quaternion< _Scalar >, _Options >::m_coeffs
protected

◆ Eigen::AlignedBox

class Eigen::AlignedBox
template<typename _Scalar, int _AmbientDim>
class Eigen::AlignedBox< _Scalar, _AmbientDim >

An axis aligned box.

\geometry_module

Template Parameters
_Scalarthe type of the scalar coefficients
_AmbientDimthe dimension of the ambient space, can be a compile time value or Dynamic.

This class represents an axis aligned box as a pair of the minimal and maximal corners.

Warning
The result of most methods is undefined when applied to an empty box. You can check for empty boxes using isEmpty().
See also
Global aligned box typedefs
+ Inheritance diagram for Eigen::AlignedBox< _Scalar, _AmbientDim >:
+ Collaboration diagram for Eigen::AlignedBox< _Scalar, _AmbientDim >:

Public Types

enum  { AmbientDimAtCompileTime = _AmbientDim }
 
enum  CornerType {
  Min =0 , Max =1 , BottomLeft =0 , BottomRight =1 ,
  TopLeft =2 , TopRight =3 , BottomLeftFloor =0 , BottomRightFloor =1 ,
  TopLeftFloor =2 , TopRightFloor =3 , BottomLeftCeil =4 , BottomRightCeil =5 ,
  TopLeftCeil =6 , TopRightCeil =7
}
 
typedef _Scalar Scalar
 
typedef NumTraits< ScalarScalarTraits
 
typedef Eigen::Index Index
 
typedef ScalarTraits::Real RealScalar
 
typedef ScalarTraits::NonInteger NonInteger
 
typedef Matrix< Scalar, AmbientDimAtCompileTime, 1 > VectorType
 
typedef CwiseBinaryOp< internal::scalar_sum_op< Scalar >, const VectorType, const VectorTypeVectorTypeSum
 

Public Member Functions

EIGEN_DEVICE_FUNC AlignedBox ()
 
EIGEN_DEVICE_FUNC AlignedBox (Index _dim)
 
template<typename OtherVectorType1 , typename OtherVectorType2 >
EIGEN_DEVICE_FUNC AlignedBox (const OtherVectorType1 &_min, const OtherVectorType2 &_max)
 
template<typename Derived >
EIGEN_DEVICE_FUNC AlignedBox (const MatrixBase< Derived > &p)
 
EIGEN_DEVICE_FUNC ~AlignedBox ()
 
EIGEN_DEVICE_FUNC Index dim () const
 
EIGEN_DEVICE_FUNC bool isNull () const
 
EIGEN_DEVICE_FUNC void setNull ()
 
EIGEN_DEVICE_FUNC bool isEmpty () const
 
EIGEN_DEVICE_FUNC void setEmpty ()
 
EIGEN_DEVICE_FUNC const VectorType &() min () const
 
EIGEN_DEVICE_FUNC VectorType &() min ()
 
EIGEN_DEVICE_FUNC const VectorType &() max () const
 
EIGEN_DEVICE_FUNC VectorType &() max ()
 
EIGEN_DEVICE_FUNC const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE (VectorTypeSum, RealScalar, quotient) center() const
 
EIGEN_DEVICE_FUNC const CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorTypesizes () const
 
EIGEN_DEVICE_FUNC Scalar volume () const
 
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorTypediagonal () const
 
EIGEN_DEVICE_FUNC VectorType corner (CornerType corner) const
 
EIGEN_DEVICE_FUNC VectorType sample () const
 
template<typename Derived >
EIGEN_DEVICE_FUNC bool contains (const MatrixBase< Derived > &p) const
 
EIGEN_DEVICE_FUNC bool contains (const AlignedBox &b) const
 
EIGEN_DEVICE_FUNC bool intersects (const AlignedBox &b) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC AlignedBoxextend (const MatrixBase< Derived > &p)
 
EIGEN_DEVICE_FUNC AlignedBoxextend (const AlignedBox &b)
 
EIGEN_DEVICE_FUNC AlignedBoxclamp (const AlignedBox &b)
 
EIGEN_DEVICE_FUNC AlignedBox intersection (const AlignedBox &b) const
 
EIGEN_DEVICE_FUNC AlignedBox merged (const AlignedBox &b) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC AlignedBoxtranslate (const MatrixBase< Derived > &a_t)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Scalar squaredExteriorDistance (const MatrixBase< Derived > &p) const
 
EIGEN_DEVICE_FUNC Scalar squaredExteriorDistance (const AlignedBox &b) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC NonInteger exteriorDistance (const MatrixBase< Derived > &p) const
 
EIGEN_DEVICE_FUNC NonInteger exteriorDistance (const AlignedBox &b) const
 
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< AlignedBox, AlignedBox< NewScalarType, AmbientDimAtCompileTime > >::type cast () const
 
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC AlignedBox (const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &other)
 
EIGEN_DEVICE_FUNC bool isApprox (const AlignedBox &other, const RealScalar &prec=ScalarTraits::dummy_precision()) const
 

Protected Attributes

VectorType m_min
 
VectorType m_max
 

Member Typedef Documentation

◆ Index

template<typename _Scalar , int _AmbientDim>
typedef Eigen::Index Eigen::AlignedBox< _Scalar, _AmbientDim >::Index

◆ NonInteger

template<typename _Scalar , int _AmbientDim>
typedef ScalarTraits::NonInteger Eigen::AlignedBox< _Scalar, _AmbientDim >::NonInteger

◆ RealScalar

template<typename _Scalar , int _AmbientDim>
typedef ScalarTraits::Real Eigen::AlignedBox< _Scalar, _AmbientDim >::RealScalar

◆ Scalar

template<typename _Scalar , int _AmbientDim>
typedef _Scalar Eigen::AlignedBox< _Scalar, _AmbientDim >::Scalar

◆ ScalarTraits

template<typename _Scalar , int _AmbientDim>
typedef NumTraits<Scalar> Eigen::AlignedBox< _Scalar, _AmbientDim >::ScalarTraits

◆ VectorType

template<typename _Scalar , int _AmbientDim>
typedef Matrix<Scalar,AmbientDimAtCompileTime,1> Eigen::AlignedBox< _Scalar, _AmbientDim >::VectorType

◆ VectorTypeSum

template<typename _Scalar , int _AmbientDim>
typedef CwiseBinaryOp<internal::scalar_sum_op<Scalar>, const VectorType, const VectorType> Eigen::AlignedBox< _Scalar, _AmbientDim >::VectorTypeSum

Member Enumeration Documentation

◆ anonymous enum

template<typename _Scalar , int _AmbientDim>
anonymous enum
Enumerator
AmbientDimAtCompileTime 
34{ AmbientDimAtCompileTime = _AmbientDim };
@ AmbientDimAtCompileTime
Definition AlignedBox.h:34

◆ CornerType

template<typename _Scalar , int _AmbientDim>
enum Eigen::AlignedBox::CornerType

Define constants to name the corners of a 1D, 2D or 3D axis aligned bounding box

Enumerator
Min 

1D names

Max 
BottomLeft 

Identifier for 2D corner

BottomRight 
TopLeft 
TopRight 
BottomLeftFloor 

Identifier for 3D corner

BottomRightFloor 
TopLeftFloor 
TopRightFloor 
BottomLeftCeil 
BottomRightCeil 
TopLeftCeil 
TopRightCeil 
45 {
47 Min=0, Max=1,
52 TopLeft=2, TopRight=3,
61 };
@ TopLeftFloor
Definition AlignedBox.h:57
@ BottomLeft
Definition AlignedBox.h:51
@ BottomRightFloor
Definition AlignedBox.h:56
@ Min
Definition AlignedBox.h:47
@ BottomLeftCeil
Definition AlignedBox.h:58
@ BottomLeftFloor
Definition AlignedBox.h:56
@ TopLeft
Definition AlignedBox.h:52
@ Max
Definition AlignedBox.h:47
@ TopRightCeil
Definition AlignedBox.h:59
@ TopRightFloor
Definition AlignedBox.h:57
@ BottomRight
Definition AlignedBox.h:51
@ BottomRightCeil
Definition AlignedBox.h:58
@ TopLeftCeil
Definition AlignedBox.h:59
@ TopRight
Definition AlignedBox.h:52

Constructor & Destructor Documentation

◆ AlignedBox() [1/5]

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( )
inline

Default constructor initializing a null box.

EIGEN_DEVICE_FUNC void setEmpty()
Definition AlignedBox.h:99
const int Dynamic
Definition Constants.h:21

References Eigen::AlignedBox< _Scalar, _AmbientDim >::AmbientDimAtCompileTime, Eigen::Dynamic, and Eigen::AlignedBox< _Scalar, _AmbientDim >::setEmpty().

Referenced by Eigen::AlignedBox< _Scalar, _AmbientDim >::cast(), Eigen::AlignedBox< _Scalar, _AmbientDim >::intersection(), and Eigen::AlignedBox< _Scalar, _AmbientDim >::merged().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AlignedBox() [2/5]

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( Index  _dim)
inlineexplicit

Constructs a null box with _dim the dimension of the ambient space.

69 : m_min(_dim), m_max(_dim)
70 { setEmpty(); }
VectorType m_min
Definition AlignedBox.h:307
VectorType m_max
Definition AlignedBox.h:307

References Eigen::AlignedBox< _Scalar, _AmbientDim >::setEmpty().

+ Here is the call graph for this function:

◆ AlignedBox() [3/5]

template<typename _Scalar , int _AmbientDim>
template<typename OtherVectorType1 , typename OtherVectorType2 >
EIGEN_DEVICE_FUNC Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( const OtherVectorType1 &  _min,
const OtherVectorType2 &  _max 
)
inline

Constructs a box with extremities _min and _max.

Warning
If either component of _min is larger than the same component of _max, the constructed box is empty.
75: m_min(_min), m_max(_max) {}

◆ AlignedBox() [4/5]

template<typename _Scalar , int _AmbientDim>
template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( const MatrixBase< Derived > &  p)
inlineexplicit

Constructs a box containing a single point p.

79 : m_min(p), m_max(m_min)
80 { }

◆ ~AlignedBox()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC Eigen::AlignedBox< _Scalar, _AmbientDim >::~AlignedBox ( )
inline
82{}

◆ AlignedBox() [5/5]

template<typename _Scalar , int _AmbientDim>
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox ( const AlignedBox< OtherScalarType, AmbientDimAtCompileTime > &  other)
inlineexplicit

Copy constructor with scalar type conversion

293 {
294 m_min = (other.min)().template cast<Scalar>();
295 m_max = (other.max)().template cast<Scalar>();
296 }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min, Eigen::AlignedBox< _Scalar, _AmbientDim >::max(), and Eigen::AlignedBox< _Scalar, _AmbientDim >::min().

+ Here is the call graph for this function:

Member Function Documentation

◆ cast()

template<typename _Scalar , int _AmbientDim>
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< AlignedBox, AlignedBox< NewScalarType, AmbientDimAtCompileTime > >::type Eigen::AlignedBox< _Scalar, _AmbientDim >::cast ( ) const
inline
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

285 {
286 return typename internal::cast_return_type<AlignedBox,
287 AlignedBox<NewScalarType,AmbientDimAtCompileTime> >::type(*this);
288 }
EIGEN_DEVICE_FUNC AlignedBox()
Definition AlignedBox.h:65

References Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox().

+ Here is the call graph for this function:

◆ clamp()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC AlignedBox & Eigen::AlignedBox< _Scalar, _AmbientDim >::clamp ( const AlignedBox< _Scalar, _AmbientDim > &  b)
inline

Clamps *this by the box b and returns a reference to *this.

Note
If the boxes don't intersect, the resulting box is empty.
See also
intersection(), intersects()
221 {
222 m_min = m_min.cwiseMax(b.m_min);
223 m_max = m_max.cwiseMin(b.m_max);
224 return *this;
225 }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

◆ contains() [1/2]

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC bool Eigen::AlignedBox< _Scalar, _AmbientDim >::contains ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline
Returns
true if the box b is entirely inside the box *this.
190 { return (m_min.array()<=(b.min)().array()).all() && ((b.max)().array()<=m_max.array()).all(); }
IGL_INLINE void all(const Eigen::SparseMatrix< AType > &A, const int dim, Eigen::PlainObjectBase< DerivedB > &B)
Definition all.cpp:13

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

◆ contains() [2/2]

template<typename _Scalar , int _AmbientDim>
template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::AlignedBox< _Scalar, _AmbientDim >::contains ( const MatrixBase< Derived > &  p) const
inline
Returns
true if the point p is inside the box *this.
183 {
184 typename internal::nested_eval<Derived,2>::type p_n(p.derived());
185 return (m_min.array()<=p_n.array()).all() && (p_n.array()<=m_max.array()).all();
186 }
conditional< Evaluate, PlainObject, typenameref_selector< T >::type >::type type
Definition XprHelper.h:452

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

Referenced by Slic3r::AABBTreeIndirect::Within< Eigen::AlignedBox< CoordType, NumD > >::operator()().

+ Here is the caller graph for this function:

◆ corner()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC VectorType Eigen::AlignedBox< _Scalar, _AmbientDim >::corner ( CornerType  corner) const
inline
Returns
the vertex of the bounding box at the corner defined by the corner-id corner. It works only for a 1D, 2D or 3D bounding box. For 1D bounding boxes corners are named by 2 enum constants: BottomLeft and BottomRight. For 2D bounding boxes, corners are named by 4 enum constants: BottomLeft, BottomRight, TopLeft, TopRight. For 3D bounding boxes, the following names are added: BottomLeftCeil, BottomRightCeil, TopLeftCeil, TopRightCeil.
147 {
148 EIGEN_STATIC_ASSERT(_AmbientDim <= 3, THIS_METHOD_IS_ONLY_FOR_VECTORS_OF_A_SPECIFIC_SIZE);
149
150 VectorType res;
151
152 Index mult = 1;
153 for(Index d=0; d<dim(); ++d)
154 {
155 if( mult & corner ) res[d] = m_max[d];
156 else res[d] = m_min[d];
157 mult *= 2;
158 }
159 return res;
160 }
EIGEN_DEVICE_FUNC VectorType corner(CornerType corner) const
Definition AlignedBox.h:146
Eigen::Index Index
Definition AlignedBox.h:37
EIGEN_DEVICE_FUNC Index dim() const
Definition AlignedBox.h:85
Matrix< Scalar, AmbientDimAtCompileTime, 1 > VectorType
Definition AlignedBox.h:40

References Eigen::AlignedBox< _Scalar, _AmbientDim >::corner(), Eigen::AlignedBox< _Scalar, _AmbientDim >::dim(), EIGEN_STATIC_ASSERT, Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

Referenced by Eigen::AlignedBox< _Scalar, _AmbientDim >::corner().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ diagonal()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorType > Eigen::AlignedBox< _Scalar, _AmbientDim >::diagonal ( ) const
inline
Returns
an expression for the bounding box diagonal vector if the length of the diagonal is needed: diagonal().norm() will provide it.
135 { return sizes(); }
EIGEN_DEVICE_FUNC const CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorType > sizes() const
Definition AlignedBox.h:123

References Eigen::AlignedBox< _Scalar, _AmbientDim >::sizes().

Referenced by Slic3r::AABBTreeIndirect::Tree< ANumDimensions, ACoordType >::build_recursive(), igl::AABB< DerivedV, DIM >::squared_distance_helper(), and igl::voxel_grid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dim()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC Index Eigen::AlignedBox< _Scalar, _AmbientDim >::dim ( ) const
inline
Returns
the dimension in which the box holds

References Eigen::AlignedBox< _Scalar, _AmbientDim >::AmbientDimAtCompileTime, Eigen::Dynamic, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

Referenced by Eigen::AlignedBox< _Scalar, _AmbientDim >::corner(), and Eigen::AlignedBox< _Scalar, _AmbientDim >::sample().

+ Here is the caller graph for this function:

◆ EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC const Eigen::AlignedBox< _Scalar, _AmbientDim >::EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE ( VectorTypeSum  ,
RealScalar  ,
quotient   
) const
inline
Returns
the center of the box
117 { return (m_min+m_max)/RealScalar(2); }
ScalarTraits::Real RealScalar
Definition AlignedBox.h:38

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

◆ extend() [1/2]

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC AlignedBox & Eigen::AlignedBox< _Scalar, _AmbientDim >::extend ( const AlignedBox< _Scalar, _AmbientDim > &  b)
inline

Extends *this such that it contains the box b and returns a reference to *this.

See also
merged, extend(const MatrixBase&)
211 {
212 m_min = m_min.cwiseMin(b.m_min);
213 m_max = m_max.cwiseMax(b.m_max);
214 return *this;
215 }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

◆ extend() [2/2]

template<typename _Scalar , int _AmbientDim>
template<typename Derived >
EIGEN_DEVICE_FUNC AlignedBox & Eigen::AlignedBox< _Scalar, _AmbientDim >::extend ( const MatrixBase< Derived > &  p)
inline

Extends *this such that it contains the point p and returns a reference to *this.

See also
extend(const AlignedBox&)
201 {
202 typename internal::nested_eval<Derived,2>::type p_n(p.derived());
203 m_min = m_min.cwiseMin(p_n);
204 m_max = m_max.cwiseMax(p_n);
205 return *this;
206 }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

Referenced by Slic3r::AABBTreeIndirect::Tree< ANumDimensions, ACoordType >::build_recursive(), igl::copyleft::offset_surface(), igl::AABB< DerivedV, DIM >::squared_distance_helper(), Slic3r::TriangleMesh::transformed_bounding_box(), and Slic3r::transformed_its_bbox2d().

+ Here is the caller graph for this function:

◆ exteriorDistance() [1/2]

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC NonInteger Eigen::AlignedBox< _Scalar, _AmbientDim >::exteriorDistance ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline
Returns
the distance between the boxes b and *this, and zero if the boxes intersect.
See also
squaredExteriorDistance(const AlignedBox&), exteriorDistance(const MatrixBase&)
275 { EIGEN_USING_STD_MATH(sqrt) return sqrt(NonInteger(squaredExteriorDistance(b))); }
ScalarTraits::NonInteger NonInteger
Definition AlignedBox.h:39
EIGEN_DEVICE_FUNC Scalar squaredExteriorDistance(const MatrixBase< Derived > &p) const
Definition AlignedBox.h:314

References sqrt(), and Eigen::AlignedBox< _Scalar, _AmbientDim >::squaredExteriorDistance().

+ Here is the call graph for this function:

◆ exteriorDistance() [2/2]

template<typename _Scalar , int _AmbientDim>
template<typename Derived >
EIGEN_DEVICE_FUNC NonInteger Eigen::AlignedBox< _Scalar, _AmbientDim >::exteriorDistance ( const MatrixBase< Derived > &  p) const
inline
Returns
the distance between the point p and the box *this, and zero if p is inside the box.
See also
squaredExteriorDistance(const MatrixBase&), exteriorDistance(const AlignedBox&)
268 { EIGEN_USING_STD_MATH(sqrt) return sqrt(NonInteger(squaredExteriorDistance(p))); }

References sqrt(), and Eigen::AlignedBox< _Scalar, _AmbientDim >::squaredExteriorDistance().

+ Here is the call graph for this function:

◆ intersection()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC AlignedBox Eigen::AlignedBox< _Scalar, _AmbientDim >::intersection ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline

Returns an AlignedBox that is the intersection of b and *this

Note
If the boxes don't intersect, the resulting box is empty.
See also
intersects(), clamp, contains()
231 {return AlignedBox(m_min.cwiseMax(b.m_min), m_max.cwiseMin(b.m_max)); }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox(), Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

+ Here is the call graph for this function:

◆ intersects()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC bool Eigen::AlignedBox< _Scalar, _AmbientDim >::intersects ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline
Returns
true if the box b is intersecting the box *this.
See also
intersection, clamp
195 { return (m_min.array()<=(b.max)().array()).all() && ((b.min)().array()<=m_max.array()).all(); }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

Referenced by Slic3r::FFFTreeSupport::merge_influence_areas_two_elements(), Slic3r::AABBTreeIndirect::Intersecting< Eigen::AlignedBox< CoordType, NumD > >::operator()(), Slic3r::AABBTreeIndirect::Within< Eigen::AlignedBox< CoordType, NumD > >::operator()(), and Slic3r::verify_update_print_object_regions().

+ Here is the caller graph for this function:

◆ isApprox()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC bool Eigen::AlignedBox< _Scalar, _AmbientDim >::isApprox ( const AlignedBox< _Scalar, _AmbientDim > &  other,
const RealScalar prec = ScalarTraits::dummy_precision() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()
303 { return m_min.isApprox(other.m_min, prec) && m_max.isApprox(other.m_max, prec); }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

◆ isEmpty()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC bool Eigen::AlignedBox< _Scalar, _AmbientDim >::isEmpty ( ) const
inline
Returns
true if the box is empty.
See also
setEmpty
95{ return (m_min.array() > m_max.array()).any(); }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

Referenced by Eigen::AlignedBox< _Scalar, _AmbientDim >::isNull(), and Slic3r::TriangleMesh::transformed_bounding_box().

+ Here is the caller graph for this function:

◆ isNull()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC bool Eigen::AlignedBox< _Scalar, _AmbientDim >::isNull ( ) const
inline
88{ return isEmpty(); }
EIGEN_DEVICE_FUNC bool isEmpty() const
Definition AlignedBox.h:95

References Eigen::AlignedBox< _Scalar, _AmbientDim >::isEmpty().

+ Here is the call graph for this function:

◆ max() [1/2]

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC VectorType &() Eigen::AlignedBox< _Scalar, _AmbientDim >::max ( )
inline
Returns
a non const reference to the maximal corner
112{ return m_max; }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max.

◆ max() [2/2]

◆ merged()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC AlignedBox Eigen::AlignedBox< _Scalar, _AmbientDim >::merged ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline

Returns an AlignedBox that is the union of b and *this.

Note
Merging with an empty box may result in a box bigger than *this.
See also
extend(const AlignedBox&)
237 { return AlignedBox(m_min.cwiseMin(b.m_min), m_max.cwiseMax(b.m_max)); }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox(), Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

+ Here is the call graph for this function:

◆ min() [1/2]

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC VectorType &() Eigen::AlignedBox< _Scalar, _AmbientDim >::min ( )
inline
Returns
a non const reference to the minimal corner
108{ return m_min; }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

◆ min() [2/2]

◆ sample()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC VectorType Eigen::AlignedBox< _Scalar, _AmbientDim >::sample ( ) const
inline
Returns
a random point inside the bounding box sampled with a uniform distribution
165 {
166 VectorType r(dim());
167 for(Index d=0; d<dim(); ++d)
168 {
170 {
171 r[d] = m_min[d] + (m_max[d]-m_min[d])
172 * internal::random<Scalar>(Scalar(0), Scalar(1));
173 }
174 else
175 r[d] = internal::random(m_min[d], m_max[d]);
176 }
177 return r;
178 }
_Scalar Scalar
Definition AlignedBox.h:35
@ IsInteger
Definition NumTraits.h:91

References Eigen::AlignedBox< _Scalar, _AmbientDim >::dim(), Eigen::GenericNumTraits< T >::IsInteger, Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

+ Here is the call graph for this function:

◆ setEmpty()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC void Eigen::AlignedBox< _Scalar, _AmbientDim >::setEmpty ( )
inline

Makes *this an empty box.

See also
isEmpty
100 {
101 m_min.setConstant( ScalarTraits::highest() );
102 m_max.setConstant( ScalarTraits::lowest() );
103 }
EIGEN_DEVICE_FUNC Derived & setConstant(Index size, const Scalar &val)
Definition CwiseNullaryOp.h:341

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min, and Eigen::PlainObjectBase< Derived >::setConstant().

Referenced by Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox(), Eigen::AlignedBox< _Scalar, _AmbientDim >::AlignedBox(), and Eigen::AlignedBox< _Scalar, _AmbientDim >::setNull().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNull()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC void Eigen::AlignedBox< _Scalar, _AmbientDim >::setNull ( )
inline
91{ setEmpty(); }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::setEmpty().

+ Here is the call graph for this function:

◆ sizes()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC const CwiseBinaryOp< internal::scalar_difference_op< Scalar, Scalar >, const VectorType, const VectorType > Eigen::AlignedBox< _Scalar, _AmbientDim >::sizes ( ) const
inline
Returns
the lengths of the sides of the bounding box. Note that this function does not get the same result for integral or floating scalar types: see
124 { return m_max - m_min; }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

Referenced by Eigen::AlignedBox< _Scalar, _AmbientDim >::diagonal(), and Eigen::AlignedBox< _Scalar, _AmbientDim >::volume().

+ Here is the caller graph for this function:

◆ squaredExteriorDistance() [1/2]

template<typename Scalar , int AmbientDim>
EIGEN_DEVICE_FUNC Scalar Eigen::AlignedBox< Scalar, AmbientDim >::squaredExteriorDistance ( const AlignedBox< _Scalar, _AmbientDim > &  b) const
inline
Returns
the squared distance between the boxes b and *this, and zero if the boxes intersect.
See also
exteriorDistance(const AlignedBox&), squaredExteriorDistance(const MatrixBase&)
337{
338 Scalar dist2(0);
339 Scalar aux;
340 for (Index k=0; k<dim(); ++k)
341 {
342 if( m_min[k] > b.m_max[k] )
343 {
344 aux = m_min[k] - b.m_max[k];
345 dist2 += aux*aux;
346 }
347 else if( b.m_min[k] > m_max[k] )
348 {
349 aux = b.m_min[k] - m_max[k];
350 dist2 += aux*aux;
351 }
352 }
353 return dist2;
354}

◆ squaredExteriorDistance() [2/2]

template<typename Scalar , int AmbientDim>
template<typename Derived >
EIGEN_DEVICE_FUNC Scalar Eigen::AlignedBox< Scalar, AmbientDim >::squaredExteriorDistance ( const MatrixBase< Derived > &  p) const
inline
Returns
the squared distance between the point p and the box *this, and zero if p is inside the box.
See also
exteriorDistance(const MatrixBase&), squaredExteriorDistance(const AlignedBox&)
315{
317 Scalar dist2(0);
318 Scalar aux;
319 for (Index k=0; k<dim(); ++k)
320 {
321 if( m_min[k] > p[k] )
322 {
323 aux = m_min[k] - p[k];
324 dist2 += aux*aux;
325 }
326 else if( p[k] > m_max[k] )
327 {
328 aux = p[k] - m_max[k];
329 dist2 += aux*aux;
330 }
331 }
332 return dist2;
333}

Referenced by Eigen::AlignedBox< _Scalar, _AmbientDim >::exteriorDistance(), and Eigen::AlignedBox< _Scalar, _AmbientDim >::exteriorDistance().

+ Here is the caller graph for this function:

◆ translate()

template<typename _Scalar , int _AmbientDim>
template<typename Derived >
EIGEN_DEVICE_FUNC AlignedBox & Eigen::AlignedBox< _Scalar, _AmbientDim >::translate ( const MatrixBase< Derived > &  a_t)
inline

Translate *this by the vector t and returns a reference to *this.

242 {
243 const typename internal::nested_eval<Derived,2>::type t(a_t.derived());
244 m_min += t;
245 m_max += t;
246 return *this;
247 }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::m_max, and Eigen::AlignedBox< _Scalar, _AmbientDim >::m_min.

◆ volume()

template<typename _Scalar , int _AmbientDim>
EIGEN_DEVICE_FUNC Scalar Eigen::AlignedBox< _Scalar, _AmbientDim >::volume ( ) const
inline
Returns
the volume of the bounding box
128 { return sizes().prod(); }

References Eigen::AlignedBox< _Scalar, _AmbientDim >::sizes().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_max

◆ m_min

◆ Eigen::AngleAxis

class Eigen::AngleAxis
template<typename _Scalar>
class Eigen::AngleAxis< _Scalar >

Represents a 3D rotation as a rotation angle around an arbitrary 3D axis.

\geometry_module

Parameters
_Scalarthe scalar type, i.e., the type of the coefficients.
Warning
When setting up an AngleAxis object, the axis vector must be normalized.

The following two typedefs are provided for convenience:

  • AngleAxisf for float
  • AngleAxisd for double

Combined with MatrixBase::Unit{X,Y,Z}, AngleAxis can be used to easily mimic Euler-angles. Here is an example:

Output:

Note
This class is not aimed to be used to store a rotation transformation, but rather to make easier the creation of other rotation (Quaternion, rotation Matrix) and transformation objects.
See also
class Quaternion, class Transform, MatrixBase::UnitX()
+ Inheritance diagram for Eigen::AngleAxis< _Scalar >:
+ Collaboration diagram for Eigen::AngleAxis< _Scalar >:

Public Types

enum  { Dim = 3 }
 
typedef _Scalar Scalar
 
typedef Matrix< Scalar, 3, 3 > Matrix3
 
typedef Matrix< Scalar, 3, 1 > Vector3
 
typedef Quaternion< ScalarQuaternionType
 
enum  
 
typedef Matrix< Scalar, Dim, DimRotationMatrixType
 
typedef Matrix< Scalar, Dim, 1 > VectorType
 

Public Member Functions

EIGEN_DEVICE_FUNC AngleAxis ()
 
template<typename Derived >
EIGEN_DEVICE_FUNC AngleAxis (const Scalar &angle, const MatrixBase< Derived > &axis)
 
template<typename QuatDerived >
EIGEN_DEVICE_FUNC AngleAxis (const QuaternionBase< QuatDerived > &q)
 
template<typename Derived >
EIGEN_DEVICE_FUNC AngleAxis (const MatrixBase< Derived > &m)
 
EIGEN_DEVICE_FUNC Scalar angle () const
 
EIGEN_DEVICE_FUNC Scalarangle ()
 
EIGEN_DEVICE_FUNC const Vector3axis () const
 
EIGEN_DEVICE_FUNC Vector3axis ()
 
EIGEN_DEVICE_FUNC QuaternionType operator* (const AngleAxis &other) const
 
EIGEN_DEVICE_FUNC QuaternionType operator* (const QuaternionType &other) const
 
EIGEN_DEVICE_FUNC AngleAxis inverse () const
 
template<class QuatDerived >
EIGEN_DEVICE_FUNC AngleAxisoperator= (const QuaternionBase< QuatDerived > &q)
 
template<typename Derived >
EIGEN_DEVICE_FUNC AngleAxisoperator= (const MatrixBase< Derived > &m)
 
template<typename Derived >
EIGEN_DEVICE_FUNC AngleAxisfromRotationMatrix (const MatrixBase< Derived > &m)
 
EIGEN_DEVICE_FUNC Matrix3 toRotationMatrix (void) const
 
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< AngleAxis, AngleAxis< NewScalarType > >::type cast () const
 
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC AngleAxis (const AngleAxis< OtherScalarType > &other)
 
EIGEN_DEVICE_FUNC bool isApprox (const AngleAxis &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename QuatDerived >
EIGEN_DEVICE_FUNC AngleAxis< Scalar > & operator= (const QuaternionBase< QuatDerived > &q)
 
template<typename Derived >
EIGEN_DEVICE_FUNC AngleAxis< Scalar > & operator= (const MatrixBase< Derived > &mat)
 
template<typename Derived >
EIGEN_DEVICE_FUNC AngleAxis< Scalar > & fromRotationMatrix (const MatrixBase< Derived > &mat)
 Sets *this from a 3x3 rotation matrix.
 
EIGEN_DEVICE_FUNC const AngleAxis< _Scalar > & derived () const
 
EIGEN_DEVICE_FUNC AngleAxis< _Scalar > & derived ()
 
EIGEN_DEVICE_FUNC RotationMatrixType matrix () const
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometryoperator* (const Translation< Scalar, Dim > &t) const
 
EIGEN_DEVICE_FUNC RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< AngleAxis< _Scalar >, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator* (const EigenBase< OtherDerived > &e) const
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
 
EIGEN_DEVICE_FUNC VectorType _transformVector (const OtherVectorType &v) const
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC const AngleAxis Identity ()
 

Protected Attributes

Vector3 m_axis
 
Scalar m_angle
 

Private Types

typedef RotationBase< AngleAxis< _Scalar >, 3 > Base
 

Friends

EIGEN_DEVICE_FUNC QuaternionType operator* (const QuaternionType &a, const AngleAxis &b)
 

Member Typedef Documentation

◆ Base

template<typename _Scalar >
typedef RotationBase<AngleAxis<_Scalar>,3> Eigen::AngleAxis< _Scalar >::Base
private

◆ Matrix3

template<typename _Scalar >
typedef Matrix<Scalar,3,3> Eigen::AngleAxis< _Scalar >::Matrix3

◆ QuaternionType

template<typename _Scalar >
typedef Quaternion<Scalar> Eigen::AngleAxis< _Scalar >::QuaternionType

◆ RotationMatrixType

typedef Matrix<Scalar,Dim,Dim> Eigen::RotationBase< AngleAxis< _Scalar > , _Dim >::RotationMatrixType
inherited

corresponding linear transformation matrix type

◆ Scalar

template<typename _Scalar >
typedef _Scalar Eigen::AngleAxis< _Scalar >::Scalar

the scalar type of the coefficients

◆ Vector3

template<typename _Scalar >
typedef Matrix<Scalar,3,1> Eigen::AngleAxis< _Scalar >::Vector3

◆ VectorType

typedef Matrix<Scalar,Dim,1> Eigen::RotationBase< AngleAxis< _Scalar > , _Dim >::VectorType
inherited

Member Enumeration Documentation

◆ anonymous enum

template<typename _Scalar >
anonymous enum
Enumerator
Dim 
57{ Dim = 3 };
@ Dim
Definition AngleAxis.h:57

◆ anonymous enum

anonymous enum
inherited
32{ Dim = _Dim };

Constructor & Destructor Documentation

◆ AngleAxis() [1/5]

template<typename _Scalar >
EIGEN_DEVICE_FUNC Eigen::AngleAxis< _Scalar >::AngleAxis ( )
inline

Default constructor without initialization.

72{}

Referenced by Eigen::AngleAxis< _Scalar >::Identity(), and Eigen::AngleAxis< _Scalar >::inverse().

+ Here is the caller graph for this function:

◆ AngleAxis() [2/5]

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::AngleAxis< _Scalar >::AngleAxis ( const Scalar angle,
const MatrixBase< Derived > &  axis 
)
inline

Constructs and initialize the angle-axis rotation from an angle in radian and an axis which must be normalized.

Warning
If the axis vector is not normalized, then the angle-axis object represents an invalid rotation.
EIGEN_DEVICE_FUNC const Vector3 & axis() const
Definition AngleAxis.h:96
Vector3 m_axis
Definition AngleAxis.h:66
EIGEN_DEVICE_FUNC Scalar angle() const
Definition AngleAxis.h:91
Scalar m_angle
Definition AngleAxis.h:67

◆ AngleAxis() [3/5]

template<typename _Scalar >
template<typename QuatDerived >
EIGEN_DEVICE_FUNC Eigen::AngleAxis< _Scalar >::AngleAxis ( const QuaternionBase< QuatDerived > &  q)
inlineexplicit

Constructs and initialize the angle-axis rotation from a quaternion q. This function implicitly normalizes the quaternion q.

85{ *this = q; }

◆ AngleAxis() [4/5]

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::AngleAxis< _Scalar >::AngleAxis ( const MatrixBase< Derived > &  m)
inlineexplicit

Constructs and initialize the angle-axis rotation from a 3x3 rotation matrix.

88{ *this = m; }

◆ AngleAxis() [5/5]

template<typename _Scalar >
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Eigen::AngleAxis< _Scalar >::AngleAxis ( const AngleAxis< OtherScalarType > &  other)
inlineexplicit

Copy constructor with scalar type conversion

140 {
141 m_axis = other.axis().template cast<Scalar>();
142 m_angle = Scalar(other.angle());
143 }
_Scalar Scalar
Definition AngleAxis.h:59

References Eigen::AngleAxis< _Scalar >::angle(), Eigen::AngleAxis< _Scalar >::axis(), Eigen::AngleAxis< _Scalar >::m_angle, and Eigen::AngleAxis< _Scalar >::m_axis.

+ Here is the call graph for this function:

Member Function Documentation

◆ _transformVector()

EIGEN_DEVICE_FUNC VectorType Eigen::RotationBase< AngleAxis< _Scalar > , _Dim >::_transformVector ( const OtherVectorType &  v) const
inlineinherited
94 { return toRotationMatrix() * v; }

◆ angle() [1/2]

template<typename _Scalar >
EIGEN_DEVICE_FUNC Scalar & Eigen::AngleAxis< _Scalar >::angle ( )
inline
Returns
a read-write reference to the stored angle in radian
93{ return m_angle; }

References Eigen::AngleAxis< _Scalar >::m_angle.

◆ angle() [2/2]

template<typename _Scalar >
EIGEN_DEVICE_FUNC Scalar Eigen::AngleAxis< _Scalar >::angle ( ) const
inline
Returns
the value of the rotation angle in radian
91{ return m_angle; }

References Eigen::AngleAxis< _Scalar >::m_angle.

Referenced by Eigen::AngleAxis< _Scalar >::AngleAxis(), Slic3r::GUI::is_rotation_xy_synchronized(), and Eigen::QuaternionBase< Derived >::operator=().

+ Here is the caller graph for this function:

◆ axis() [1/2]

template<typename _Scalar >
EIGEN_DEVICE_FUNC Vector3 & Eigen::AngleAxis< _Scalar >::axis ( )
inline
Returns
a read-write reference to the stored rotation axis.
Warning
The rotation axis must remain a unit vector.
101{ return m_axis; }

References Eigen::AngleAxis< _Scalar >::m_axis.

◆ axis() [2/2]

template<typename _Scalar >
EIGEN_DEVICE_FUNC const Vector3 & Eigen::AngleAxis< _Scalar >::axis ( ) const
inline
Returns
the rotation axis
96{ return m_axis; }

References Eigen::AngleAxis< _Scalar >::m_axis.

Referenced by Eigen::AngleAxis< _Scalar >::AngleAxis(), Slic3r::GUI::is_rotation_xy_synchronized(), and Eigen::QuaternionBase< Derived >::operator=().

+ Here is the caller graph for this function:

◆ cast()

template<typename _Scalar >
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< AngleAxis, AngleAxis< NewScalarType > >::type Eigen::AngleAxis< _Scalar >::cast ( ) const
inline
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

135 { return typename internal::cast_return_type<AngleAxis,AngleAxis<NewScalarType> >::type(*this); }

◆ derived() [1/2]

EIGEN_DEVICE_FUNC AngleAxis< _Scalar > & Eigen::RotationBase< AngleAxis< _Scalar > , _Dim >::derived ( )
inlineinherited
42{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

EIGEN_DEVICE_FUNC const AngleAxis< _Scalar > & Eigen::RotationBase< AngleAxis< _Scalar > , _Dim >::derived ( ) const
inlineinherited
41{ return *static_cast<const Derived*>(this); }

◆ fromRotationMatrix() [1/2]

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC AngleAxis & Eigen::AngleAxis< _Scalar >::fromRotationMatrix ( const MatrixBase< Derived > &  m)

◆ fromRotationMatrix() [2/2]

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC AngleAxis< Scalar > & Eigen::AngleAxis< _Scalar >::fromRotationMatrix ( const MatrixBase< Derived > &  mat)

Sets *this from a 3x3 rotation matrix.

210{
211 return *this = QuaternionType(mat);
212}
Quaternion< Scalar > QuaternionType
Definition AngleAxis.h:62

◆ Identity()

template<typename _Scalar >
static EIGEN_DEVICE_FUNC const AngleAxis Eigen::AngleAxis< _Scalar >::Identity ( )
inlinestatic
145{ return AngleAxis(Scalar(0), Vector3::UnitX()); }
EIGEN_DEVICE_FUNC AngleAxis()
Definition AngleAxis.h:72

References Eigen::AngleAxis< _Scalar >::AngleAxis().

+ Here is the call graph for this function:

◆ inverse()

template<typename _Scalar >
EIGEN_DEVICE_FUNC AngleAxis Eigen::AngleAxis< _Scalar >::inverse ( ) const
inline
Returns
the inverse rotation, i.e., an angle-axis with opposite rotation angle
117 { return AngleAxis(-m_angle, m_axis); }

References Eigen::AngleAxis< _Scalar >::AngleAxis(), Eigen::AngleAxis< _Scalar >::m_angle, and Eigen::AngleAxis< _Scalar >::m_axis.

+ Here is the call graph for this function:

◆ isApprox()

template<typename _Scalar >
EIGEN_DEVICE_FUNC bool Eigen::AngleAxis< _Scalar >::isApprox ( const AngleAxis< _Scalar > &  other,
const typename NumTraits< Scalar >::Real &  prec = NumTraits<Scalar>::dummy_precision() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()
152 { return m_axis.isApprox(other.m_axis, prec) && internal::isApprox(m_angle,other.m_angle, prec); }
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition MathFunctions.h:1361

References Eigen::internal::isApprox(), Eigen::AngleAxis< _Scalar >::m_angle, and Eigen::AngleAxis< _Scalar >::m_axis.

+ Here is the call graph for this function:

◆ matrix()

EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< AngleAxis< _Scalar > , _Dim >::matrix ( ) const
inlineinherited
Returns
an equivalent rotation matrix This function is added to be conform with the Transform class' naming scheme.
50{ return derived().toRotationMatrix(); }

◆ operator*() [1/6]

template<typename _Scalar >
EIGEN_DEVICE_FUNC QuaternionType Eigen::AngleAxis< _Scalar >::operator* ( const AngleAxis< _Scalar > &  other) const
inline

Concatenates two rotations

105 { return QuaternionType(*this) * QuaternionType(other); }

◆ operator*() [2/6]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< AngleAxis< _Scalar > , OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType Eigen::RotationBase< AngleAxis< _Scalar > , _Dim >::operator* ( const EigenBase< OtherDerived > &  e) const
inlineinherited
Returns
the concatenation of the rotation *this with a generic expression e e can be:
  • a DimxDim linear transformation matrix
  • a DimxDim diagonal matrix (axis aligned scaling)
  • a vector of size Dim
72 { return internal::rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); }

◆ operator*() [3/6]

template<typename _Scalar >
EIGEN_DEVICE_FUNC QuaternionType Eigen::AngleAxis< _Scalar >::operator* ( const QuaternionType other) const
inline

Concatenates two rotations

109 { return QuaternionType(*this) * other; }

◆ operator*() [4/6]

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > Eigen::RotationBase< AngleAxis< _Scalar > , _Dim >::operator* ( const Transform< Scalar, Dim, Mode, Options > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a transformation t
90 { return toRotationMatrix() * t; }

◆ operator*() [5/6]

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometry > Eigen::RotationBase< AngleAxis< _Scalar > , _Dim >::operator* ( const Translation< Scalar, Dim > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a translation t
57 { return Transform<Scalar,Dim,Isometry>(*this) * t; }

◆ operator*() [6/6]

EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< AngleAxis< _Scalar > , _Dim >::operator* ( const UniformScaling< Scalar > &  s) const
inlineinherited
Returns
the concatenation of the rotation *this with a uniform scaling s
61 { return toRotationMatrix() * s.factor(); }

◆ operator=() [1/4]

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC AngleAxis & Eigen::AngleAxis< _Scalar >::operator= ( const MatrixBase< Derived > &  m)

◆ operator=() [2/4]

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC AngleAxis< Scalar > & Eigen::AngleAxis< _Scalar >::operator= ( const MatrixBase< Derived > &  mat)

Set *this from a 3x3 rotation matrix mat.

198{
199 // Since a direct conversion would not be really faster,
200 // let's use the robust Quaternion implementation:
201 return *this = QuaternionType(mat);
202}

◆ operator=() [3/4]

template<typename _Scalar >
template<class QuatDerived >
EIGEN_DEVICE_FUNC AngleAxis & Eigen::AngleAxis< _Scalar >::operator= ( const QuaternionBase< QuatDerived > &  q)

◆ operator=() [4/4]

template<typename _Scalar >
template<typename QuatDerived >
EIGEN_DEVICE_FUNC AngleAxis< Scalar > & Eigen::AngleAxis< _Scalar >::operator= ( const QuaternionBase< QuatDerived > &  q)

Set *this from a unit quaternion.

The resulting axis is normalized, and the computed angle is in the [0,pi] range.

This function implicitly normalizes the quaternion q.

171{
172 EIGEN_USING_STD_MATH(atan2)
173 EIGEN_USING_STD_MATH(abs)
174 Scalar n = q.vec().norm();
175 if(n<NumTraits<Scalar>::epsilon())
176 n = q.vec().stableNorm();
177
178 if (n != Scalar(0))
179 {
180 m_angle = Scalar(2)*atan2(n, abs(q.w()));
181 if(q.w() < Scalar(0))
182 n = -n;
183 m_axis = q.vec() / n;
184 }
185 else
186 {
187 m_angle = Scalar(0);
188 m_axis << Scalar(1), Scalar(0), Scalar(0);
189 }
190 return *this;
191}
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half abs(const half &a)
Definition Half.h:445

References Eigen::QuaternionBase< Derived >::vec(), and Eigen::QuaternionBase< Derived >::w().

+ Here is the call graph for this function:

◆ toRotationMatrix()

template<typename Scalar >
AngleAxis< Scalar >::Matrix3 EIGEN_DEVICE_FUNC Eigen::AngleAxis< Scalar >::toRotationMatrix ( void  ) const

Constructs and

Returns
an equivalent 3x3 rotation matrix.
219{
220 EIGEN_USING_STD_MATH(sin)
221 EIGEN_USING_STD_MATH(cos)
222 Matrix3 res;
223 Vector3 sin_axis = sin(m_angle) * m_axis;
224 Scalar c = cos(m_angle);
225 Vector3 cos1_axis = (Scalar(1)-c) * m_axis;
226
227 Scalar tmp;
228 tmp = cos1_axis.x() * m_axis.y();
229 res.coeffRef(0,1) = tmp - sin_axis.z();
230 res.coeffRef(1,0) = tmp + sin_axis.z();
231
232 tmp = cos1_axis.x() * m_axis.z();
233 res.coeffRef(0,2) = tmp + sin_axis.y();
234 res.coeffRef(2,0) = tmp - sin_axis.y();
235
236 tmp = cos1_axis.y() * m_axis.z();
237 res.coeffRef(1,2) = tmp - sin_axis.x();
238 res.coeffRef(2,1) = tmp + sin_axis.x();
239
240 res.diagonal() = (cos1_axis.cwiseProduct(m_axis)).array() + c;
241
242 return res;
243}
EIGEN_DEVICE_FUNC const CosReturnType cos() const
Definition ArrayCwiseUnaryOps.h:202
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index rowId, Index colId)
Definition PlainObjectBase.h:183
Matrix< Scalar, 3, 1 > Vector3
Definition AngleAxis.h:61
Matrix< Scalar, 3, 3 > Matrix3
Definition AngleAxis.h:60

References Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::coeffRef(), cos(), and sin().

Referenced by igl::embree::EmbreeIntersector::intersectBeam(), Slic3r::GUI::GLGizmoHollow::render_points(), Slic3r::GUI::GLGizmoSlaSupports::render_points(), Slic3r::GUI::GLGizmoHollow::update_hole_raycasters_for_picking_transform(), and Slic3r::GUI::GLGizmoSlaSupports::update_point_raycasters_for_picking_transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator*

template<typename _Scalar >
EIGEN_DEVICE_FUNC QuaternionType operator* ( const QuaternionType a,
const AngleAxis< _Scalar > &  b 
)
friend

Concatenates two rotations

113 { return a * QuaternionType(b); }

Member Data Documentation

◆ m_angle

◆ m_axis

◆ Eigen::Homogeneous

class Eigen::Homogeneous
template<typename MatrixType, int _Direction>
class Eigen::Homogeneous< MatrixType, _Direction >

Expression of one (or a set of) homogeneous vector(s)

\geometry_module

Parameters
MatrixTypethe type of the object in which we are making homogeneous

This class represents an expression of one (or a set of) homogeneous vector(s). It is the return type of MatrixBase::homogeneous() and most of the time this is the only way it is used.

See also
MatrixBase::homogeneous()
+ Inheritance diagram for Eigen::Homogeneous< MatrixType, _Direction >:
+ Collaboration diagram for Eigen::Homogeneous< MatrixType, _Direction >:

Public Types

enum  { Direction = _Direction }
 
typedef MatrixType NestedExpression
 
typedef MatrixBase< HomogeneousBase
 
enum  
 
enum  
 
typedef MatrixBase StorageBaseType
 
typedef internal::traits< Homogeneous< MatrixType, _Direction > >::StorageKind StorageKind
 
typedef internal::traits< Homogeneous< MatrixType, _Direction > >::StorageIndex StorageIndex
 
typedef internal::traits< Homogeneous< MatrixType, _Direction > >::Scalar Scalar
 
typedef internal::packet_traits< Scalar >::type PacketScalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef Base::CoeffReturnType CoeffReturnType
 
typedef Base::ConstTransposeReturnType ConstTransposeReturnType
 
typedef Base::RowXpr RowXpr
 
typedef Base::ColXpr ColXpr
 
typedef Matrix< Scalar, EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime), EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
 
typedef Base::PlainObject PlainObject
 
typedef CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObjectConstantReturnType
 
typedef internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, ConstTransposeReturnType >, ConstTransposeReturnType >::type AdjointReturnType
 
typedef Matrix< std::complex< RealScalar >, internal::traits< Homogeneous< MatrixType, _Direction > >::ColsAtCompileTime, 1, ColMajorEigenvaluesReturnType
 
typedef CwiseNullaryOp< internal::scalar_identity_op< Scalar >, PlainObjectIdentityReturnType
 
typedef Block< const CwiseNullaryOp< internal::scalar_identity_op< Scalar >, SquareMatrixType >, internal::traits< Homogeneous< MatrixType, _Direction > >::RowsAtCompileTime, internal::traits< Homogeneous< MatrixType, _Direction > >::ColsAtCompileTimeBasisReturnType
 
typedef Diagonal< Homogeneous< MatrixType, _Direction > > DiagonalReturnType
 
typedef internal::add_const< Diagonal< constDerived > >::type ConstDiagonalReturnType
 
typedef Diagonal< Homogeneous< MatrixType, _Direction >, DynamicIndexDiagonalDynamicIndexReturnType
 
typedef internal::add_const< Diagonal< constDerived, DynamicIndex > >::type ConstDiagonalDynamicIndexReturnType
 
typedef Homogeneous< Homogeneous< MatrixType, _Direction >, HomogeneousReturnTypeDirectionHomogeneousReturnType
 
typedef Block< const Homogeneous< MatrixType, _Direction >, internal::traits< Homogeneous< MatrixType, _Direction > >::ColsAtCompileTime==1 ? SizeMinusOne :1, internal::traits< Homogeneous< MatrixType, _Direction > >::ColsAtCompileTime==1 ? 1 :SizeMinusOneConstStartMinusOne
 
typedef internal::stem_function< Scalar >::type StemFunction
 
enum  {
  RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime , ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime , SizeAtCompileTime , MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime ,
  MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime , MaxSizeAtCompileTime , IsVectorAtCompileTime , Flags = internal::traits<Derived>::Flags ,
  IsRowMajor = int(Flags) & RowMajorBit , InnerSizeAtCompileTime , InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret , OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
}
 
enum  { IsPlainObjectBase = 0 }
 
typedef Eigen::InnerIterator< Derived > InnerIterator
 
typedef Scalar value_type
 
typedef Matrix< typename internal::traits< Derived >::Scalar, internal::traits< Derived >::RowsAtCompileTime, internal::traits< Derived >::ColsAtCompileTime, AutoAlign|(internal::traits< Derived >::Flags &RowMajorBit ? RowMajor :ColMajor), internal::traits< Derived >::MaxRowsAtCompileTime, internal::traits< Derived >::MaxColsAtCompileTimePlainMatrix
 
typedef Array< typename internal::traits< Derived >::Scalar, internal::traits< Derived >::RowsAtCompileTime, internal::traits< Derived >::ColsAtCompileTime, AutoAlign|(internal::traits< Derived >::Flags &RowMajorBit ? RowMajor :ColMajor), internal::traits< Derived >::MaxRowsAtCompileTime, internal::traits< Derived >::MaxColsAtCompileTimePlainArray
 
typedef CwiseNullaryOp< internal::linspaced_op< Scalar, PacketScalar >, PlainObjectSequentialLinSpacedReturnType
 
typedef CwiseNullaryOp< internal::linspaced_op< Scalar, PacketScalar >, PlainObjectRandomAccessLinSpacedReturnType
 
typedef Transpose< Derived > TransposeReturnType
 
typedef internal::add_const_on_value_type< typenameinternal::eval< Derived >::type >::type EvalReturnType
 
typedef VectorwiseOp< Derived, HorizontalRowwiseReturnType
 
typedef const VectorwiseOp< const Derived, HorizontalConstRowwiseReturnType
 
typedef VectorwiseOp< Derived, VerticalColwiseReturnType
 
typedef const VectorwiseOp< const Derived, VerticalConstColwiseReturnType
 
typedef CwiseNullaryOp< internal::scalar_random_op< Scalar >, PlainObjectRandomReturnType
 
typedef Reverse< Derived, BothDirectionsReverseReturnType
 
typedef const Reverse< const Derived, BothDirectionsConstReverseReturnType
 

Public Member Functions

EIGEN_DEVICE_FUNC Homogeneous (const MatrixType &matrix)
 
EIGEN_DEVICE_FUNC Index rows () const
 
EIGEN_DEVICE_FUNC Index cols () const
 
EIGEN_DEVICE_FUNC const NestedExpressionnestedExpression () const
 
template<typename Rhs >
EIGEN_DEVICE_FUNC const Product< Homogeneous, Rhs > operator* (const MatrixBase< Rhs > &rhs) const
 
template<typename Func >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::result_of< Func(Scalar, Scalar)>::type redux (const Func &func) const
 
EIGEN_DEVICE_FUNC Index diagonalSize () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & operator+= (const MatrixBase< OtherDerived > &other)
 
EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & operator+= (const MatrixBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC Homogeneous< MatrixType, _Direction > & operator+= (const EigenBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & operator-= (const MatrixBase< OtherDerived > &other)
 
EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & operator-= (const MatrixBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC Homogeneous< MatrixType, _Direction > & operator-= (const EigenBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC const Product< Homogeneous< MatrixType, _Direction >, OtherDerived > operator* (const MatrixBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC const Product< Homogeneous< MatrixType, _Direction >, DiagonalDerived, LazyProductoperator* (const DiagonalBase< DiagonalDerived > &diagonal) const
 
EIGEN_DEVICE_FUNC const Product< Homogeneous< MatrixType, _Direction >, OtherDerived, LazyProductlazyProduct (const MatrixBase< OtherDerived > &other) const
 
const Product< Homogeneous< MatrixType, _Direction >, OtherDerived, LazyProductlazyProduct (const MatrixBase< OtherDerived > &other) const
 
Homogeneous< MatrixType, _Direction > & operator*= (const EigenBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & operator*= (const Scalar &other)
 
void applyOnTheLeft (const EigenBase< OtherDerived > &other)
 
void applyOnTheLeft (Index p, Index q, const JacobiRotation< OtherScalar > &j)
 
void applyOnTheRight (const EigenBase< OtherDerived > &other)
 
void applyOnTheRight (Index p, Index q, const JacobiRotation< OtherScalar > &j)
 
EIGEN_DEVICE_FUNC ScalarBinaryOpTraits< typenameinternal::traits< Homogeneous< MatrixType, _Direction > >::Scalar, typenameinternal::traits< OtherDerived >::Scalar >::ReturnType dot (const MatrixBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarBinaryOpTraits< typenameinternal::traits< Homogeneous< MatrixType, _Direction > >::Scalar, typenameinternal::traits< OtherDerived >::Scalar >::ReturnType dot (const MatrixBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC RealScalar squaredNorm () const
 
EIGEN_DEVICE_FUNC RealScalar norm () const
 
RealScalar stableNorm () const
 
RealScalar blueNorm () const
 
RealScalar hypotNorm () const
 
EIGEN_DEVICE_FUNC const PlainObject normalized () const
 
EIGEN_DEVICE_FUNC const PlainObject stableNormalized () const
 
EIGEN_DEVICE_FUNC void normalize ()
 
EIGEN_DEVICE_FUNC void stableNormalize ()
 
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint () const
 
EIGEN_DEVICE_FUNC void adjointInPlace ()
 
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal ()
 
EIGEN_DEVICE_FUNC ConstDiagonalReturnType diagonal () const
 
EIGEN_DEVICE_FUNC DiagonalIndexReturnType< Index >::Type diagonal ()
 
EIGEN_DEVICE_FUNC ConstDiagonalIndexReturnType< Index >::Type diagonal () const
 
EIGEN_DEVICE_FUNC DiagonalDynamicIndexReturnType diagonal (Index index)
 
EIGEN_DEVICE_FUNC ConstDiagonalDynamicIndexReturnType diagonal (Index index) const
 
EIGEN_DEVICE_FUNC TriangularViewReturnType< Mode >::Type triangularView ()
 
EIGEN_DEVICE_FUNC ConstTriangularViewReturnType< Mode >::Type triangularView () const
 
MatrixBase< Homogeneous< MatrixType, _Direction > >::template TriangularViewReturnType< Mode >::Type triangularView ()
 
MatrixBase< Homogeneous< MatrixType, _Direction > >::template ConstTriangularViewReturnType< Mode >::Type triangularView () const
 
EIGEN_DEVICE_FUNC SelfAdjointViewReturnType< UpLo >::Type selfadjointView ()
 
EIGEN_DEVICE_FUNC ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView () const
 
MatrixBase< Homogeneous< MatrixType, _Direction > >::template ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView () const
 
MatrixBase< Homogeneous< MatrixType, _Direction > >::template SelfAdjointViewReturnType< UpLo >::Type selfadjointView ()
 
const SparseView< Homogeneous< MatrixType, _Direction > > sparseView (const Scalar &m_reference=Scalar(0), const typename NumTraits< Scalar >::Real &m_epsilon=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC const DiagonalWrapper< const Homogeneous< MatrixType, _Direction > > asDiagonal () const
 
const PermutationWrapper< const Homogeneous< MatrixType, _Direction > > asPermutation () const
 
EIGEN_DEVICE_FUNC Homogeneous< MatrixType, _Direction > & setIdentity ()
 
EIGEN_DEVICE_FUNC Homogeneous< MatrixType, _Direction > & setIdentity (Index rows, Index cols)
 Resizes to the given size, and writes the identity expression (not necessarily square) into *this.
 
bool isIdentity (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isDiagonal (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isUpperTriangular (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isLowerTriangular (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isOrthogonal (const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isUnitary (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC bool operator== (const MatrixBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC bool operator!= (const MatrixBase< OtherDerived > &other) const
 
NoAlias< Homogeneous< MatrixType, _Direction >, Eigen::MatrixBasenoalias ()
 
const Homogeneous< MatrixType, _Direction > & forceAlignedAccess () const
 
Homogeneous< MatrixType, _Direction > & forceAlignedAccess ()
 
const Homogeneous< MatrixType, _Direction > & forceAlignedAccessIf () const
 
Homogeneous< MatrixType, _Direction > & forceAlignedAccessIf ()
 
internal::add_const_on_value_type< typenameinternal::conditional< Enable, ForceAlignedAccess< Homogeneous< MatrixType, _Direction > >, Homogeneous< MatrixType, _Direction > & >::type >::type forceAlignedAccessIf () const
 
internal::conditional< Enable, ForceAlignedAccess< Homogeneous< MatrixType, _Direction > >, Homogeneous< MatrixType, _Direction > & >::type forceAlignedAccessIf ()
 
EIGEN_DEVICE_FUNC Scalar trace () const
 
EIGEN_DEVICE_FUNC RealScalar lpNorm () const
 
NumTraits< typenameinternal::traits< Homogeneous< MatrixType, _Direction > >::Scalar >::Real lpNorm () const
 
EIGEN_DEVICE_FUNC MatrixBase< Homogeneous< MatrixType, _Direction > > & matrix ()
 
EIGEN_DEVICE_FUNC const MatrixBase< Homogeneous< MatrixType, _Direction > > & matrix () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper< Homogeneous< MatrixType, _Direction > > array ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper< const Homogeneous< MatrixType, _Direction > > array () const
 
const FullPivLU< PlainObjectfullPivLu () const
 
const PartialPivLU< PlainObjectpartialPivLu () const
 
const PartialPivLU< PlainObjectlu () const
 
const Inverse< Homogeneous< MatrixType, _Direction > > inverse () const
 
void computeInverseAndDetWithCheck (ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
 
void computeInverseWithCheck (ResultType &inverse, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
 
Scalar determinant () const
 
const LLT< PlainObjectllt () const
 
const LDLT< PlainObjectldlt () const
 
const HouseholderQR< PlainObjecthouseholderQr () const
 
const ColPivHouseholderQR< PlainObjectcolPivHouseholderQr () const
 
const FullPivHouseholderQR< PlainObjectfullPivHouseholderQr () const
 
const CompleteOrthogonalDecomposition< PlainObjectcompleteOrthogonalDecomposition () const
 
EigenvaluesReturnType eigenvalues () const
 Computes the eigenvalues of a matrix.
 
RealScalar operatorNorm () const
 Computes the L2 operator norm.
 
JacobiSVD< PlainObjectjacobiSvd (unsigned int computationOptions=0) const
 
BDCSVD< PlainObjectbdcSvd (unsigned int computationOptions=0) const
 
EIGEN_DEVICE_FUNC cross_product_return_type< OtherDerived >::type cross (const MatrixBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC MatrixBase< Homogeneous< MatrixType, _Direction > >::template cross_product_return_type< OtherDerived >::type cross (const MatrixBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC PlainObject cross3 (const MatrixBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC PlainObject unitOrthogonal (void) const
 
EIGEN_DEVICE_FUNC Matrix< Scalar, 3, 1 > eulerAngles (Index a0, Index a1, Index a2) const
 
EIGEN_DEVICE_FUNC HomogeneousReturnType homogeneous () const
 
typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE (ConstStartMinusOne, Scalar, quotient) HNormalizedReturnType
 
EIGEN_DEVICE_FUNC const HNormalizedReturnType hnormalized () const
 homogeneous normalization
 
void makeHouseholderInPlace (Scalar &tau, RealScalar &beta)
 
void makeHouseholder (EssentialPart &essential, Scalar &tau, RealScalar &beta) const
 
void applyHouseholderOnTheLeft (const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
 
void applyHouseholderOnTheRight (const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
 
EIGEN_STRONG_INLINE const SparseMatrixBase< OtherDerived >::template CwiseProductDenseReturnType< Homogeneous< MatrixType, _Direction > >::Type cwiseProduct (const SparseMatrixBase< OtherDerived > &other) const
 
const MatrixFunctionReturnValue< Homogeneous< MatrixType, _Direction > > matrixFunction (StemFunction f) const
 Helper function for the unsupported MatrixFunctions module.
 
EIGEN_DEVICE_FUNC Homogeneous< MatrixType, _Direction > & lazyAssign (const DenseBase< OtherDerived > &other)
 
EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & lazyAssign (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & operator/= (const Scalar &other)
 
EIGEN_DEVICE_FUNC Index nonZeros () const
 
EIGEN_DEVICE_FUNC Index outerSize () const
 
EIGEN_DEVICE_FUNC Index innerSize () const
 
EIGEN_DEVICE_FUNC void resize (Index newSize)
 
EIGEN_DEVICE_FUNC void resize (Index rows, Index cols)
 
EIGEN_DEVICE_FUNC CommaInitializer< Derived > operator<< (const Scalar &s)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC CommaInitializer< Derived > operator<< (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived >
CommaInitializer< Derived > operator<< (const DenseBase< OtherDerived > &other)
 
template<unsigned int Added, unsigned int Removed>
EIGEN_DEPRECATED const Derived & flagged () const
 
EIGEN_DEVICE_FUNC TransposeReturnType transpose ()
 
EIGEN_DEVICE_FUNC ConstTransposeReturnType transpose () const
 
EIGEN_DEVICE_FUNC void transposeInPlace ()
 
template<typename CustomNullaryOp >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObjectNullaryExpr (Index rows, Index cols, const CustomNullaryOp &func)
 
template<typename CustomNullaryOp >
EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObjectNullaryExpr (Index size, const CustomNullaryOp &func)
 
template<typename CustomNullaryOp >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObjectNullaryExpr (const CustomNullaryOp &func)
 
EIGEN_DEVICE_FUNC void fill (const Scalar &value)
 
EIGEN_DEVICE_FUNC Derived & setConstant (const Scalar &value)
 
EIGEN_DEVICE_FUNC Derived & setLinSpaced (Index size, const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
EIGEN_DEVICE_FUNC Derived & setLinSpaced (const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
EIGEN_DEVICE_FUNC Derived & setZero ()
 
EIGEN_DEVICE_FUNC Derived & setOnes ()
 
EIGEN_DEVICE_FUNC Derived & setRandom ()
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC bool isApprox (const DenseBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename OtherDerived >
bool isApprox (const DenseBase< OtherDerived > &other, const RealScalar &prec) const
 
EIGEN_DEVICE_FUNC bool isMuchSmallerThan (const RealScalar &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC bool isMuchSmallerThan (const DenseBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename Derived >
bool isMuchSmallerThan (const typename NumTraits< Scalar >::Real &other, const RealScalar &prec) const
 
template<typename OtherDerived >
bool isMuchSmallerThan (const DenseBase< OtherDerived > &other, const RealScalar &prec) const
 
EIGEN_DEVICE_FUNC bool isApproxToConstant (const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC bool isConstant (const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC bool isZero (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC bool isOnes (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool hasNaN () const
 
bool allFinite () const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC void swap (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC void swap (PlainObjectBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC const NestByValue< Derived > nestByValue () const
 
EIGEN_DEVICE_FUNC Scalar sum () const
 
EIGEN_DEVICE_FUNC Scalar mean () const
 
EIGEN_DEVICE_FUNC Scalar prod () const
 
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar minCoeff () const
 
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar minCoeff (IndexType *row, IndexType *col) const
 
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar minCoeff (IndexType *index) const
 
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar maxCoeff () const
 
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar maxCoeff (IndexType *row, IndexType *col) const
 
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar maxCoeff (IndexType *index) const
 
template<typename BinaryOp >
EIGEN_DEVICE_FUNC Scalar redux (const BinaryOp &func) const
 
template<typename Visitor >
EIGEN_DEVICE_FUNC void visit (Visitor &func) const
 
const WithFormat< Derived > format (const IOFormat &fmt) const
 
EIGEN_DEVICE_FUNC CoeffReturnType value () const
 
EIGEN_DEVICE_FUNC bool all () const
 
EIGEN_DEVICE_FUNC bool any () const
 
EIGEN_DEVICE_FUNC Index count () const
 
EIGEN_DEVICE_FUNC ConstRowwiseReturnType rowwise () const
 
EIGEN_DEVICE_FUNC RowwiseReturnType rowwise ()
 
EIGEN_DEVICE_FUNC ConstColwiseReturnType colwise () const
 
EIGEN_DEVICE_FUNC ColwiseReturnType colwise ()
 
template<typename ThenDerived , typename ElseDerived >
const Select< Derived, ThenDerived, ElseDerived > select (const DenseBase< ThenDerived > &thenMatrix, const DenseBase< ElseDerived > &elseMatrix) const
 
template<typename ThenDerived >
const Select< Derived, ThenDerived, typename ThenDerived::ConstantReturnType > select (const DenseBase< ThenDerived > &thenMatrix, const typename ThenDerived::Scalar &elseScalar) const
 
template<typename ElseDerived >
const Select< Derived, typename ElseDerived::ConstantReturnType, ElseDerived > select (const typename ElseDerived::Scalar &thenScalar, const DenseBase< ElseDerived > &elseMatrix) const
 
template<int RowFactor, int ColFactor>
EIGEN_DEVICE_FUNC const Replicate< Derived, RowFactor, ColFactor > replicate () const
 
EIGEN_DEVICE_FUNC const Replicate< Derived, Dynamic, Dynamicreplicate (Index rowFactor, Index colFactor) const
 
template<int RowFactor, int ColFactor>
const Replicate< Derived, RowFactor, ColFactor > replicate () const
 
EIGEN_DEVICE_FUNC ReverseReturnType reverse ()
 
EIGEN_DEVICE_FUNC ConstReverseReturnType reverse () const
 
EIGEN_DEVICE_FUNC void reverseInPlace ()
 
template<typename Dest >
EIGEN_DEVICE_FUNC void evalTo (Dest &) const
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC const IdentityReturnType Identity ()
 
static EIGEN_DEVICE_FUNC const IdentityReturnType Identity (Index rows, Index cols)
 
static EIGEN_DEVICE_FUNC const BasisReturnType Unit (Index size, Index i)
 
static EIGEN_DEVICE_FUNC const BasisReturnType Unit (Index i)
 
static EIGEN_DEVICE_FUNC const BasisReturnType UnitX ()
 
static EIGEN_DEVICE_FUNC const BasisReturnType UnitY ()
 
static EIGEN_DEVICE_FUNC const BasisReturnType UnitZ ()
 
static EIGEN_DEVICE_FUNC const BasisReturnType UnitW ()
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant (Index rows, Index cols, const Scalar &value)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant (Index size, const Scalar &value)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant (const Scalar &value)
 
static EIGEN_DEVICE_FUNC const SequentialLinSpacedReturnType LinSpaced (Sequential_t, Index size, const Scalar &low, const Scalar &high)
 
static EIGEN_DEVICE_FUNC const RandomAccessLinSpacedReturnType LinSpaced (Index size, const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
static EIGEN_DEVICE_FUNC const SequentialLinSpacedReturnType LinSpaced (Sequential_t, const Scalar &low, const Scalar &high)
 
static EIGEN_DEVICE_FUNC const RandomAccessLinSpacedReturnType LinSpaced (const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObjectNullaryExpr (Index rows, Index cols, const CustomNullaryOp &func)
 
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObjectNullaryExpr (Index size, const CustomNullaryOp &func)
 
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObjectNullaryExpr (const CustomNullaryOp &func)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Zero (Index rows, Index cols)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Zero (Index size)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Zero ()
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Ones (Index rows, Index cols)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Ones (Index size)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Ones ()
 
static const RandomReturnType Random (Index rows, Index cols)
 
static const RandomReturnType Random (Index size)
 
static const RandomReturnType Random ()
 

Protected Member Functions

Homogeneous< MatrixType, _Direction > & operator+= (const ArrayBase< OtherDerived > &)
 
Homogeneous< MatrixType, _Direction > & operator-= (const ArrayBase< OtherDerived > &)
 

Protected Attributes

MatrixType::Nested m_matrix
 

Friends

template<typename Lhs >
EIGEN_DEVICE_FUNC const Product< Lhs, Homogeneousoperator* (const MatrixBase< Lhs > &lhs, const Homogeneous &rhs)
 
template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC const Product< Transform< Scalar, Dim, Mode, Options >, Homogeneousoperator* (const Transform< Scalar, Dim, Mode, Options > &lhs, const Homogeneous &rhs)
 

Related Symbols

(Note that these are not member symbols.)

template<typename Derived >
std::ostream & operator<< (std::ostream &s, const DenseBase< Derived > &m)
 

Member Typedef Documentation

◆ AdjointReturnType

◆ Base

template<typename MatrixType , int _Direction>
typedef MatrixBase<Homogeneous> Eigen::Homogeneous< MatrixType, _Direction >::Base

◆ BasisReturnType

typedef Block<const CwiseNullaryOp<internal::scalar_identity_op<Scalar>, SquareMatrixType>, internal::traits<Homogeneous< MatrixType, _Direction > >::RowsAtCompileTime, internal::traits<Homogeneous< MatrixType, _Direction > >::ColsAtCompileTime> Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::BasisReturnType
inherited

◆ CoeffReturnType

typedef Base::CoeffReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::CoeffReturnType
inherited

◆ ColwiseReturnType

template<typename Derived >
typedef VectorwiseOp<Derived, Vertical> Eigen::DenseBase< Derived >::ColwiseReturnType
inherited

◆ ColXpr

typedef Base::ColXpr Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::ColXpr
inherited

◆ ConstantReturnType

typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,PlainObject> Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::ConstantReturnType
inherited

◆ ConstColwiseReturnType

template<typename Derived >
typedef const VectorwiseOp<const Derived, Vertical> Eigen::DenseBase< Derived >::ConstColwiseReturnType
inherited

◆ ConstDiagonalDynamicIndexReturnType

typedef internal::add_const<Diagonal<constDerived,DynamicIndex>>::type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::ConstDiagonalDynamicIndexReturnType
inherited

◆ ConstDiagonalReturnType

typedef internal::add_const<Diagonal<constDerived>>::type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::ConstDiagonalReturnType
inherited

◆ ConstReverseReturnType

template<typename Derived >
typedef const Reverse<const Derived, BothDirections> Eigen::DenseBase< Derived >::ConstReverseReturnType
inherited

◆ ConstRowwiseReturnType

template<typename Derived >
typedef const VectorwiseOp<const Derived, Horizontal> Eigen::DenseBase< Derived >::ConstRowwiseReturnType
inherited

◆ ConstStartMinusOne

typedef Block<const Homogeneous< MatrixType, _Direction > , internal::traits<Homogeneous< MatrixType, _Direction > >::ColsAtCompileTime==1 ? SizeMinusOne : 1, internal::traits<Homogeneous< MatrixType, _Direction > >::ColsAtCompileTime==1 ? 1 : SizeMinusOne> Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::ConstStartMinusOne
inherited

◆ ConstTransposeReturnType

typedef Base::ConstTransposeReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::ConstTransposeReturnType
inherited

◆ DiagonalDynamicIndexReturnType

typedef Diagonal<Homogeneous< MatrixType, _Direction > ,DynamicIndex> Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::DiagonalDynamicIndexReturnType
inherited

◆ DiagonalReturnType

typedef Diagonal<Homogeneous< MatrixType, _Direction > > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::DiagonalReturnType
inherited

◆ EigenvaluesReturnType

typedef Matrix<std::complex<RealScalar>, internal::traits<Homogeneous< MatrixType, _Direction > >::ColsAtCompileTime, 1, ColMajor> Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::EigenvaluesReturnType
inherited

◆ EvalReturnType

template<typename Derived >
typedef internal::add_const_on_value_type<typenameinternal::eval<Derived>::type>::type Eigen::DenseBase< Derived >::EvalReturnType
inherited

◆ HomogeneousReturnType

typedef Homogeneous<Homogeneous< MatrixType, _Direction > , HomogeneousReturnTypeDirection> Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::HomogeneousReturnType
inherited

◆ IdentityReturnType

typedef CwiseNullaryOp<internal::scalar_identity_op<Scalar>,PlainObject> Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::IdentityReturnType
inherited

◆ InnerIterator

template<typename Derived >
typedef Eigen::InnerIterator<Derived> Eigen::DenseBase< Derived >::InnerIterator
inherited

Inner iterator type to iterate over the coefficients of a row or column.

See also
class InnerIterator

◆ NestedExpression

template<typename MatrixType , int _Direction>
typedef MatrixType Eigen::Homogeneous< MatrixType, _Direction >::NestedExpression

◆ PacketScalar

typedef internal::packet_traits<Scalar>::type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::PacketScalar
inherited

◆ PlainArray

The plain array type corresponding to this expression.

See also
PlainObject

◆ PlainMatrix

The plain matrix type corresponding to this expression.

See also
PlainObject

◆ PlainObject

typedef Base::PlainObject Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject
inherited

◆ RandomAccessLinSpacedReturnType

template<typename Derived >
typedef CwiseNullaryOp<internal::linspaced_op<Scalar,PacketScalar>,PlainObject> Eigen::DenseBase< Derived >::RandomAccessLinSpacedReturnType
inherited

◆ RandomReturnType

template<typename Derived >
typedef CwiseNullaryOp<internal::scalar_random_op<Scalar>,PlainObject> Eigen::DenseBase< Derived >::RandomReturnType
inherited

◆ RealScalar

typedef NumTraits<Scalar>::Real Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::RealScalar
inherited

◆ ReverseReturnType

template<typename Derived >
typedef Reverse<Derived, BothDirections> Eigen::DenseBase< Derived >::ReverseReturnType
inherited

◆ RowwiseReturnType

template<typename Derived >
typedef VectorwiseOp<Derived, Horizontal> Eigen::DenseBase< Derived >::RowwiseReturnType
inherited

◆ RowXpr

typedef Base::RowXpr Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::RowXpr
inherited

◆ Scalar

typedef internal::traits<Homogeneous< MatrixType, _Direction > >::Scalar Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::Scalar
inherited

◆ SequentialLinSpacedReturnType

template<typename Derived >
typedef CwiseNullaryOp<internal::linspaced_op<Scalar,PacketScalar>,PlainObject> Eigen::DenseBase< Derived >::SequentialLinSpacedReturnType
inherited

◆ SquareMatrixType

type of the equivalent square matrix

◆ StemFunction

typedef internal::stem_function<Scalar>::type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::StemFunction
inherited

◆ StorageBaseType

typedef MatrixBase Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::StorageBaseType
inherited

◆ StorageIndex

typedef internal::traits<Homogeneous< MatrixType, _Direction > >::StorageIndex Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::StorageIndex
inherited

◆ StorageKind

typedef internal::traits<Homogeneous< MatrixType, _Direction > >::StorageKind Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::StorageKind
inherited

◆ TransposeReturnType

template<typename Derived >
typedef Transpose<Derived> Eigen::DenseBase< Derived >::TransposeReturnType
inherited

◆ value_type

template<typename Derived >
typedef Scalar Eigen::DenseBase< Derived >::value_type
inherited

The numeric type of the expression' coefficients, e.g. float, double, int or std::complex<float>, etc.

It is an alias for the Scalar type

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived >
anonymous enum
inherited
Enumerator
RowsAtCompileTime 

The number of rows at compile-time. This is just a copy of the value provided by the Derived type. If a value is not known at compile-time, it is set to the Dynamic constant.

See also
MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime
ColsAtCompileTime 

The number of columns at compile-time. This is just a copy of the value provided by the Derived type. If a value is not known at compile-time, it is set to the Dynamic constant.

See also
MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime
SizeAtCompileTime 

This is equal to the number of coefficients, i.e. the number of rows times the number of columns, or to Dynamic if this is not known at compile-time.

See also
RowsAtCompileTime, ColsAtCompileTime
MaxRowsAtCompileTime 

This value is equal to the maximum possible number of rows that this expression might have. If this expression might have an arbitrarily high number of rows, this value is set to Dynamic.

This value is useful to know when evaluating an expression, in order to determine whether it is possible to avoid doing a dynamic memory allocation.

See also
RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime
MaxColsAtCompileTime 

This value is equal to the maximum possible number of columns that this expression might have. If this expression might have an arbitrarily high number of columns, this value is set to Dynamic.

This value is useful to know when evaluating an expression, in order to determine whether it is possible to avoid doing a dynamic memory allocation.

See also
ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime
MaxSizeAtCompileTime 

This value is equal to the maximum possible number of coefficients that this expression might have. If this expression might have an arbitrarily high number of coefficients, this value is set to Dynamic.

This value is useful to know when evaluating an expression, in order to determine whether it is possible to avoid doing a dynamic memory allocation.

See also
SizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime
IsVectorAtCompileTime 

This is set to true if either the number of rows or the number of columns is known at compile-time to be equal to 1. Indeed, in that case, we are dealing with a column-vector (if there is only one column) or with a row-vector (if there is only one row).

Flags 

This stores expression Flags flags which may or may not be inherited by new expressions constructed from this one. See the list of flags.

IsRowMajor 

True if this expression has row-major storage order.

InnerSizeAtCompileTime 
InnerStrideAtCompileTime 
OuterStrideAtCompileTime 
98 {
99
100 RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
106 ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
113 SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
114 internal::traits<Derived>::ColsAtCompileTime>::ret),
119 MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
130 MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
141 MaxSizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::MaxRowsAtCompileTime,
142 internal::traits<Derived>::MaxColsAtCompileTime>::ret),
153 IsVectorAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime == 1
154 || internal::traits<Derived>::MaxColsAtCompileTime == 1,
160 Flags = internal::traits<Derived>::Flags,
165 IsRowMajor = int(Flags) & RowMajorBit,
169
170 InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret,
171 OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
172 };
@ IsVectorAtCompileTime
Definition DenseBase.h:153
@ SizeAtCompileTime
Definition DenseBase.h:113
@ MaxSizeAtCompileTime
Definition DenseBase.h:141
@ IsRowMajor
Definition DenseBase.h:165
@ OuterStrideAtCompileTime
Definition DenseBase.h:171
@ Flags
Definition DenseBase.h:160
@ ColsAtCompileTime
Definition DenseBase.h:106
@ InnerSizeAtCompileTime
Definition DenseBase.h:167
@ InnerStrideAtCompileTime
Definition DenseBase.h:170
@ MaxColsAtCompileTime
Definition DenseBase.h:130
@ MaxRowsAtCompileTime
Definition DenseBase.h:119
@ RowsAtCompileTime
Definition DenseBase.h:100
const unsigned int RowMajorBit
Definition Constants.h:61
Definition Eigen_Colamd.h:50

◆ anonymous enum

template<typename Derived >
anonymous enum
inherited
Enumerator
IsPlainObjectBase 
176{ IsPlainObjectBase = 0 };
@ IsPlainObjectBase
Definition DenseBase.h:176

◆ anonymous enum

anonymous enum
inherited
397 { HomogeneousReturnTypeDirection = ColsAtCompileTime==1&&RowsAtCompileTime==1 ? ((internal::traits<Derived>::Flags&RowMajorBit)==RowMajorBit ? Horizontal : Vertical)
@ Horizontal
Definition Constants.h:268
@ Vertical
Definition Constants.h:265

◆ anonymous enum

anonymous enum
inherited

◆ anonymous enum

template<typename MatrixType , int _Direction>
anonymous enum
Enumerator
Direction 
66{ Direction = _Direction };
@ Direction
Definition Homogeneous.h:66

Constructor & Destructor Documentation

◆ Homogeneous()

template<typename MatrixType , int _Direction>
EIGEN_DEVICE_FUNC Eigen::Homogeneous< MatrixType, _Direction >::Homogeneous ( const MatrixType &  matrix)
inlineexplicit
73 {}
EIGEN_DEVICE_FUNC MatrixBase< Homogeneous< MatrixType, _Direction > > & matrix()
Definition MatrixBase.h:312
MatrixType::Nested m_matrix
Definition Homogeneous.h:112

Member Function Documentation

◆ adjoint()

const MatrixBase< Homogeneous< MatrixType, _Direction > >::AdjointReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::adjoint
inlineinherited
Returns
an expression of the adjoint (i.e. conjugate transpose) of *this.

Example:

Output:

Warning
If you want to replace a matrix by its own adjoint, do NOT do this:
m = m.adjoint(); // bug!!! caused by aliasing effect
Instead, use the adjointInPlace() method:
m.adjointInPlace();
which gives Eigen good opportunities for optimization, or alternatively you can also do:
m = m.adjoint().eval();
See also
adjointInPlace(), transpose(), conjugate(), class Transpose, class internal::scalar_conjugate_op
211{
212 return AdjointReturnType(this->transpose());
213}
EIGEN_DEVICE_FUNC TransposeReturnType transpose()
Definition Transpose.h:172
internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, ConstTransposeReturnType >, ConstTransposeReturnType >::type AdjointReturnType
Definition MatrixBase.h:112

◆ adjointInPlace()

void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::adjointInPlace
inlineinherited

This is the "in place" version of adjoint(): it replaces *this by its own transpose. Thus, doing

m.adjointInPlace();

has the same effect on m as doing

m = m.adjoint().eval();

and is faster and also safer because in the latter line of code, forgetting the eval() results in a bug caused by aliasing.

Notice however that this method is only useful if you want to replace a matrix by its own adjoint. If you just need the adjoint of a matrix, use adjoint().

Note
if the matrix is not square, then *this must be a resizable matrix. This excludes (non-square) fixed-size matrices, block-expressions and maps.
See also
transpose(), adjoint(), transposeInPlace()
316{
317 derived() = adjoint().eval();
318}
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const
Definition Transpose.h:210

◆ all()

template<typename Derived >
bool Eigen::DenseBase< Derived >::all
inlineinherited
Returns
true if all coefficients are true

Example:

Output:

See also
any(), Cwise::operator<()
82{
83 typedef internal::evaluator<Derived> Evaluator;
84 enum {
85 unroll = SizeAtCompileTime != Dynamic
86 && SizeAtCompileTime * (Evaluator::CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT
87 };
88 Evaluator evaluator(derived());
89 if(unroll)
90 return internal::all_unroller<Evaluator, unroll ? int(SizeAtCompileTime) : Dynamic>::run(evaluator);
91 else
92 {
93 for(Index j = 0; j < cols(); ++j)
94 for(Index i = 0; i < rows(); ++i)
95 if (!evaluator.coeff(i, j)) return false;
96 return true;
97 }
98}
#define EIGEN_UNROLLING_LIMIT
Definition Settings.h:24
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:33
size_t cols(const T &raster)
Definition MarchingSquares.hpp:60
size_t rows(const T &raster)
Definition MarchingSquares.hpp:55

References Eigen::Dynamic, and EIGEN_UNROLLING_LIMIT.

◆ allFinite()

template<typename Derived >
bool Eigen::DenseBase< Derived >::allFinite
inlineinherited
Returns
true if *this contains only finite numbers, i.e., no NaN and no +/-INF values.
See also
hasNaN()
154{
155#if EIGEN_COMP_MSVC || (defined __FAST_MATH__)
156 return derived().array().isFinite().all();
157#else
158 return !((derived()-derived()).hasNaN());
159#endif
160}
bool hasNaN() const
Definition BooleanRedux.h:139

◆ any()

template<typename Derived >
bool Eigen::DenseBase< Derived >::any
inlineinherited
Returns
true if at least one coefficient is true
See also
all()
106{
107 typedef internal::evaluator<Derived> Evaluator;
108 enum {
109 unroll = SizeAtCompileTime != Dynamic
110 && SizeAtCompileTime * (Evaluator::CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT
111 };
112 Evaluator evaluator(derived());
113 if(unroll)
114 return internal::any_unroller<Evaluator, unroll ? int(SizeAtCompileTime) : Dynamic>::run(evaluator);
115 else
116 {
117 for(Index j = 0; j < cols(); ++j)
118 for(Index i = 0; i < rows(); ++i)
119 if (evaluator.coeff(i, j)) return true;
120 return false;
121 }
122}

References Eigen::Dynamic, and EIGEN_UNROLLING_LIMIT.

◆ applyHouseholderOnTheLeft()

void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::applyHouseholderOnTheLeft ( const EssentialPart &  essential,
const Scalar tau,
Scalar workspace 
)
inherited

Apply the elementary reflector H given by $ H = I - tau v v^*$ with $ v^T = [1 essential^T] $ from the left to a vector or matrix.

On input:

Parameters
essentialthe essential part of the vector v
tauthe scaling factor of the Householder transformation
workspacea pointer to working space with at least this->cols() * essential.size() entries
See also
MatrixBase::makeHouseholder(), MatrixBase::makeHouseholderInPlace(), MatrixBase::applyHouseholderOnTheRight()
117{
118 if(rows() == 1)
119 {
120 *this *= Scalar(1)-tau;
121 }
122 else if(tau!=Scalar(0))
123 {
124 Map<typename internal::plain_row_type<PlainObject>::type> tmp(workspace,cols());
125 Block<Derived, EssentialPart::SizeAtCompileTime, Derived::ColsAtCompileTime> bottom(derived(), 1, 0, rows()-1, cols());
126 tmp.noalias() = essential.adjoint() * bottom;
127 tmp += this->row(0);
128 this->row(0) -= tau * tmp;
129 bottom.noalias() -= tau * essential * tmp;
130 }
131}
EIGEN_DEVICE_FUNC RowXpr row(Index i)
This is the const version of row(). *‍/.
Definition BlockMethods.h:859
internal::traits< Homogeneous< MatrixType, _Direction > >::Scalar Scalar
Definition MatrixBase.h:56

◆ applyHouseholderOnTheRight()

void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::applyHouseholderOnTheRight ( const EssentialPart &  essential,
const Scalar tau,
Scalar workspace 
)
inherited

Apply the elementary reflector H given by $ H = I - tau v v^*$ with $ v^T = [1 essential^T] $ from the right to a vector or matrix.

On input:

Parameters
essentialthe essential part of the vector v
tauthe scaling factor of the Householder transformation
workspacea pointer to working space with at least this->cols() * essential.size() entries
See also
MatrixBase::makeHouseholder(), MatrixBase::makeHouseholderInPlace(), MatrixBase::applyHouseholderOnTheLeft()
154{
155 if(cols() == 1)
156 {
157 *this *= Scalar(1)-tau;
158 }
159 else if(tau!=Scalar(0))
160 {
161 Map<typename internal::plain_col_type<PlainObject>::type> tmp(workspace,rows());
162 Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows(), cols()-1);
163 tmp.noalias() = right * essential.conjugate();
164 tmp += this->col(0);
165 this->col(0) -= tau * tmp;
166 right.noalias() -= tau * tmp * essential.transpose();
167 }
168}
EIGEN_DEVICE_FUNC ColXpr col(Index i)
This is the const version of col().
Definition BlockMethods.h:838

◆ applyOnTheLeft() [1/2]

void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::applyOnTheLeft ( const EigenBase< OtherDerived > &  other)
inlineinherited

replaces *this by other * *this.

Example:

Output:

 
523{
524 other.derived().applyThisOnTheLeft(derived());
525}

◆ applyOnTheLeft() [2/2]

void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::applyOnTheLeft ( Index  p,
Index  q,
const JacobiRotation< OtherScalar > &  j 
)
inlineinherited

\jacobi_module Applies the rotation in the plane j to the rows p and q of *this, i.e., it computes B = J * B, with $ B = \left ( \begin{array}{cc} \text{*this.row}(p) \\ \text{*this.row}(q) \end{array} \right ) $.

See also
class JacobiRotation, MatrixBase::applyOnTheRight(), internal::apply_rotation_in_the_plane()
278{
279 RowXpr x(this->row(p));
280 RowXpr y(this->row(q));
281 internal::apply_rotation_in_the_plane(x, y, j);
282}
Block< Derived, 1, internal::traits< Derived >::ColsAtCompileTime, IsRowMajor > RowXpr
Definition BlockMethods.h:17
const Scalar & y
Definition MathFunctions.h:552
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297

◆ applyOnTheRight() [1/2]

void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::applyOnTheRight ( const EigenBase< OtherDerived > &  other)
inlineinherited

replaces *this by *this * other. It is equivalent to MatrixBase::operator*=().

Example:

Output:

 
511{
512 other.derived().applyThisOnTheRight(derived());
513}

◆ applyOnTheRight() [2/2]

void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::applyOnTheRight ( Index  p,
Index  q,
const JacobiRotation< OtherScalar > &  j 
)
inlineinherited

Applies the rotation in the plane j to the columns p and q of *this, i.e., it computes B = B * J with $ B = \left ( \begin{array}{cc} \text{*this.col}(p) & \text{*this.col}(q) \end{array} \right ) $.

See also
class JacobiRotation, MatrixBase::applyOnTheLeft(), internal::apply_rotation_in_the_plane()
293{
294 ColXpr x(this->col(p));
295 ColXpr y(this->col(q));
296 internal::apply_rotation_in_the_plane(x, y, j.transpose());
297}
Block< Derived, internal::traits< Derived >::RowsAtCompileTime, 1, !IsRowMajor > ColXpr
Definition BlockMethods.h:14

◆ array() [1/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper< Homogeneous< MatrixType, _Direction > > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::array ( )
inlineinherited
Returns
an Array expression of this matrix
See also
ArrayBase::matrix()
317{ return ArrayWrapper<Derived>(derived()); }

◆ array() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper< const Homogeneous< MatrixType, _Direction > > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::array ( ) const
inlineinherited
Returns
a const Array expression of this matrix
See also
ArrayBase::matrix()
320{ return ArrayWrapper<const Derived>(derived()); }

◆ asDiagonal()

const DiagonalWrapper< const Homogeneous< MatrixType, _Direction > > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::asDiagonal
inlineinherited
Returns
a pseudo-expression of a diagonal matrix with *this as vector of diagonal coefficients

\only_for_vectors

Example:

Output:

See also
class DiagonalWrapper, class DiagonalMatrix, diagonal(), isDiagonal()
278{
279 return DiagonalWrapper<const Derived>(derived());
280}

◆ asPermutation()

const PermutationWrapper< const Homogeneous< MatrixType, _Direction > > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::asPermutation
inherited
621{
622 return derived();
623}

◆ bdcSvd()

BDCSVD< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::bdcSvd ( unsigned int  computationOptions = 0) const
inlineinherited

\svd_module

Returns
the singular value decomposition of *this computed by Divide & Conquer algorithm
See also
class BDCSVD
1239{
1240 return BDCSVD<PlainObject>(*this, computationOptions);
1241}

◆ blueNorm()

NumTraits< typenameinternal::traits< Homogeneous< MatrixType, _Direction > >::Scalar >::Real Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::blueNorm
inlineinherited
Returns
the l2 norm of *this using the Blue's algorithm. A Portable Fortran Program to Find the Euclidean Norm of a Vector, ACM TOMS, Vol 4, Issue 1, 1978.

For architecture/scalar types without vectorization, this version is much faster than stableNorm(). Otherwise the stableNorm() is faster.

See also
norm(), stableNorm(), hypotNorm()
203{
204 return internal::blueNorm_impl(*this);
205}

◆ colPivHouseholderQr()

const ColPivHouseholderQR< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::colPivHouseholderQr
inlineinherited
Returns
the column-pivoting Householder QR decomposition of *this.
See also
class ColPivHouseholderQR
647{
648 return ColPivHouseholderQR<PlainObject>(eval());
649}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval() const
Definition DenseBase.h:401

◆ cols()

template<typename MatrixType , int _Direction>
EIGEN_DEVICE_FUNC Index Eigen::Homogeneous< MatrixType, _Direction >::cols ( ) const
inline

◆ colwise() [1/2]

template<typename Derived >
DenseBase< Derived >::ColwiseReturnType Eigen::DenseBase< Derived >::colwise
inlineinherited
Returns
a writable VectorwiseOp wrapper of *this providing additional partial reduction operations
See also
rowwise(), class VectorwiseOp, TutorialReductionsVisitorsBroadcasting
675{
676 return ColwiseReturnType(derived());
677}
VectorwiseOp< Derived, Vertical > ColwiseReturnType
Definition DenseBase.h:493

◆ colwise() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC ConstColwiseReturnType Eigen::DenseBase< Derived >::colwise ( ) const
inlineinherited
Returns
a VectorwiseOp wrapper of *this providing additional partial reduction operations

Example:

Output:

See also
rowwise(), class VectorwiseOp, TutorialReductionsVisitorsBroadcasting
516 {
517 return ConstColwiseReturnType(derived());
518 }
const VectorwiseOp< const Derived, Vertical > ConstColwiseReturnType
Definition DenseBase.h:494

Referenced by igl::bounding_box(), igl::copyleft::offset_surface(), and Eigen::umeyama().

+ Here is the caller graph for this function:

◆ completeOrthogonalDecomposition()

const CompleteOrthogonalDecomposition< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::completeOrthogonalDecomposition
inlineinherited
Returns
the complete orthogonal decomposition of *this.
See also
class CompleteOrthogonalDecomposition
556 {
557 return CompleteOrthogonalDecomposition<PlainObject>(eval());
558}

◆ computeInverseAndDetWithCheck()

void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::computeInverseAndDetWithCheck ( ResultType &  inverse,
typename ResultType::Scalar &  determinant,
bool &  invertible,
const RealScalar absDeterminantThreshold = NumTraits<Scalar>::dummy_precision() 
) const
inlineinherited

\lu_module

Computation of matrix inverse and determinant, with invertibility check.

This is only for fixed-size square matrices of size up to 4x4.

Parameters
inverseReference to the matrix in which to store the inverse.
determinantReference to the variable in which to store the determinant.
invertibleReference to the bool variable in which to store whether the matrix is invertible.
absDeterminantThresholdOptional parameter controlling the invertibility check. The matrix will be declared invertible if the absolute value of its determinant is greater than this threshold.

Example:

Output:

See also
inverse(), computeInverseWithCheck()
368{
369 // i'd love to put some static assertions there, but SFINAE means that they have no effect...
370 eigen_assert(rows() == cols());
371 // for 2x2, it's worth giving a chance to avoid evaluating.
372 // for larger sizes, evaluating has negligible cost and limits code size.
373 typedef typename internal::conditional<
375 typename internal::remove_all<typename internal::nested_eval<Derived, 2>::type>::type,
377 >::type MatrixType;
378 internal::compute_inverse_and_det_with_check<MatrixType, ResultType>::run
379 (derived(), absDeterminantThreshold, inverse, determinant, invertible);
380}
EIGEN_DEVICE_FUNC const InverseReturnType inverse() const
Definition ArrayCwiseUnaryOps.h:332
#define eigen_assert(x)
Definition Macros.h:579
Base::PlainObject PlainObject
Definition MatrixBase.h:103

◆ computeInverseWithCheck()

void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::computeInverseWithCheck ( ResultType &  inverse,
bool &  invertible,
const RealScalar absDeterminantThreshold = NumTraits<Scalar>::dummy_precision() 
) const
inlineinherited

\lu_module

Computation of matrix inverse, with invertibility check.

This is only for fixed-size square matrices of size up to 4x4.

Parameters
inverseReference to the matrix in which to store the inverse.
invertibleReference to the bool variable in which to store whether the matrix is invertible.
absDeterminantThresholdOptional parameter controlling the invertibility check. The matrix will be declared invertible if the absolute value of its determinant is greater than this threshold.

Example:

Output:

See also
inverse(), computeInverseAndDetWithCheck()
406{
408 // i'd love to put some static assertions there, but SFINAE means that they have no effect...
409 eigen_assert(rows() == cols());
410 computeInverseAndDetWithCheck(inverse,determinant,invertible,absDeterminantThreshold);
411}
Scalar determinant() const
Definition Determinant.h:92
void computeInverseAndDetWithCheck(ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition InverseImpl.h:362

◆ Constant() [1/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Constant ( const Scalar value)
staticinherited
Returns
an expression of a constant matrix of value value

This variant is only for fixed-size DenseBase types. For dynamic-size types, you need to use the variants taking size arguments.

The template parameter CustomNullaryOp is the type of the functor.

See also
class CwiseNullaryOp
213{
215 return DenseBase<Derived>::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_constant_op<Scalar>(value));
216}
#define EIGEN_STATIC_ASSERT_FIXED_SIZE(TYPE)
Definition StaticAssert.h:144
EIGEN_DEVICE_FUNC CoeffReturnType value() const
Definition DenseBase.h:480
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > NullaryExpr(Index rows, Index cols, const CustomNullaryOp &func)

References EIGEN_STATIC_ASSERT_FIXED_SIZE, and Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ Constant() [2/3]

template<typename Derived >
EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Constant ( Index  rows,
Index  cols,
const Scalar value 
)
staticinherited
Returns
an expression of a constant matrix of value value

The parameters rows and cols are the number of rows and of columns of the returned matrix. Must be compatible with this DenseBase type.

This variant is meant to be used for dynamic-size matrix types. For fixed-size types, it is redundant to pass rows and cols as arguments, so Zero() should be used instead.

The template parameter CustomNullaryOp is the type of the functor.

See also
class CwiseNullaryOp
175{
176 return DenseBase<Derived>::NullaryExpr(rows, cols, internal::scalar_constant_op<Scalar>(value));
177}

References Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ Constant() [3/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Constant ( Index  size,
const Scalar value 
)
staticinherited
Returns
an expression of a constant matrix of value value

The parameter size is the size of the returned vector. Must be compatible with this DenseBase type.

\only_for_vectors

This variant is meant to be used for dynamic-size vector types. For fixed-size types, it is redundant to pass size as argument, so Zero() should be used instead.

The template parameter CustomNullaryOp is the type of the functor.

See also
class CwiseNullaryOp
197{
198 return DenseBase<Derived>::NullaryExpr(size, internal::scalar_constant_op<Scalar>(value));
199}

References Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ count()

template<typename Derived >
Eigen::Index Eigen::DenseBase< Derived >::count
inlineinherited
Returns
the number of coefficients which evaluate to true
See also
all(), any()
130{
131 return derived().template cast<bool>().template cast<Index>().sum();
132}

◆ cross() [1/2]

EIGEN_DEVICE_FUNC cross_product_return_type< OtherDerived >::type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::cross ( const MatrixBase< OtherDerived > &  other) const
inlineinherited

◆ cross() [2/2]

EIGEN_DEVICE_FUNC MatrixBase< Homogeneous< MatrixType, _Direction > >::template cross_product_return_type< OtherDerived >::type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::cross ( const MatrixBase< OtherDerived > &  other) const
inlineinherited

\geometry_module

Returns
the cross product of *this and other

Here is a very good explanation of cross-product: http://xkcd.com/199/

With complex numbers, the cross product is implemented as $ (\mathbf{a}+i\mathbf{b}) \times (\mathbf{c}+i\mathbf{d}) = (\mathbf{a} \times \mathbf{c} - \mathbf{b} \times \mathbf{d}) - i(\mathbf{a} \times \mathbf{d} - \mathbf{b} \times \mathbf{c})$

See also
MatrixBase::cross3()
35{
38
39 // Note that there is no need for an expression here since the compiler
40 // optimize such a small temporary very well (even within a complex expression)
41 typename internal::nested_eval<Derived,2>::type lhs(derived());
42 typename internal::nested_eval<OtherDerived,2>::type rhs(other.derived());
43 return typename cross_product_return_type<OtherDerived>::type(
44 numext::conj(lhs.coeff(1) * rhs.coeff(2) - lhs.coeff(2) * rhs.coeff(1)),
45 numext::conj(lhs.coeff(2) * rhs.coeff(0) - lhs.coeff(0) * rhs.coeff(2)),
46 numext::conj(lhs.coeff(0) * rhs.coeff(1) - lhs.coeff(1) * rhs.coeff(0))
47 );
48}
#define EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE)
Definition StaticAssert.h:154

◆ cross3()

EIGEN_DEVICE_FUNC MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::cross3 ( const MatrixBase< OtherDerived > &  other) const
inlineinherited

\geometry_module

Returns
the cross product of *this and other using only the x, y, and z coefficients

The size of *this and other must be four. This function is especially useful when using 4D vectors instead of 3D ones to get advantage of SSE/AltiVec vectorization.

See also
MatrixBase::cross()
83{
86
87 typedef typename internal::nested_eval<Derived,2>::type DerivedNested;
88 typedef typename internal::nested_eval<OtherDerived,2>::type OtherDerivedNested;
89 DerivedNested lhs(derived());
90 OtherDerivedNested rhs(other.derived());
91
92 return internal::cross3_impl<Architecture::Target,
93 typename internal::remove_all<DerivedNested>::type,
94 typename internal::remove_all<OtherDerivedNested>::type>::run(lhs,rhs);
95}

◆ cwiseProduct()

EIGEN_STRONG_INLINE const SparseMatrixBase< OtherDerived >::template CwiseProductDenseReturnType< Homogeneous< MatrixType, _Direction > >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::cwiseProduct ( const SparseMatrixBase< OtherDerived > &  other) const
inlineinherited
440 {
441 return other.cwiseProduct(derived());
442 }

◆ determinant()

internal::traits< Homogeneous< MatrixType, _Direction > >::Scalar Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::determinant
inlineinherited

\lu_module

Returns
the determinant of this matrix
93{
94 eigen_assert(rows() == cols());
95 typedef typename internal::nested_eval<Derived,Base::RowsAtCompileTime>::type Nested;
96 return internal::determinant_impl<typename internal::remove_all<Nested>::type>::run(derived());
97}

◆ diagonal() [1/6]

MatrixBase< Homogeneous< MatrixType, _Direction > >::template DiagonalIndexReturnType< Index_ >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::diagonal
inlineinherited
Returns
an expression of the main diagonal of the matrix *this

*this is not required to be square.

Example:

Output:

See also
class Diagonal
Returns
an expression of the DiagIndex-th sub or super diagonal of the matrix *this

*this is not required to be square.

The template parameter DiagIndex represent a super diagonal if DiagIndex > 0 and a sub diagonal otherwise. DiagIndex == 0 is equivalent to the main diagonal.

Example:

Output:

See also
MatrixBase::diagonal(), class Diagonal
192{
193 return DiagonalReturnType(derived());
194}
Diagonal< Homogeneous< MatrixType, _Direction > > DiagonalReturnType
Definition MatrixBase.h:205

◆ diagonal() [2/6]

EIGEN_DEVICE_FUNC DiagonalIndexReturnType< Index >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::diagonal ( )
inherited

◆ diagonal() [3/6]

MatrixBase< Homogeneous< MatrixType, _Direction > >::template ConstDiagonalIndexReturnType< Index_ >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::diagonal
inlineinherited

This is the const version of diagonal().

This is the const version of diagonal<int>().

200{
201 return ConstDiagonalReturnType(derived());
202}
internal::add_const< Diagonal< constDerived > >::type ConstDiagonalReturnType
Definition MatrixBase.h:209

◆ diagonal() [4/6]

EIGEN_DEVICE_FUNC ConstDiagonalIndexReturnType< Index >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::diagonal ( ) const
inherited

◆ diagonal() [5/6]

MatrixBase< Homogeneous< MatrixType, _Direction > >::DiagonalDynamicIndexReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::diagonal ( Index  index)
inlineinherited
Returns
an expression of the DiagIndex-th sub or super diagonal of the matrix *this

*this is not required to be square.

The template parameter DiagIndex represent a super diagonal if DiagIndex > 0 and a sub diagonal otherwise. DiagIndex == 0 is equivalent to the main diagonal.

Example:

Output:

See also
MatrixBase::diagonal(), class Diagonal
218{
219 return DiagonalDynamicIndexReturnType(derived(), index);
220}
Diagonal< Homogeneous< MatrixType, _Direction >, DynamicIndex > DiagonalDynamicIndexReturnType
Definition MatrixBase.h:224

◆ diagonal() [6/6]

MatrixBase< Homogeneous< MatrixType, _Direction > >::ConstDiagonalDynamicIndexReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::diagonal ( Index  index) const
inlineinherited

This is the const version of diagonal(Index).

226{
227 return ConstDiagonalDynamicIndexReturnType(derived(), index);
228}
internal::add_const< Diagonal< constDerived, DynamicIndex > >::type ConstDiagonalDynamicIndexReturnType
Definition MatrixBase.h:225

◆ diagonalSize()

EIGEN_DEVICE_FUNC Index Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::diagonalSize ( ) const
inlineinherited
Returns
the size of the main diagonal, which is min(rows(),cols()).
See also
rows(), cols(), SizeAtCompileTime.
101{ return (numext::mini)(rows(),cols()); }

◆ dot() [1/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarBinaryOpTraits< typenameinternal::traits< Homogeneous< MatrixType, _Direction > >::Scalar, typenameinternal::traits< OtherDerived >::Scalar >::ReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::dot ( const MatrixBase< OtherDerived > &  other) const
inherited
73{
76 EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived)
77#if !(defined(EIGEN_NO_STATIC_ASSERT) && defined(EIGEN_NO_DEBUG))
78 typedef internal::scalar_conj_product_op<Scalar,typename OtherDerived::Scalar> func;
79 EIGEN_CHECK_BINARY_COMPATIBILIY(func,Scalar,typename OtherDerived::Scalar);
80#endif
81
82 eigen_assert(size() == other.size());
83
84 return internal::dot_nocheck<Derived,OtherDerived>::run(*this, other);
85}
#define EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(TYPE0, TYPE1)
Definition StaticAssert.h:164
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition StaticAssert.h:139
#define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP, LHS, RHS)
Definition XprHelper.h:815
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183

◆ dot() [2/2]

Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::dot ( const MatrixBase< OtherDerived > &  other) const
inherited
Returns
the dot product of *this with other.

\only_for_vectors

Note
If the scalar type is complex numbers, then this function returns the hermitian (sesquilinear) dot product, conjugate-linear in the first variable and linear in the second variable.
See also
squaredNorm(), norm()

◆ EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE()

typedef Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE ( ConstStartMinusOne  ,
Scalar  ,
quotient   
)
inherited

◆ eigenvalues()

MatrixBase< Homogeneous< MatrixType, _Direction > >::EigenvaluesReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::eigenvalues
inlineinherited

Computes the eigenvalues of a matrix.

Returns
Column vector containing the eigenvalues.

\eigenvalues_module This function computes the eigenvalues with the help of the EigenSolver class (for real matrices) or the ComplexEigenSolver class (for complex matrices).

The eigenvalues are repeated according to their algebraic multiplicity, so there are as many eigenvalues as rows in the matrix.

The SelfAdjointView class provides a better algorithm for selfadjoint matrices.

Example:

Output:

See also
EigenSolver::eigenvalues(), ComplexEigenSolver::eigenvalues(), SelfAdjointView::eigenvalues()
68{
69 return internal::eigenvalues_selector<Derived, NumTraits<Scalar>::IsComplex>::run(derived());
70}

◆ eulerAngles()

EIGEN_DEVICE_FUNC Matrix< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::Scalar, 3, 1 > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::eulerAngles ( Index  a0,
Index  a1,
Index  a2 
) const
inlineinherited

\geometry_module

Returns
the Euler-angles of the rotation matrix *this using the convention defined by the triplet (a0,a1,a2)

Each of the three parameters a0,a1,a2 represents the respective rotation axis as an integer in {0,1,2}. For instance, in:

Vector3f ea = mat.eulerAngles(2, 0, 2);

"2" represents the z axis and "0" the x axis, etc. The returned angles are such that we have the following equality:

mat == AngleAxisf(ea[0], Vector3f::UnitZ())
* AngleAxisf(ea[1], Vector3f::UnitX())
* AngleAxisf(ea[2], Vector3f::UnitZ());
AngleAxis< float > AngleAxisf
Definition AngleAxis.h:157

This corresponds to the right-multiply conventions (with right hand side frames).

The returned angles are in the ranges [0:pi]x[-pi:pi]x[-pi:pi].

See also
class AngleAxis
38{
39 EIGEN_USING_STD_MATH(atan2)
40 EIGEN_USING_STD_MATH(sin)
41 EIGEN_USING_STD_MATH(cos)
42 /* Implemented from Graphics Gems IV */
44
45 Matrix<Scalar,3,1> res;
46 typedef Matrix<typename Derived::Scalar,2,1> Vector2;
47
48 const Index odd = ((a0+1)%3 == a1) ? 0 : 1;
49 const Index i = a0;
50 const Index j = (a0 + 1 + odd)%3;
51 const Index k = (a0 + 2 - odd)%3;
52
53 if (a0==a2)
54 {
55 res[0] = atan2(coeff(j,i), coeff(k,i));
56 if((odd && res[0]<Scalar(0)) || ((!odd) && res[0]>Scalar(0)))
57 {
58 if(res[0] > Scalar(0)) {
59 res[0] -= Scalar(EIGEN_PI);
60 }
61 else {
62 res[0] += Scalar(EIGEN_PI);
63 }
64 Scalar s2 = Vector2(coeff(j,i), coeff(k,i)).norm();
65 res[1] = -atan2(s2, coeff(i,i));
66 }
67 else
68 {
69 Scalar s2 = Vector2(coeff(j,i), coeff(k,i)).norm();
70 res[1] = atan2(s2, coeff(i,i));
71 }
72
73 // With a=(0,1,0), we have i=0; j=1; k=2, and after computing the first two angles,
74 // we can compute their respective rotation, and apply its inverse to M. Since the result must
75 // be a rotation around x, we have:
76 //
77 // c2 s1.s2 c1.s2 1 0 0
78 // 0 c1 -s1 * M = 0 c3 s3
79 // -s2 s1.c2 c1.c2 0 -s3 c3
80 //
81 // Thus: m11.c1 - m21.s1 = c3 & m12.c1 - m22.s1 = s3
82
83 Scalar s1 = sin(res[0]);
84 Scalar c1 = cos(res[0]);
85 res[2] = atan2(c1*coeff(j,k)-s1*coeff(k,k), c1*coeff(j,j) - s1 * coeff(k,j));
86 }
87 else
88 {
89 res[0] = atan2(coeff(j,k), coeff(k,k));
90 Scalar c2 = Vector2(coeff(i,i), coeff(i,j)).norm();
91 if((odd && res[0]<Scalar(0)) || ((!odd) && res[0]>Scalar(0))) {
92 if(res[0] > Scalar(0)) {
93 res[0] -= Scalar(EIGEN_PI);
94 }
95 else {
96 res[0] += Scalar(EIGEN_PI);
97 }
98 res[1] = atan2(-coeff(i,k), -c2);
99 }
100 else
101 res[1] = atan2(-coeff(i,k), c2);
102 Scalar s1 = sin(res[0]);
103 Scalar c1 = cos(res[0]);
104 res[2] = atan2(s1*coeff(k,i)-c1*coeff(j,i), c1*coeff(j,j) - s1 * coeff(k,j));
105 }
106 if (!odd)
107 res = -res;
108
109 return res;
110}
#define EIGEN_PI
Definition MathFunctions.h:15
#define EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(TYPE, ROWS, COLS)
Definition StaticAssert.h:159
#define const
Definition getopt.c:38
if(!(yy_init))
Definition lexer.c:1190
typename Traits< remove_cvref_t< L > >::Scalar Scalar
Definition Line.hpp:36

◆ eval()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType Eigen::DenseBase< Homogeneous< MatrixType, _Direction > >::eval ( ) const
inlineinherited
Returns
the matrix or vector obtained by evaluating this expression.

Notice that in the case of a plain matrix or vector (not an expression) this function just returns a const reference, in order to avoid a useless copy.

Warning
Be carefull with eval() and the auto C++ keyword, as detailed in this page .
402 {
403 // Even though MSVC does not honor strong inlining when the return type
404 // is a dynamic matrix, we desperately need strong inlining for fixed
405 // size types on MSVC.
406 return typename internal::eval<Derived>::type(derived());
407 }

◆ evalTo()

template<typename Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::evalTo ( Dest &  ) const
inlineinherited
585 {
586 EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
587 }
@ value
Definition Meta.h:63

References EIGEN_STATIC_ASSERT.

◆ fill()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::DenseBase< Derived >::fill ( const Scalar val)
inherited

Alias for setConstant(): sets all coefficients in this expression to val.

See also
setConstant(), Constant(), class CwiseNullaryOp
316{
317 setConstant(val);
318}
EIGEN_DEVICE_FUNC Derived & setConstant(const Scalar &value)
Definition CwiseNullaryOp.h:325

◆ flagged()

template<typename Derived >
template<unsigned int Added, unsigned int Removed>
EIGEN_DEPRECATED const Derived & Eigen::DenseBase< Derived >::flagged ( ) const
inlineinherited
313 { return derived(); }

◆ forceAlignedAccess() [1/2]

ForceAlignedAccess< Homogeneous< MatrixType, _Direction > > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::forceAlignedAccess
inlineinherited
Returns
an expression of *this with forced aligned access
See also
forceAlignedAccessIf(), class ForceAlignedAccess
304{ return derived(); }

◆ forceAlignedAccess() [2/2]

const ForceAlignedAccess< Homogeneous< MatrixType, _Direction > > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::forceAlignedAccess
inlineinherited
Returns
an expression of *this with forced aligned access
See also
forceAlignedAccessIf(),class ForceAlignedAccess
303{ return derived(); }

◆ forceAlignedAccessIf() [1/4]

internal::conditional< Enable, ForceAlignedAccess< Homogeneous< MatrixType, _Direction > >, Homogeneous< MatrixType, _Direction > & >::type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::forceAlignedAccessIf ( )
inlineinherited
Returns
an expression of *this with forced aligned access if Enable is true.
See also
forceAlignedAccess(), class ForceAlignedAccess
140{
141 return derived(); // FIXME This should not work but apparently is never used
142}

◆ forceAlignedAccessIf() [2/4]

Homogeneous< MatrixType, _Direction > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::forceAlignedAccessIf ( )
inlineinherited
306{ return derived(); }

◆ forceAlignedAccessIf() [3/4]

internal::add_const_on_value_type< typenameinternal::conditional< Enable, ForceAlignedAccess< Homogeneous< MatrixType, _Direction > >, Homogeneous< MatrixType, _Direction > & >::type >::type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::forceAlignedAccessIf ( ) const
inlineinherited
Returns
an expression of *this with forced aligned access if Enable is true.
See also
forceAlignedAccess(), class ForceAlignedAccess
129{
130 return derived(); // FIXME This should not work but apparently is never used
131}

◆ forceAlignedAccessIf() [4/4]

const Homogeneous< MatrixType, _Direction > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::forceAlignedAccessIf ( ) const
inlineinherited
305{ return derived(); }

◆ format()

template<typename Derived >
const WithFormat< Derived > Eigen::DenseBase< Derived >::format ( const IOFormat fmt) const
inlineinherited
Returns
a WithFormat proxy object allowing to print a matrix the with given format fmt.

See class IOFormat for some examples.

See also
class IOFormat, class WithFormat
474 {
475 return WithFormat<Derived>(derived(), fmt);
476 }

Referenced by igl::matlab_format(), and igl::writeOBJ().

+ Here is the caller graph for this function:

◆ fullPivHouseholderQr()

const FullPivHouseholderQR< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::fullPivHouseholderQr
inlineinherited
Returns
the full-pivoting Householder QR decomposition of *this.
See also
class FullPivHouseholderQR
670{
671 return FullPivHouseholderQR<PlainObject>(eval());
672}

◆ fullPivLu()

const FullPivLU< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::fullPivLu
inlineinherited

\lu_module

Returns
the full-pivoting LU decomposition of *this.
See also
class FullPivLU
885{
886 return FullPivLU<PlainObject>(eval());
887}

◆ hasNaN()

template<typename Derived >
bool Eigen::DenseBase< Derived >::hasNaN
inlineinherited
Returns
true is *this contains at least one Not A Number (NaN).
See also
allFinite()
140{
141#if EIGEN_COMP_MSVC || (defined __FAST_MATH__)
142 return derived().array().isNaN().any();
143#else
144 return !((derived().array()==derived().array()).all());
145#endif
146}
EIGEN_DEVICE_FUNC bool all() const
Definition BooleanRedux.h:81

◆ hnormalized()

EIGEN_DEVICE_FUNC const MatrixBase< Homogeneous< MatrixType, _Direction > >::HNormalizedReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::hnormalized
inlineinherited

homogeneous normalization

\geometry_module

Returns
a vector expression of the N-1 first coefficients of *this divided by that last coefficient.

This can be used to convert homogeneous coordinates to affine coordinates.

It is essentially a shortcut for:

this->head(this->size()-1)/this->coeff(this->size()-1);
EIGEN_DEVICE_FUNC SegmentReturnType head(Index n)
This is the const version of head(Index).
Definition BlockMethods.h:919

Example:

Output:

See also
VectorwiseOp::hnormalized()
173{
175 return ConstStartMinusOne(derived(),0,0,
176 ColsAtCompileTime==1?size()-1:1,
177 ColsAtCompileTime==1?1:size()-1) / coeff(size()-1);
178}
Block< const Homogeneous< MatrixType, _Direction >, internal::traits< Homogeneous< MatrixType, _Direction > >::ColsAtCompileTime==1 ? SizeMinusOne :1, internal::traits< Homogeneous< MatrixType, _Direction > >::ColsAtCompileTime==1 ? 1 :SizeMinusOne > ConstStartMinusOne
Definition MatrixBase.h:408

◆ homogeneous()

EIGEN_DEVICE_FUNC MatrixBase< Homogeneous< MatrixType, _Direction > >::HomogeneousReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::homogeneous
inlineinherited

\geometry_module

Returns
a vector expression that is one longer than the vector argument, with the value 1 symbolically appended as the last coefficient.

This can be used to convert affine coordinates to homogeneous coordinates.

\only_for_vectors

Example:

Output:

See also
VectorwiseOp::homogeneous(), class Homogeneous
131{
133 return HomogeneousReturnType(derived());
134}
Homogeneous< Homogeneous< MatrixType, _Direction >, HomogeneousReturnTypeDirection > HomogeneousReturnType
Definition MatrixBase.h:399

◆ householderQr()

const HouseholderQR< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::householderQr
inlineinherited
Returns
the Householder QR decomposition of *this.
See also
class HouseholderQR
403{
404 return HouseholderQR<PlainObject>(eval());
405}

◆ hypotNorm()

NumTraits< typenameinternal::traits< Homogeneous< MatrixType, _Direction > >::Scalar >::Real Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::hypotNorm
inlineinherited
Returns
the l2 norm of *this avoiding undeflow and overflow. This version use a concatenation of hypot() calls, and it is very slow.
See also
norm(), stableNorm()
215{
216 return this->cwiseAbs().redux(internal::scalar_hypot_op<RealScalar>());
217}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() const
Definition MatrixCwiseUnaryOps.h:32

◆ Identity() [1/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Homogeneous< MatrixType, _Direction > >::IdentityReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::Identity
staticinherited
Returns
an expression of the identity matrix (not necessarily square).

This variant is only for fixed-size MatrixBase types. For dynamic-size types, you need to use the variant taking size arguments.

Example:

Output:

See also
Identity(Index,Index), setIdentity(), isIdentity()
701{
703 return MatrixBase<Derived>::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_identity_op<Scalar>());
704}

◆ Identity() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Homogeneous< MatrixType, _Direction > >::IdentityReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::Identity ( Index  rows,
Index  cols 
)
staticinherited
Returns
an expression of the identity matrix (not necessarily square).

The parameters rows and cols are the number of rows and of columns of the returned matrix. Must be compatible with this MatrixBase type.

This variant is meant to be used for dynamic-size matrix types. For fixed-size types, it is redundant to pass rows and cols as arguments, so Identity() should be used instead.

Example:

Output:

See also
Identity(), setIdentity(), isIdentity()
684{
685 return DenseBase<Derived>::NullaryExpr(rows, cols, internal::scalar_identity_op<Scalar>());
686}

◆ innerSize()

template<typename Derived >
EIGEN_DEVICE_FUNC Index Eigen::DenseBase< Derived >::innerSize ( ) const
inlineinherited
Returns
the inner size.
Note
For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension with respect to the storage order, i.e., the number of rows for a column-major matrix, and the number of columns for a row-major matrix.
231 {
232 return IsVectorAtCompileTime ? this->size()
233 : int(IsRowMajor) ? this->cols() : this->rows();
234 }

References Eigen::DenseBase< Derived >::IsRowMajor, and Eigen::DenseBase< Derived >::IsVectorAtCompileTime.

◆ inverse()

const Inverse< Homogeneous< MatrixType, _Direction > > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::inverse
inlineinherited

\lu_module

Returns
the matrix inverse of this matrix.

For small fixed sizes up to 4x4, this method uses cofactors. In the general case, this method uses class PartialPivLU.

Note
This matrix must be invertible, otherwise the result is undefined. If you need an invertibility check, do the following: Example:
Output:
See also
computeInverseAndDetWithCheck()
336{
337 EIGEN_STATIC_ASSERT(!NumTraits<Scalar>::IsInteger,THIS_FUNCTION_IS_NOT_FOR_INTEGER_NUMERIC_TYPES)
338 eigen_assert(rows() == cols());
339 return Inverse<Derived>(derived());
340}

◆ isApprox() [1/2]

template<typename Derived >
template<typename OtherDerived >
bool Eigen::DenseBase< Derived >::isApprox ( const DenseBase< OtherDerived > &  other,
const RealScalar prec 
) const
inherited
Returns
true if *this is approximately equal to other, within the precision determined by prec.
Note
The fuzzy compares are done multiplicatively. Two vectors $ v $ and $ w $ are considered to be approximately equal within precision $ p $ if

\[ \Vert v - w \Vert \leqslant p\,\min(\Vert v\Vert, \Vert w\Vert). \]

For matrices, the comparison is done using the Hilbert-Schmidt norm (aka Frobenius norm L2 norm).
Because of the multiplicativeness of this comparison, one can't use this function to check whether *this is approximately equal to the zero matrix or vector. Indeed, isApprox(zero) returns false unless *this itself is exactly the zero matrix or vector. If you want to test whether *this is zero, use internal::isMuchSmallerThan(const RealScalar&, RealScalar) instead.
See also
internal::isMuchSmallerThan(const RealScalar&, RealScalar) const
107{
108 return internal::isApprox_selector<Derived, OtherDerived>::run(derived(), other.derived(), prec);
109}
static EIGEN_DEVICE_FUNC bool run(const Derived &x, const OtherDerived &y, const typename Derived::RealScalar &prec)
Definition Fuzzy.h:23

References Eigen::internal::isApprox_selector< Derived, OtherDerived, is_integer >::run().

+ Here is the call graph for this function:

◆ isApprox() [2/2]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isApprox ( const DenseBase< OtherDerived > &  other,
const RealScalar prec = NumTraitsScalar >::dummy_precision() 
) const
inherited

◆ isApproxToConstant()

template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isApproxToConstant ( const Scalar val,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
inherited
Returns
true if all coefficients in this matrix are approximately equal to val, to within precision prec
291{
292 typename internal::nested_eval<Derived,1>::type self(derived());
293 for(Index j = 0; j < cols(); ++j)
294 for(Index i = 0; i < rows(); ++i)
295 if(!internal::isApprox(self.coeff(i, j), val, prec))
296 return false;
297 return true;
298}

References Eigen::internal::isApprox().

+ Here is the call graph for this function:

◆ isConstant()

template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isConstant ( const Scalar val,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
inherited

This is just an alias for isApproxToConstant().

Returns
true if all coefficients in this matrix are approximately equal to value, to within precision prec
306{
307 return isApproxToConstant(val, prec);
308}
EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition CwiseNullaryOp.h:290

◆ isDiagonal()

bool Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::isDiagonal ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
inherited
Returns
true if *this is approximately equal to a diagonal matrix, within the precision given by prec.

Example:

Output:

See also
asDiagonal()
292{
293 if(cols() != rows()) return false;
294 RealScalar maxAbsOnDiagonal = static_cast<RealScalar>(-1);
295 for(Index j = 0; j < cols(); ++j)
296 {
297 RealScalar absOnDiagonal = numext::abs(coeff(j,j));
298 if(absOnDiagonal > maxAbsOnDiagonal) maxAbsOnDiagonal = absOnDiagonal;
299 }
300 for(Index j = 0; j < cols(); ++j)
301 for(Index i = 0; i < j; ++i)
302 {
303 if(!internal::isMuchSmallerThan(coeff(i, j), maxAbsOnDiagonal, prec)) return false;
304 if(!internal::isMuchSmallerThan(coeff(j, i), maxAbsOnDiagonal, prec)) return false;
305 }
306 return true;
307}
NumTraits< Scalar >::Real RealScalar
Definition MatrixBase.h:58

◆ isIdentity()

bool Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::isIdentity ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
inherited
Returns
true if *this is approximately equal to the identity matrix (not necessarily square), within the precision given by prec.

Example:

Output:

See also
class CwiseNullaryOp, Identity(), Identity(Index,Index), setIdentity()
718{
719 typename internal::nested_eval<Derived,1>::type self(derived());
720 for(Index j = 0; j < cols(); ++j)
721 {
722 for(Index i = 0; i < rows(); ++i)
723 {
724 if(i == j)
725 {
726 if(!internal::isApprox(self.coeff(i, j), static_cast<Scalar>(1), prec))
727 return false;
728 }
729 else
730 {
731 if(!internal::isMuchSmallerThan(self.coeff(i, j), static_cast<RealScalar>(1), prec))
732 return false;
733 }
734 }
735 }
736 return true;
737}

◆ isLowerTriangular()

bool Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::isLowerTriangular ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
inherited
Returns
true if *this is approximately equal to a lower triangular matrix, within the precision given by prec.
See also
isUpperTriangular()
674{
675 RealScalar maxAbsOnLowerPart = static_cast<RealScalar>(-1);
676 for(Index j = 0; j < cols(); ++j)
677 for(Index i = j; i < rows(); ++i)
678 {
679 RealScalar absValue = numext::abs(coeff(i,j));
680 if(absValue > maxAbsOnLowerPart) maxAbsOnLowerPart = absValue;
681 }
682 RealScalar threshold = maxAbsOnLowerPart * prec;
683 for(Index j = 1; j < cols(); ++j)
684 {
685 Index maxi = numext::mini(j, rows()-1);
686 for(Index i = 0; i < maxi; ++i)
687 if(numext::abs(coeff(i, j)) > threshold) return false;
688 }
689 return true;
690}
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
Definition MathFunctions.h:823

◆ isMuchSmallerThan() [1/4]

template<typename Derived >
template<typename OtherDerived >
bool Eigen::DenseBase< Derived >::isMuchSmallerThan ( const DenseBase< OtherDerived > &  other,
const RealScalar prec 
) const
inherited
Returns
true if the norm of *this is much smaller than the norm of other, within the precision determined by prec.
Note
The fuzzy compares are done multiplicatively. A vector $ v $ is considered to be much smaller than a vector $ w $ within precision $ p $ if

\[ \Vert v \Vert \leqslant p\,\Vert w\Vert. \]

For matrices, the comparison is done using the Hilbert-Schmidt norm.
See also
isApprox(), isMuchSmallerThan(const RealScalar&, RealScalar) const
149{
151}
static EIGEN_DEVICE_FUNC bool run(const Derived &x, const OtherDerived &y, const typename Derived::RealScalar &prec)
Definition Fuzzy.h:45

References Eigen::internal::isMuchSmallerThan_object_selector< Derived, OtherDerived, is_integer >::run().

+ Here is the call graph for this function:

◆ isMuchSmallerThan() [2/4]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isMuchSmallerThan ( const DenseBase< OtherDerived > &  other,
const RealScalar prec = NumTraitsScalar >::dummy_precision() 
) const
inherited

◆ isMuchSmallerThan() [3/4]

template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isMuchSmallerThan ( const RealScalar other,
const RealScalar prec = NumTraitsScalar >::dummy_precision() 
) const
inherited

◆ isMuchSmallerThan() [4/4]

template<typename Derived >
template<typename Derived >
bool Eigen::DenseBase< Derived >::isMuchSmallerThan ( const typename NumTraits< Scalar >::Real &  other,
const RealScalar prec 
) const
inherited
Returns
true if the norm of *this is much smaller than other, within the precision determined by prec.
Note
The fuzzy compares are done multiplicatively. A vector $ v $ is considered to be much smaller than $ x $ within precision $ p $ if

\[ \Vert v \Vert \leqslant p\,\vert x\vert. \]

For matrices, the comparison is done using the Hilbert-Schmidt norm. For this reason, the value of the reference scalar other should come from the Hilbert-Schmidt norm of a reference matrix of same dimensions.

See also
isApprox(), isMuchSmallerThan(const DenseBase<OtherDerived>&, RealScalar) const
129{
131}
static EIGEN_DEVICE_FUNC bool run(const Derived &x, const typename Derived::RealScalar &y, const typename Derived::RealScalar &prec)
Definition Fuzzy.h:65

References Eigen::internal::isMuchSmallerThan_scalar_selector< Derived, is_integer >::run().

+ Here is the call graph for this function:

◆ isOnes()

template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isOnes ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
inherited
Returns
true if *this is approximately equal to the matrix where all coefficients are equal to 1, within the precision given by prec.

Example:

Output:

See also
class CwiseNullaryOp, Ones()
613{
614 return isApproxToConstant(Scalar(1), prec);
615}
internal::traits< Derived >::Scalar Scalar
Definition DenseBase.h:66

◆ isOrthogonal()

bool Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::isOrthogonal ( const MatrixBase< OtherDerived > &  other,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
inherited
Returns
true if *this is approximately orthogonal to other, within the precision given by prec.

Example:

Output:

 
284{
285 typename internal::nested_eval<Derived,2>::type nested(derived());
286 typename internal::nested_eval<OtherDerived,2>::type otherNested(other.derived());
287 return numext::abs2(nested.dot(otherNested)) <= prec * prec * nested.squaredNorm() * otherNested.squaredNorm();
288}

◆ isUnitary()

bool Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::isUnitary ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
inherited
Returns
true if *this is approximately an unitary matrix, within the precision given by prec. In the case where the Scalar type is real numbers, a unitary matrix is an orthogonal matrix, whence the name.
Note
This can be used to check whether a family of vectors forms an orthonormal basis. Indeed, m.isUnitary() returns true if and only if the columns (equivalently, the rows) of m form an orthonormal basis.

Example:

Output:

 
303{
304 typename internal::nested_eval<Derived,1>::type self(derived());
305 for(Index i = 0; i < cols(); ++i)
306 {
307 if(!internal::isApprox(self.col(i).squaredNorm(), static_cast<RealScalar>(1), prec))
308 return false;
309 for(Index j = 0; j < i; ++j)
310 if(!internal::isMuchSmallerThan(self.col(i).dot(self.col(j)), static_cast<Scalar>(1), prec))
311 return false;
312 }
313 return true;
314}
EIGEN_DEVICE_FUNC ScalarBinaryOpTraits< typenameinternal::traits< Homogeneous< MatrixType, _Direction > >::Scalar, typenameinternal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
EIGEN_DEVICE_FUNC RealScalar squaredNorm() const
Definition Dot.h:96

◆ isUpperTriangular()

bool Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::isUpperTriangular ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
inherited
Returns
true if *this is approximately equal to an upper triangular matrix, within the precision given by prec.
See also
isLowerTriangular()
649{
650 RealScalar maxAbsOnUpperPart = static_cast<RealScalar>(-1);
651 for(Index j = 0; j < cols(); ++j)
652 {
653 Index maxi = numext::mini(j, rows()-1);
654 for(Index i = 0; i <= maxi; ++i)
655 {
656 RealScalar absValue = numext::abs(coeff(i,j));
657 if(absValue > maxAbsOnUpperPart) maxAbsOnUpperPart = absValue;
658 }
659 }
660 RealScalar threshold = maxAbsOnUpperPart * prec;
661 for(Index j = 0; j < cols(); ++j)
662 for(Index i = j+1; i < rows(); ++i)
663 if(numext::abs(coeff(i, j)) > threshold) return false;
664 return true;
665}

◆ isZero()

template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isZero ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
inherited
Returns
true if *this is approximately equal to the zero matrix, within the precision given by prec.

Example:

Output:

See also
class CwiseNullaryOp, Zero()
482{
483 typename internal::nested_eval<Derived,1>::type self(derived());
484 for(Index j = 0; j < cols(); ++j)
485 for(Index i = 0; i < rows(); ++i)
486 if(!internal::isMuchSmallerThan(self.coeff(i, j), static_cast<Scalar>(1), prec))
487 return false;
488 return true;
489}
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition MathFunctions.h:1354

References Eigen::internal::isMuchSmallerThan().

+ Here is the call graph for this function:

◆ jacobiSvd()

JacobiSVD< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::jacobiSvd ( unsigned int  computationOptions = 0) const
inlineinherited

\svd_module

Returns
the singular value decomposition of *this computed by two-sided Jacobi transformations.
See also
class JacobiSVD
798{
799 return JacobiSVD<PlainObject>(*this, computationOptions);
800}

◆ lazyAssign() [1/2]

EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & Eigen::DenseBase< Homogeneous< MatrixType, _Direction > >::lazyAssign ( const DenseBase< OtherDerived > &  other)
inherited
21{
22 enum{
23 SameType = internal::is_same<typename Derived::Scalar,typename OtherDerived::Scalar>::value
24 };
25
27 EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived)
28 EIGEN_STATIC_ASSERT(SameType,YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
29
30 eigen_assert(rows() == other.rows() && cols() == other.cols());
31 internal::call_assignment_no_alias(derived(),other.derived());
32
33 return derived();
34}
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
Definition StaticAssert.h:199
#define EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(TYPE0, TYPE1)
Definition StaticAssert.h:189

◆ lazyAssign() [2/2]

EIGEN_DEVICE_FUNC Homogeneous< MatrixType, _Direction > & Eigen::DenseBase< Homogeneous< MatrixType, _Direction > >::lazyAssign ( const DenseBase< OtherDerived > &  other)
inherited

◆ lazyProduct() [1/2]

const Product< Homogeneous< MatrixType, _Direction > , OtherDerived, LazyProduct > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::lazyProduct ( const MatrixBase< OtherDerived > &  other) const
inherited
Returns
an expression of the matrix product of *this and other without implicit evaluation.

The returned product will behave like any other expressions: the coefficients of the product will be computed once at a time as requested. This might be useful in some extremely rare cases when only a small and no coherent fraction of the result's coefficients have to be computed.

Warning
This version of the matrix product can be much much slower. So use it only if you know what you are doing and that you measured a true speed improvement.
See also
operator*(const MatrixBase&)
433{
434 enum {
435 ProductIsValid = Derived::ColsAtCompileTime==Dynamic
436 || OtherDerived::RowsAtCompileTime==Dynamic
437 || int(Derived::ColsAtCompileTime)==int(OtherDerived::RowsAtCompileTime),
438 AreVectors = Derived::IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime,
439 SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(Derived,OtherDerived)
440 };
441 // note to the lost user:
442 // * for a dot product use: v1.dot(v2)
443 // * for a coeff-wise product use: v1.cwiseProduct(v2)
444 EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes),
445 INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS)
446 EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors),
447 INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION)
448 EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT)
449
450 return Product<Derived,OtherDerived,LazyProduct>(derived(), other.derived());
451}
#define EIGEN_PREDICATE_SAME_MATRIX_SIZE(TYPE0, TYPE1)
Definition StaticAssert.h:171

◆ lazyProduct() [2/2]

EIGEN_DEVICE_FUNC const Product< Homogeneous< MatrixType, _Direction > , OtherDerived, LazyProduct > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::lazyProduct ( const MatrixBase< OtherDerived > &  other) const
inherited

◆ ldlt()

const LDLT< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::ldlt
inlineinherited

\cholesky_module

Returns
the Cholesky decomposition with full pivoting without square root of *this
See also
SelfAdjointView::ldlt()
667{
668 return LDLT<PlainObject>(derived());
669}

◆ LinSpaced() [1/4]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::RandomAccessLinSpacedReturnType Eigen::DenseBase< Derived >::LinSpaced ( const Scalar low,
const Scalar high 
)
staticinherited

Special version for fixed size types which does not require the size parameter.

281{
284 return DenseBase<Derived>::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op<Scalar,PacketScalar>(low,high,Derived::SizeAtCompileTime));
285}

References EIGEN_STATIC_ASSERT_FIXED_SIZE, EIGEN_STATIC_ASSERT_VECTOR_ONLY, and Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ LinSpaced() [2/4]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::RandomAccessLinSpacedReturnType Eigen::DenseBase< Derived >::LinSpaced ( Index  size,
const Scalar low,
const Scalar high 
)
staticinherited

Sets a linearly spaced vector.

The function generates 'size' equally spaced values in the closed interval [low,high]. When size is set to 1, a vector of length 1 containing 'high' is returned.

\only_for_vectors

Example:

Output:

For integer scalar types, an even spacing is possible if and only if the length of the range, i.e., high-low is a scalar multiple of size-1, or if size is a scalar multiple of the number of values high-low+1 (meaning each value can be repeated the same number of time). If one of these two considions is not satisfied, then high is lowered to the largest value satisfying one of this constraint. Here are some examples:

Example:

Output:

See also
setLinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp
269{
271 return DenseBase<Derived>::NullaryExpr(size, internal::linspaced_op<Scalar,PacketScalar>(low,high,size));
272}

◆ LinSpaced() [3/4]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::RandomAccessLinSpacedReturnType Eigen::DenseBase< Derived >::LinSpaced ( Sequential_t  ,
const Scalar low,
const Scalar high 
)
staticinherited
See also
LinSpaced(Scalar,Scalar)
237{
240 return DenseBase<Derived>::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op<Scalar,PacketScalar>(low,high,Derived::SizeAtCompileTime));
241}

References EIGEN_STATIC_ASSERT_FIXED_SIZE, EIGEN_STATIC_ASSERT_VECTOR_ONLY, and Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ LinSpaced() [4/4]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::RandomAccessLinSpacedReturnType Eigen::DenseBase< Derived >::LinSpaced ( Sequential_t  ,
Index  size,
const Scalar low,
const Scalar high 
)
staticinherited
See also
LinSpaced(Index,Scalar,Scalar), setLinSpaced(Index,const Scalar&,const Scalar&)
225{
227 return DenseBase<Derived>::NullaryExpr(size, internal::linspaced_op<Scalar,PacketScalar>(low,high,size));
228}

References EIGEN_STATIC_ASSERT_VECTOR_ONLY, and Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ llt()

const LLT< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::llt
inlineinherited

\cholesky_module

Returns
the LLT decomposition of *this
See also
SelfAdjointView::llt()
525{
526 return LLT<PlainObject>(derived());
527}

◆ lpNorm() [1/2]

NumTraits< typenameinternal::traits< Homogeneous< MatrixType, _Direction > >::Scalar >::Real Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::lpNorm ( ) const
inlineinherited
Returns
the coefficient-wise $ \ell^p $ norm of *this, that is, returns the p-th root of the sum of the p-th powers of the absolute values of the coefficients of *this. If p is the special value Eigen::Infinity, this function returns the $ \ell^\infty $ norm, that is the maximum of the absolute values of the coefficients of *this.

In all cases, if *this is empty, then the value 0 is returned.

Note
For matrices, this function does not compute the operator-norm. That is, if *this is a matrix, then its coefficients are interpreted as a 1D vector. Nonetheless, you can easily compute the 1-norm and $\infty$-norm matrix operator norms using partial reductions .
See also
norm()
268{
269 return internal::lpNorm_selector<Derived, p>::run(*this);
270}

◆ lpNorm() [2/2]

EIGEN_DEVICE_FUNC RealScalar Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::lpNorm ( ) const
inherited

◆ lu()

const PartialPivLU< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::lu
inlineinherited

\lu_module

Synonym of partialPivLu().

Returns
the partial-pivoting LU decomposition of *this.
See also
class PartialPivLU
605{
606 return PartialPivLU<PlainObject>(eval());
607}

◆ makeHouseholder()

void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::makeHouseholder ( EssentialPart &  essential,
Scalar tau,
RealScalar beta 
) const
inherited

Computes the elementary reflector H such that: $ H *this = [ beta 0 ... 0]^T $ where the transformation H is: $ H = I - tau v v^*$ and the vector v is: $ v^T = [1 essential^T] $

On output:

Parameters
essentialthe essential part of the vector v
tauthe scaling factor of the Householder transformation
betathe result of H * *this
See also
MatrixBase::makeHouseholderInPlace(), MatrixBase::applyHouseholderOnTheLeft(), MatrixBase::applyHouseholderOnTheRight()
69{
70 using std::sqrt;
71 using numext::conj;
72
74 VectorBlock<const Derived, EssentialPart::SizeAtCompileTime> tail(derived(), 1, size()-1);
75
76 RealScalar tailSqNorm = size()==1 ? RealScalar(0) : tail.squaredNorm();
77 Scalar c0 = coeff(0);
78 const RealScalar tol = (std::numeric_limits<RealScalar>::min)();
79
80 if(tailSqNorm <= tol && numext::abs2(numext::imag(c0))<=tol)
81 {
82 tau = RealScalar(0);
83 beta = numext::real(c0);
84 essential.setZero();
85 }
86 else
87 {
88 beta = sqrt(numext::abs2(c0) + tailSqNorm);
89 if (numext::real(c0)>=RealScalar(0))
90 beta = -beta;
91 essential = tail / (c0 - beta);
92 tau = conj((beta - c0) / beta);
93 }
94}
EIGEN_DEVICE_FUNC SegmentReturnType tail(Index n)
This is the const version of tail(Index).
Definition BlockMethods.h:949

◆ makeHouseholderInPlace()

void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::makeHouseholderInPlace ( Scalar tau,
RealScalar beta 
)
inherited

Computes the elementary reflector H such that: $ H *this = [ beta 0 ... 0]^T $ where the transformation H is: $ H = I - tau v v^*$ and the vector v is: $ v^T = [1 essential^T] $

The essential part of the vector v is stored in *this.

On output:

Parameters
tauthe scaling factor of the Householder transformation
betathe result of H * *this
See also
MatrixBase::makeHouseholder(), MatrixBase::applyHouseholderOnTheLeft(), MatrixBase::applyHouseholderOnTheRight()
43{
44 VectorBlock<Derived, internal::decrement_size<Base::SizeAtCompileTime>::ret> essentialPart(derived(), 1, size()-1);
45 makeHouseholder(essentialPart, tau, beta);
46}
void makeHouseholder(EssentialPart &essential, Scalar &tau, RealScalar &beta) const
Definition Householder.h:65

◆ matrix() [1/2]

EIGEN_DEVICE_FUNC MatrixBase< Homogeneous< MatrixType, _Direction > > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::matrix ( )
inlineinherited
312{ return *this; }

◆ matrix() [2/2]

EIGEN_DEVICE_FUNC const MatrixBase< Homogeneous< MatrixType, _Direction > > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::matrix ( ) const
inlineinherited
313{ return *this; }

◆ matrixFunction()

const MatrixFunctionReturnValue< Homogeneous< MatrixType, _Direction > > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::matrixFunction ( StemFunction  f) const
inherited

Helper function for the unsupported MatrixFunctions module.

◆ maxCoeff() [1/3]

template<typename Derived >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::maxCoeff
inherited
Returns
the maximum of all coefficients of *this.
Warning
the result is undefined if *this contains NaN.
437{
438 return derived().redux(Eigen::internal::scalar_max_op<Scalar,Scalar>());
439}
Definition BinaryFunctors.h:167

Referenced by igl::copyleft::cgal::half_space_box(), igl::isolines(), igl::min_quad_with_fixed_precompute(), igl::octree(), Eigen::internal::lpNorm_selector< Derived, Infinity >::run(), and igl::slice().

+ Here is the caller graph for this function:

◆ maxCoeff() [2/3]

template<typename Derived >
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::maxCoeff ( IndexType *  index) const
inherited
Returns
the maximum of all coefficients of *this and puts in *index its location.
Warning
the result is undefined if *this contains NaN.
See also
DenseBase::maxCoeff(IndexType*,IndexType*), DenseBase::minCoeff(IndexType*,IndexType*), DenseBase::visitor(), DenseBase::maxCoeff()
263{
265 internal::max_coeff_visitor<Derived> maxVisitor;
266 this->visit(maxVisitor);
267 *index = (RowsAtCompileTime==1) ? maxVisitor.col : maxVisitor.row;
268 return maxVisitor.res;
269}
EIGEN_DEVICE_FUNC void visit(Visitor &func) const
Definition Visitor.h:107

References Eigen::internal::coeff_visitor< Derived >::col, EIGEN_STATIC_ASSERT_VECTOR_ONLY, Eigen::internal::coeff_visitor< Derived >::res, and Eigen::internal::coeff_visitor< Derived >::row.

◆ maxCoeff() [3/3]

template<typename Derived >
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::maxCoeff ( IndexType *  rowId,
IndexType *  colId 
) const
inherited
Returns
the maximum of all coefficients of *this and puts in *row and *col its location.
Warning
the result is undefined if *this contains NaN.
See also
DenseBase::minCoeff(IndexType*,IndexType*), DenseBase::visit(), DenseBase::maxCoeff()
245{
246 internal::max_coeff_visitor<Derived> maxVisitor;
247 this->visit(maxVisitor);
248 *rowPtr = maxVisitor.row;
249 if (colPtr) *colPtr = maxVisitor.col;
250 return maxVisitor.res;
251}

References Eigen::internal::coeff_visitor< Derived >::col, Eigen::internal::coeff_visitor< Derived >::res, and Eigen::internal::coeff_visitor< Derived >::row.

◆ mean()

template<typename Derived >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::mean
inherited
Returns
the mean of all coefficients of *this
See also
trace(), prod(), sum()
463{
464#ifdef __INTEL_COMPILER
465 #pragma warning push
466 #pragma warning ( disable : 2259 )
467#endif
469#ifdef __INTEL_COMPILER
470 #pragma warning pop
471#endif
472}
EIGEN_DEVICE_FUNC Scalar redux(const BinaryOp &func) const
Definition BinaryFunctors.h:33

◆ minCoeff() [1/3]

template<typename Derived >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::minCoeff
inherited
Returns
the minimum of all coefficients of *this.
Warning
the result is undefined if *this contains NaN.
427{
428 return derived().redux(Eigen::internal::scalar_min_op<Scalar,Scalar>());
429}
Definition BinaryFunctors.h:141

Referenced by igl::copyleft::cgal::half_space_box(), igl::isolines(), igl::min_quad_with_fixed_precompute(), igl::octree(), and igl::slice().

+ Here is the caller graph for this function:

◆ minCoeff() [2/3]

template<typename Derived >
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::minCoeff ( IndexType *  index) const
inherited
Returns
the minimum of all coefficients of *this and puts in *index its location.
Warning
the result is undefined if *this contains NaN.
See also
DenseBase::minCoeff(IndexType*,IndexType*), DenseBase::maxCoeff(IndexType*,IndexType*), DenseBase::visit(), DenseBase::minCoeff()
226{
228 internal::min_coeff_visitor<Derived> minVisitor;
229 this->visit(minVisitor);
230 *index = IndexType((RowsAtCompileTime==1) ? minVisitor.col : minVisitor.row);
231 return minVisitor.res;
232}

References Eigen::internal::coeff_visitor< Derived >::col, EIGEN_STATIC_ASSERT_VECTOR_ONLY, Eigen::internal::coeff_visitor< Derived >::res, and Eigen::internal::coeff_visitor< Derived >::row.

◆ minCoeff() [3/3]

template<typename Derived >
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::minCoeff ( IndexType *  rowId,
IndexType *  colId 
) const
inherited
Returns
the minimum of all coefficients of *this and puts in *row and *col its location.
Warning
the result is undefined if *this contains NaN.
See also
DenseBase::minCoeff(Index*), DenseBase::maxCoeff(Index*,Index*), DenseBase::visit(), DenseBase::minCoeff()
208{
209 internal::min_coeff_visitor<Derived> minVisitor;
210 this->visit(minVisitor);
211 *rowId = minVisitor.row;
212 if (colId) *colId = minVisitor.col;
213 return minVisitor.res;
214}

References Eigen::internal::coeff_visitor< Derived >::col, Eigen::internal::coeff_visitor< Derived >::res, and Eigen::internal::coeff_visitor< Derived >::row.

◆ nestByValue()

template<typename Derived >
const NestByValue< Derived > Eigen::DenseBase< Derived >::nestByValue
inlineinherited
Returns
an expression of the temporary version of *this.
104{
105 return NestByValue<Derived>(derived());
106}

◆ nestedExpression()

◆ noalias()

NoAlias< Homogeneous< MatrixType, _Direction > , MatrixBase > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::noalias
inherited
Returns
a pseudo expression of *this with an operator= assuming no aliasing between *this and the source expression.

More precisely, noalias() allows to bypass the EvalBeforeAssignBit flag. Currently, even though several expressions may alias, only product expressions have this flag. Therefore, noalias() is only usefull when the source expression contains a matrix product.

Here are some examples where noalias is usefull:

D.noalias() = A * B;
D.noalias() += A.transpose() * B;
D.noalias() -= 2 * A * B.adjoint();

On the other hand the following example will lead to a wrong result:

A.noalias() = A * B;

because the result matrix A is also an operand of the matrix product. Therefore, there is no alternative than evaluating A * B in a temporary, that is the default behavior when you write:

A = A * B;
See also
class NoAlias
102{
103 return NoAlias<Derived, Eigen::MatrixBase >(derived());
104}

◆ nonZeros()

template<typename Derived >
EIGEN_DEVICE_FUNC Index Eigen::DenseBase< Derived >::nonZeros ( ) const
inlineinherited
Returns
the number of nonzero coefficients which is in practice the number of stored coefficients.
210{ return size(); }

◆ norm()

EIGEN_STRONG_INLINE NumTraits< typenameinternal::traits< Homogeneous< MatrixType, _Direction > >::Scalar >::Real Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::norm
inherited
Returns
, for vectors, the l2 norm of *this, and for matrices the Frobenius norm. In both cases, it consists in the square root of the sum of the square of all the matrix entries. For vectors, this is also equals to the square root of the dot product of *this with itself.
See also
lpNorm(), dot(), squaredNorm()
109{
110 return numext::sqrt(squaredNorm());
111}

◆ normalize()

EIGEN_STRONG_INLINE void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::normalize
inherited

Normalizes the vector, i.e. divides it by its own norm.

\only_for_vectors

Warning
If the input vector is too small (i.e., this->norm()==0), then *this is left unchanged.
See also
norm(), normalized()
146{
148 // NOTE: after extensive benchmarking, this conditional does not impact performance, at least on recent x86 CPU
149 if(z>RealScalar(0))
150 derived() /= numext::sqrt(z);
151}

◆ normalized()

EIGEN_STRONG_INLINE const MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::normalized
inherited
Returns
an expression of the quotient of *this by its own norm.
Warning
If the input vector is too small (i.e., this->norm()==0), then this function returns a copy of the input.

\only_for_vectors

See also
norm(), normalize()
125{
126 typedef typename internal::nested_eval<Derived,2>::type _Nested;
127 _Nested n(derived());
128 RealScalar z = n.squaredNorm();
129 // NOTE: after extensive benchmarking, this conditional does not impact performance, at least on recent x86 CPU
130 if(z>RealScalar(0))
131 return n / numext::sqrt(z);
132 else
133 return n;
134}

◆ NullaryExpr() [1/6]

template<typename Derived >
template<typename CustomNullaryOp >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( const CustomNullaryOp &  func)
inherited
Returns
an expression of a matrix defined by a custom functor func

This variant is only for fixed-size DenseBase types. For dynamic-size types, you need to use the variants taking size arguments.

The template parameter CustomNullaryOp is the type of the functor.

See also
class CwiseNullaryOp
155{
156 return CwiseNullaryOp<CustomNullaryOp, PlainObject>(RowsAtCompileTime, ColsAtCompileTime, func);
157}

◆ NullaryExpr() [2/6]

template<typename Derived >
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( const CustomNullaryOp &  func)
staticinherited

◆ NullaryExpr() [3/6]

template<typename Derived >
template<typename CustomNullaryOp >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( Index  rows,
Index  cols,
const CustomNullaryOp &  func 
)
inherited
Returns
an expression of a matrix defined by a custom functor func

The parameters rows and cols are the number of rows and of columns of the returned matrix. Must be compatible with this MatrixBase type.

This variant is meant to be used for dynamic-size matrix types. For fixed-size types, it is redundant to pass rows and cols as arguments, so Zero() should be used instead.

The template parameter CustomNullaryOp is the type of the functor.

See also
class CwiseNullaryOp
110{
111 return CwiseNullaryOp<CustomNullaryOp, PlainObject>(rows, cols, func);
112}

◆ NullaryExpr() [4/6]

template<typename Derived >
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( Index  rows,
Index  cols,
const CustomNullaryOp &  func 
)
staticinherited

◆ NullaryExpr() [5/6]

template<typename Derived >
template<typename CustomNullaryOp >
EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( Index  size,
const CustomNullaryOp &  func 
)
inherited
Returns
an expression of a matrix defined by a custom functor func

The parameter size is the size of the returned vector. Must be compatible with this MatrixBase type.

\only_for_vectors

This variant is meant to be used for dynamic-size vector types. For fixed-size types, it is redundant to pass size as argument, so Zero() should be used instead.

The template parameter CustomNullaryOp is the type of the functor.

Here is an example with C++11 random generators:

Output:

See also
class CwiseNullaryOp
136{
138 if(RowsAtCompileTime == 1) return CwiseNullaryOp<CustomNullaryOp, PlainObject>(1, size, func);
139 else return CwiseNullaryOp<CustomNullaryOp, PlainObject>(size, 1, func);
140}

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ NullaryExpr() [6/6]

template<typename Derived >
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( Index  size,
const CustomNullaryOp &  func 
)
staticinherited

◆ Ones() [1/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Ones
staticinherited
Returns
an expression of a fixed-size matrix or vector where all coefficients equal one.

This variant is only for fixed-size MatrixBase types. For dynamic-size types, you need to use the variants taking size arguments.

Example:

Output:

See also
Ones(Index), Ones(Index,Index), isOnes(), class Ones
598{
599 return Constant(Scalar(1));
600}
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)
Definition CwiseNullaryOp.h:174

◆ Ones() [2/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Ones ( Index  rows,
Index  cols 
)
staticinherited
Returns
an expression of a matrix where all coefficients equal one.

The parameters rows and cols are the number of rows and of columns of the returned matrix. Must be compatible with this MatrixBase type.

This variant is meant to be used for dynamic-size matrix types. For fixed-size types, it is redundant to pass rows and cols as arguments, so Ones() should be used instead.

Example:

Output:

See also
Ones(), Ones(Index), isOnes(), class Ones
558{
559 return Constant(rows, cols, Scalar(1));
560}

◆ Ones() [3/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Ones ( Index  newSize)
staticinherited
Returns
an expression of a vector where all coefficients equal one.

The parameter newSize is the size of the returned vector. Must be compatible with this MatrixBase type.

\only_for_vectors

This variant is meant to be used for dynamic-size vector types. For fixed-size types, it is redundant to pass size as argument, so Ones() should be used instead.

Example:

Output:

See also
Ones(), Ones(Index,Index), isOnes(), class Ones
581{
582 return Constant(newSize, Scalar(1));
583}

◆ operator!=()

EIGEN_DEVICE_FUNC bool Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operator!= ( const MatrixBase< OtherDerived > &  other) const
inlineinherited
Returns
true if at least one pair of coefficients of *this and other are not exactly equal to each other.
Warning
When using floating point scalar values you probably should rather use a fuzzy comparison such as isApprox()
See also
isApprox(), operator==
297 { return cwiseNotEqual(other).any(); }
EIGEN_DEVICE_FUNC const CwiseBinaryOp< std::not_equal_to< Scalar >, const Derived, const OtherDerived > cwiseNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
Definition MatrixCwiseBinaryOps.h:63

◆ operator*() [1/3]

EIGEN_DEVICE_FUNC const Product< Homogeneous< MatrixType, _Direction > , DiagonalDerived, LazyProduct > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operator* ( const DiagonalBase< DiagonalDerived > &  diagonal) const
inherited

◆ operator*() [2/3]

EIGEN_DEVICE_FUNC const Product< Homogeneous< MatrixType, _Direction > , OtherDerived > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operator* ( const MatrixBase< OtherDerived > &  other) const
inherited

◆ operator*() [3/3]

template<typename MatrixType , int _Direction>
template<typename Rhs >
EIGEN_DEVICE_FUNC const Product< Homogeneous, Rhs > Eigen::Homogeneous< MatrixType, _Direction >::operator* ( const MatrixBase< Rhs > &  rhs) const
inline
83 {
85 return Product<Homogeneous,Rhs>(*this,rhs.derived());
86 }

References eigen_assert, and Eigen::Horizontal.

◆ operator*=() [1/2]

Homogeneous< MatrixType, _Direction > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operator*= ( const EigenBase< OtherDerived > &  other)
inlineinherited

replaces *this by *this * other.

Returns
a reference to *this

Example:

Output:

 
498{
499 other.derived().applyThisOnTheRight(derived());
500 return derived();
501}

◆ operator*=() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & Eigen::DenseBase< Homogeneous< MatrixType, _Direction > >::operator*= ( const Scalar other)
inherited
19{
20 internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op<Scalar,Scalar>());
21 return derived();
22}

◆ operator+=() [1/4]

Homogeneous< MatrixType, _Direction > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operator+= ( const ArrayBase< OtherDerived > &  )
inlineprotectedinherited
476 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}

◆ operator+=() [2/4]

EIGEN_DEVICE_FUNC Homogeneous< MatrixType, _Direction > & Eigen::DenseBase< Homogeneous< MatrixType, _Direction > >::operator+= ( const EigenBase< OtherDerived > &  other)
inherited
143{
144 call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar,typename OtherDerived::Scalar>());
145 return derived();
146}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
Definition AssignEvaluator.h:780

◆ operator+=() [3/4]

EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operator+= ( const MatrixBase< OtherDerived > &  other)
inherited

replaces *this by *this + other.

Returns
a reference to *this
176{
177 call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar,typename OtherDerived::Scalar>());
178 return derived();
179}

◆ operator+=() [4/4]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operator+= ( const MatrixBase< OtherDerived > &  other)
inherited

◆ operator-=() [1/4]

Homogeneous< MatrixType, _Direction > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operator-= ( const ArrayBase< OtherDerived > &  )
inlineprotectedinherited
479 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}

◆ operator-=() [2/4]

EIGEN_DEVICE_FUNC Homogeneous< MatrixType, _Direction > & Eigen::DenseBase< Homogeneous< MatrixType, _Direction > >::operator-= ( const EigenBase< OtherDerived > &  other)
inherited
152{
153 call_assignment(derived(), other.derived(), internal::sub_assign_op<Scalar,typename OtherDerived::Scalar>());
154 return derived();
155}

◆ operator-=() [3/4]

EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operator-= ( const MatrixBase< OtherDerived > &  other)
inherited

replaces *this by *this - other.

Returns
a reference to *this
163{
164 call_assignment(derived(), other.derived(), internal::sub_assign_op<Scalar,typename OtherDerived::Scalar>());
165 return derived();
166}

◆ operator-=() [4/4]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operator-= ( const MatrixBase< OtherDerived > &  other)
inherited

◆ operator/=()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & Eigen::DenseBase< Homogeneous< MatrixType, _Direction > >::operator/= ( const Scalar other)
inherited
40{
41 internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op<Scalar,Scalar>());
42 return derived();
43}

◆ operator<<() [1/3]

template<typename Derived >
template<typename OtherDerived >
CommaInitializer< Derived > Eigen::DenseBase< Derived >::operator<< ( const DenseBase< OtherDerived > &  other)
inlineinherited
See also
operator<<(const Scalar&)
154{
155 return CommaInitializer<Derived>(*static_cast<Derived *>(this), other);
156}

◆ operator<<() [2/3]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC CommaInitializer< Derived > Eigen::DenseBase< Derived >::operator<< ( const DenseBase< OtherDerived > &  other)
inherited

◆ operator<<() [3/3]

template<typename Derived >
CommaInitializer< Derived > Eigen::DenseBase< Derived >::operator<< ( const Scalar s)
inlineinherited

Convenient operator to set the coefficients of a matrix.

The coefficients must be provided in a row major order and exactly match the size of the matrix. Otherwise an assertion is raised.

Example:

Output:

Note
According the c++ standard, the argument expressions of this comma initializer are evaluated in arbitrary order.
See also
CommaInitializer::finished(), class CommaInitializer
145{
146 return CommaInitializer<Derived>(*static_cast<Derived*>(this), s);
147}

◆ operator==()

EIGEN_DEVICE_FUNC bool Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operator== ( const MatrixBase< OtherDerived > &  other) const
inlineinherited
Returns
true if each coefficients of *this and other are all exactly equal.
Warning
When using floating point scalar values you probably should rather use a fuzzy comparison such as isApprox()
See also
isApprox(), operator!=
289 { return cwiseEqual(other).all(); }
EIGEN_DEVICE_FUNC const CwiseBinaryOp< std::equal_to< Scalar >, const Derived, const OtherDerived > cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
Definition MatrixCwiseBinaryOps.h:43

◆ operatorNorm()

MatrixBase< Homogeneous< MatrixType, _Direction > >::RealScalar Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::operatorNorm
inlineinherited

Computes the L2 operator norm.

Returns
Operator norm of the matrix.

\eigenvalues_module This function computes the L2 operator norm of a matrix, which is also known as the spectral norm. The norm of a matrix $ A $ is defined to be

\[ \|A\|_2 = \max_x \frac{\|Ax\|_2}{\|x\|_2} \]

where the maximum is over all vectors and the norm on the right is the Euclidean vector norm. The norm equals the largest singular value, which is the square root of the largest eigenvalue of the positive semi-definite matrix $ A^*A $.

The current implementation uses the eigenvalues of $ A^*A $, as computed by SelfAdjointView::eigenvalues(), to compute the operator norm of a matrix. The SelfAdjointView class provides a better algorithm for selfadjoint matrices.

Example:

Output:

See also
SelfAdjointView::eigenvalues(), SelfAdjointView::operatorNorm()
121{
122 using std::sqrt;
123 typename Derived::PlainObject m_eval(derived());
124 // FIXME if it is really guaranteed that the eigenvalues are already sorted,
125 // then we don't need to compute a maxCoeff() here, comparing the 1st and last ones is enough.
126 return sqrt((m_eval*m_eval.adjoint())
127 .eval()
128 .template selfadjointView<Lower>()
129 .eigenvalues()
130 .maxCoeff()
131 );
132}

◆ outerSize()

template<typename Derived >
EIGEN_DEVICE_FUNC Index Eigen::DenseBase< Derived >::outerSize ( ) const
inlineinherited
Returns
the outer size.
Note
For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension with respect to the storage order, i.e., the number of columns for a column-major matrix, and the number of rows for a row-major matrix.
219 {
220 return IsVectorAtCompileTime ? 1
221 : int(IsRowMajor) ? this->rows() : this->cols();
222 }

References Eigen::DenseBase< Derived >::IsRowMajor, and Eigen::DenseBase< Derived >::IsVectorAtCompileTime.

◆ partialPivLu()

const PartialPivLU< typename MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::partialPivLu
inlineinherited

\lu_module

Returns
the partial-pivoting LU decomposition of *this.
See also
class PartialPivLU
590{
591 return PartialPivLU<PlainObject>(eval());
592}

◆ prod()

template<typename Derived >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::prod
inherited
Returns
the product of all coefficients of *this

Example:

Output:

See also
sum(), mean(), trace()
484{
486 return Scalar(1);
487 return derived().redux(Eigen::internal::scalar_product_op<Scalar>());
488}
Definition BinaryFunctors.h:77

References Eigen::Dynamic.

◆ Random() [1/3]

template<typename Derived >
const DenseBase< Derived >::RandomReturnType Eigen::DenseBase< Derived >::Random
inlinestaticinherited
Returns
a fixed-size random matrix or vector expression

Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.

This variant is only for fixed-size MatrixBase types. For dynamic-size types, you need to use the variants taking size arguments.

Example:

Output:

This expression has the "evaluate before nesting" flag so that it will be evaluated into a temporary matrix whenever it is nested in a larger expression. This prevents unexpected behavior with expressions involving random matrices.

\not_reentrant

See also
DenseBase::setRandom(), DenseBase::Random(Index,Index), DenseBase::Random(Index)
114{
115 return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_random_op<Scalar>());
116}

◆ Random() [2/3]

template<typename Derived >
const DenseBase< Derived >::RandomReturnType Eigen::DenseBase< Derived >::Random ( Index  rows,
Index  cols 
)
inlinestaticinherited
Returns
a random matrix expression

Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.

The parameters rows and cols are the number of rows and of columns of the returned matrix. Must be compatible with this MatrixBase type.

\not_reentrant

This variant is meant to be used for dynamic-size matrix types. For fixed-size types, it is redundant to pass rows and cols as arguments, so Random() should be used instead.

Example:

Output:

This expression has the "evaluate before nesting" flag so that it will be evaluated into a temporary matrix whenever it is nested in a larger expression. This prevents unexpected behavior with expressions involving random matrices.

See DenseBase::NullaryExpr(Index, const CustomNullaryOp&) for an example using C++11 random generators.

See also
DenseBase::setRandom(), DenseBase::Random(Index), DenseBase::Random()
57{
58 return NullaryExpr(rows, cols, internal::scalar_random_op<Scalar>());
59}

◆ Random() [3/3]

template<typename Derived >
const DenseBase< Derived >::RandomReturnType Eigen::DenseBase< Derived >::Random ( Index  size)
inlinestaticinherited
Returns
a random vector expression

Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.

The parameter size is the size of the returned vector. Must be compatible with this MatrixBase type.

\only_for_vectors \not_reentrant

This variant is meant to be used for dynamic-size vector types. For fixed-size types, it is redundant to pass size as argument, so Random() should be used instead.

Example:

Output:

This expression has the "evaluate before nesting" flag so that it will be evaluated into a temporary vector whenever it is nested in a larger expression. This prevents unexpected behavior with expressions involving random matrices.

See also
DenseBase::setRandom(), DenseBase::Random(Index,Index), DenseBase::Random()
88{
89 return NullaryExpr(size, internal::scalar_random_op<Scalar>());
90}

◆ redux() [1/2]

template<typename Derived >
template<typename BinaryOp >
EIGEN_DEVICE_FUNC Scalar Eigen::DenseBase< Derived >::redux ( const BinaryOp &  func) const
inherited

Referenced by Eigen::internal::member_redux< BinaryOp, Scalar >::operator()().

+ Here is the caller graph for this function:

◆ redux() [2/2]

template<typename MatrixType , int _Direction>
template<typename Func >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::result_of< Func(Scalar, Scalar)>::type Eigen::Homogeneous< MatrixType, _Direction >::redux ( const Func &  func) const
inline
107 {
108 return func(m_matrix.redux(func), Scalar(1));
109 }

◆ replicate() [1/3]

template<typename Derived >
template<int RowFactor, int ColFactor>
EIGEN_DEVICE_FUNC const Replicate< Derived, RowFactor, ColFactor > Eigen::DenseBase< Derived >::replicate ( ) const
inherited

Referenced by igl::min_quad_with_fixed_solve().

+ Here is the caller graph for this function:

◆ replicate() [2/3]

template<typename Derived >
template<int RowFactor, int ColFactor>
const Replicate< Derived, RowFactor, ColFactor > Eigen::DenseBase< Derived >::replicate ( ) const
inherited
Returns
an expression of the replication of *this

Example:

Output:

See also
VectorwiseOp::replicate(), DenseBase::replicate(Index,Index), class Replicate
120{
121 return Replicate<Derived,RowFactor,ColFactor>(derived());
122}

◆ replicate() [3/3]

template<typename Derived >
EIGEN_DEVICE_FUNC const Replicate< Derived, Dynamic, Dynamic > Eigen::DenseBase< Derived >::replicate ( Index  rowFactor,
Index  colFactor 
) const
inlineinherited
Returns
an expression of the replication of *this

Example:

Output:

See also
VectorwiseOp::replicate(), DenseBase::replicate<int,int>(), class Replicate
555 {
556 return Replicate<Derived, Dynamic, Dynamic>(derived(), rowFactor, colFactor);
557 }

◆ resize() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::resize ( Index  newSize)
inlineinherited

Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does nothing else.

242 {
244 eigen_assert(newSize == this->size()
245 && "DenseBase::resize() does not actually allow to resize.");
246 }
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition Macros.h:591

References eigen_assert, and EIGEN_ONLY_USED_FOR_DEBUG.

Referenced by Eigen::TriangularBase< Derived >::evalToLazy(), igl::find(), and igl::slice_tets().

+ Here is the caller graph for this function:

◆ resize() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::resize ( Index  rows,
Index  cols 
)
inlineinherited

Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does nothing else.

253 {
256 eigen_assert(rows == this->rows() && cols == this->cols()
257 && "DenseBase::resize() does not actually allow to resize.");
258 }

References eigen_assert, and EIGEN_ONLY_USED_FOR_DEBUG.

◆ reverse() [1/2]

template<typename Derived >
DenseBase< Derived >::ReverseReturnType Eigen::DenseBase< Derived >::reverse
inlineinherited
Returns
an expression of the reverse of *this.

Example:

Output:

 
119{
120 return ReverseReturnType(derived());
121}
Reverse< Derived, BothDirections > ReverseReturnType
Definition DenseBase.h:559

◆ reverse() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC ConstReverseReturnType Eigen::DenseBase< Derived >::reverse ( ) const
inlineinherited

This is the const version of reverse().

565 {
566 return ConstReverseReturnType(derived());
567 }
const Reverse< const Derived, BothDirections > ConstReverseReturnType
Definition DenseBase.h:560

◆ reverseInPlace()

template<typename Derived >
void Eigen::DenseBase< Derived >::reverseInPlace
inlineinherited

This is the "in place" version of reverse: it reverses *this.

In most cases it is probably better to simply use the reversed expression of a matrix. However, when reversing the matrix data itself is really needed, then this "in-place" version is probably the right choice because it provides the following additional benefits:

  • less error prone: doing the same operation with .reverse() requires special care:
    m = m.reverse().eval();
  • this API enables reverse operations without the need for a temporary
  • it allows future optimizations (cache friendliness, etc.)
See also
VectorwiseOp::reverseInPlace(), reverse()
140{
141 if(cols()>rows())
142 {
143 Index half = cols()/2;
144 leftCols(half).swap(rightCols(half).reverse());
145 if((cols()%2)==1)
146 {
147 Index half2 = rows()/2;
148 col(half).head(half2).swap(col(half).tail(half2).reverse());
149 }
150 }
151 else
152 {
153 Index half = rows()/2;
154 topRows(half).swap(bottomRows(half).reverse());
155 if((rows()%2)==1)
156 {
157 Index half2 = cols()/2;
158 row(half).head(half2).swap(row(half).tail(half2).reverse());
159 }
160 }
161}
EIGEN_DEVICE_FUNC ColsBlockXpr rightCols(Index n)
This is the const version of rightCols(Index).
Definition BlockMethods.h:658
EIGEN_DEVICE_FUNC ColsBlockXpr leftCols(Index n)
This is the const version of leftCols(Index).
Definition BlockMethods.h:602
EIGEN_DEVICE_FUNC RowsBlockXpr bottomRows(Index n)
This is the const version of bottomRows(Index).
Definition BlockMethods.h:488
EIGEN_DEVICE_FUNC RowsBlockXpr topRows(Index n)
This is the const version of topRows(Index).
Definition BlockMethods.h:432
EIGEN_DEVICE_FUNC ReverseReturnType reverse()
Definition Reverse.h:118

References bottomRows(), col(), leftCols(), rightCols(), row(), tail(), and topRows().

+ Here is the call graph for this function:

◆ rows()

template<typename MatrixType , int _Direction>
EIGEN_DEVICE_FUNC Index Eigen::Homogeneous< MatrixType, _Direction >::rows ( ) const
inline

◆ rowwise() [1/2]

template<typename Derived >
DenseBase< Derived >::RowwiseReturnType Eigen::DenseBase< Derived >::rowwise
inlineinherited
Returns
a writable VectorwiseOp wrapper of *this providing additional partial reduction operations
See also
colwise(), class VectorwiseOp, TutorialReductionsVisitorsBroadcasting
689{
690 return RowwiseReturnType(derived());
691}
VectorwiseOp< Derived, Horizontal > RowwiseReturnType
Definition DenseBase.h:491

◆ rowwise() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC ConstRowwiseReturnType Eigen::DenseBase< Derived >::rowwise ( ) const
inlineinherited
Returns
a VectorwiseOp wrapper of *this providing additional partial reduction operations

Example:

Output:

See also
colwise(), class VectorwiseOp, TutorialReductionsVisitorsBroadcasting
504 {
505 return ConstRowwiseReturnType(derived());
506 }
const VectorwiseOp< const Derived, Horizontal > ConstRowwiseReturnType
Definition DenseBase.h:492

Referenced by igl::normalize_row_sums(), and Eigen::umeyama().

+ Here is the caller graph for this function:

◆ select() [1/3]

template<typename Derived >
template<typename ThenDerived , typename ElseDerived >
const Select< Derived, ThenDerived, ElseDerived > Eigen::DenseBase< Derived >::select ( const DenseBase< ThenDerived > &  thenMatrix,
const DenseBase< ElseDerived > &  elseMatrix 
) const
inlineinherited
Returns
a matrix where each coefficient (i,j) is equal to thenMatrix(i,j) if *this(i,j), and elseMatrix(i,j) otherwise.

Example:

Output:

See also
class Select
126{
127 return Select<Derived,ThenDerived,ElseDerived>(derived(), thenMatrix.derived(), elseMatrix.derived());
128}

◆ select() [2/3]

template<typename Derived >
template<typename ThenDerived >
const Select< Derived, ThenDerived, typename ThenDerived::ConstantReturnType > Eigen::DenseBase< Derived >::select ( const DenseBase< ThenDerived > &  thenMatrix,
const typename ThenDerived::Scalar &  elseScalar 
) const
inlineinherited

Version of DenseBase::select(const DenseBase&, const DenseBase&) with the else expression being a scalar value.

See also
DenseBase::select(const DenseBase<ThenDerived>&, const DenseBase<ElseDerived>&) const, class Select
140{
141 return Select<Derived,ThenDerived,typename ThenDerived::ConstantReturnType>(
142 derived(), thenMatrix.derived(), ThenDerived::Constant(rows(),cols(),elseScalar));
143}

◆ select() [3/3]

template<typename Derived >
template<typename ElseDerived >
const Select< Derived, typename ElseDerived::ConstantReturnType, ElseDerived > Eigen::DenseBase< Derived >::select ( const typename ElseDerived::Scalar &  thenScalar,
const DenseBase< ElseDerived > &  elseMatrix 
) const
inlineinherited

Version of DenseBase::select(const DenseBase&, const DenseBase&) with the then expression being a scalar value.

See also
DenseBase::select(const DenseBase<ThenDerived>&, const DenseBase<ElseDerived>&) const, class Select
155{
156 return Select<Derived,typename ElseDerived::ConstantReturnType,ElseDerived>(
157 derived(), ElseDerived::Constant(rows(),cols(),thenScalar), elseMatrix.derived());
158}

◆ selfadjointView() [1/4]

EIGEN_DEVICE_FUNC SelfAdjointViewReturnType< UpLo >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::selfadjointView ( )
inherited

◆ selfadjointView() [2/4]

MatrixBase< Homogeneous< MatrixType, _Direction > >::template SelfAdjointViewReturnType< UpLo >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::selfadjointView ( )
inherited
Returns
an expression of a symmetric/self-adjoint view extracted from the upper or lower triangular part of the current matrix

The parameter UpLo can be either Upper or Lower

Example:

Output:

See also
class SelfAdjointView
346{
347 return typename SelfAdjointViewReturnType<UpLo>::Type(derived());
348}

◆ selfadjointView() [3/4]

EIGEN_DEVICE_FUNC ConstSelfAdjointViewReturnType< UpLo >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::selfadjointView ( ) const
inherited

◆ selfadjointView() [4/4]

MatrixBase< Homogeneous< MatrixType, _Direction > >::template ConstSelfAdjointViewReturnType< UpLo >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::selfadjointView ( ) const
inherited

This is the const version of MatrixBase::selfadjointView()

329{
330 return typename ConstSelfAdjointViewReturnType<UpLo>::Type(derived());
331}

◆ setConstant()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::setConstant ( const Scalar val)
inherited

Sets all coefficients in this expression to value val.

See also
fill(), setConstant(Index,const Scalar&), setConstant(Index,Index,const Scalar&), setZero(), setOnes(), Constant(), class CwiseNullaryOp, setZero(), setOnes()
326{
327 return derived() = Constant(rows(), cols(), val);
328}

Referenced by Eigen::ArrayBase< Derived >::operator=().

+ Here is the caller graph for this function:

◆ setIdentity() [1/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::setIdentity
inherited

Writes the identity expression (not necessarily square) into *this.

Example:

Output:

See also
class CwiseNullaryOp, Identity(), Identity(Index,Index), isIdentity()
775{
776 return internal::setIdentity_impl<Derived>::run(derived());
777}

◆ setIdentity() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Homogeneous< MatrixType, _Direction > & Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::setIdentity ( Index  rows,
Index  cols 
)
inherited

Resizes to the given size, and writes the identity expression (not necessarily square) into *this.

Parameters
rowsthe new number of rows
colsthe new number of columns

Example:

Output:

See also
MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Identity()
791{
792 derived().resize(rows, cols);
793 return setIdentity();
794}
EIGEN_DEVICE_FUNC Homogeneous< MatrixType, _Direction > & setIdentity()
Definition CwiseNullaryOp.h:774

◆ setLinSpaced() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::setLinSpaced ( const Scalar low,
const Scalar high 
)
inherited

Sets a linearly spaced vector.

The function fills *this with equally spaced values in the closed interval [low,high]. When size is set to 1, a vector of length 1 containing 'high' is returned.

\only_for_vectors

For integer scalar types, do not miss the explanations on the definition of even spacing .

See also
LinSpaced(Index,const Scalar&,const Scalar&), setLinSpaced(Index, const Scalar&, const Scalar&), CwiseNullaryOp
404{
406 return setLinSpaced(size(), low, high);
407}
EIGEN_DEVICE_FUNC Derived & setLinSpaced(Index size, const Scalar &low, const Scalar &high)
Sets a linearly spaced vector.
Definition CwiseNullaryOp.h:383

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ setLinSpaced() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::setLinSpaced ( Index  newSize,
const Scalar low,
const Scalar high 
)
inherited

Sets a linearly spaced vector.

The function generates 'size' equally spaced values in the closed interval [low,high]. When size is set to 1, a vector of length 1 containing 'high' is returned.

\only_for_vectors

Example:

Output:

For integer scalar types, do not miss the explanations on the definition of even spacing .

See also
LinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp
384{
386 return derived() = Derived::NullaryExpr(newSize, internal::linspaced_op<Scalar,PacketScalar>(low,high,newSize));
387}

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ setOnes()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::setOnes
inherited

Sets all coefficients in this expression to one.

Example:

Output:

See also
class CwiseNullaryOp, Ones()
626{
627 return setConstant(Scalar(1));
628}

◆ setRandom()

template<typename Derived >
Derived & Eigen::DenseBase< Derived >::setRandom
inlineinherited

Sets all coefficients in this expression to random values.

Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.

\not_reentrant

Example:

Output:

See also
class CwiseNullaryOp, setRandom(Index), setRandom(Index,Index)
132{
133 return *this = Random(rows(), cols());
134}
static const RandomReturnType Random()
Definition Random.h:113

◆ setZero()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::setZero
inherited

Sets all coefficients in this expression to zero.

Example:

Output:

See also
class CwiseNullaryOp, Zero()
500{
501 return setConstant(Scalar(0));
502}

Referenced by Eigen::SPQR< _MatrixType >::_solve_impl(), Eigen::PermutationBase< Derived >::evalTo(), and Eigen::InverseImpl< PermutationType, PermutationStorage >::evalTo().

+ Here is the caller graph for this function:

◆ sparseView()

const SparseView< Homogeneous< MatrixType, _Direction > > Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::sparseView ( const Scalar reference = Scalar(0),
const typename NumTraits< Scalar >::Real &  epsilon = NumTraits<Scalar>::dummy_precision() 
) const
inherited
Returns
a sparse expression of the dense expression *this with values smaller than reference * epsilon removed.

This method is typically used when prototyping to convert a quickly assembled dense Matrix D to a SparseMatrix S:

MatrixXd D(n,m);
S = D.sparseView(); // suppress numerical zeros (exact)
S = D.sparseView(reference);
S = D.sparseView(reference,epsilon);
A versatible sparse matrix representation.
Definition SparseMatrix.h:98

where reference is a meaningful non zero reference value, and epsilon is a tolerance factor defaulting to NumTraits<Scalar>::dummy_precision().

See also
SparseMatrixBase::pruned(), class SparseView
227{
228 return SparseView<Derived>(derived(), reference, epsilon);
229}

◆ squaredNorm()

EIGEN_STRONG_INLINE NumTraits< typenameinternal::traits< Homogeneous< MatrixType, _Direction > >::Scalar >::Real Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::squaredNorm
inherited
Returns
, for vectors, the squared l2 norm of *this, and for matrices the Frobenius norm. In both cases, it consists in the sum of the square of all the matrix entries. For vectors, this is also equals to the dot product of *this with itself.
See also
dot(), norm(), lpNorm()
97{
98 return numext::real((*this).cwiseAbs2().sum());
99}

◆ stableNorm()

NumTraits< typenameinternal::traits< Homogeneous< MatrixType, _Direction > >::Scalar >::Real Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::stableNorm
inlineinherited
Returns
the l2 norm of *this avoiding underflow and overflow. This version use a blockwise two passes algorithm: 1 - find the absolute largest coefficient s 2 - compute $ s \Vert \frac{*this}{s} \Vert $ in a standard way

For architecture/scalar types supporting vectorization, this version is faster than blueNorm(). Otherwise the blueNorm() is much faster.

See also
norm(), blueNorm(), hypotNorm()
158{
159 using std::sqrt;
160 using std::abs;
161 const Index blockSize = 4096;
162 RealScalar scale(0);
163 RealScalar invScale(1);
164 RealScalar ssq(0); // sum of square
165
166 typedef typename internal::nested_eval<Derived,2>::type DerivedCopy;
167 typedef typename internal::remove_all<DerivedCopy>::type DerivedCopyClean;
168 const DerivedCopy copy(derived());
169
170 enum {
171 CanAlign = ( (int(DerivedCopyClean::Flags)&DirectAccessBit)
172 || (int(internal::evaluator<DerivedCopyClean>::Alignment)>0) // FIXME Alignment)>0 might not be enough
173 ) && (blockSize*sizeof(Scalar)*2<EIGEN_STACK_ALLOCATION_LIMIT)
174 && (EIGEN_MAX_STATIC_ALIGN_BYTES>0) // if we cannot allocate on the stack, then let's not bother about this optimization
175 };
176 typedef typename internal::conditional<CanAlign, Ref<const Matrix<Scalar,Dynamic,1,0,blockSize,1>, internal::evaluator<DerivedCopyClean>::Alignment>,
177 typename DerivedCopyClean::ConstSegmentReturnType>::type SegmentWrapper;
178 Index n = size();
179
180 if(n==1)
181 return abs(this->coeff(0));
182
183 Index bi = internal::first_default_aligned(copy);
184 if (bi>0)
185 internal::stable_norm_kernel(copy.head(bi), ssq, scale, invScale);
186 for (; bi<n; bi+=blockSize)
187 internal::stable_norm_kernel(SegmentWrapper(copy.segment(bi,numext::mini(blockSize, n - bi))), ssq, scale, invScale);
188 return scale * sqrt(ssq);
189}
#define EIGEN_MAX_STATIC_ALIGN_BYTES
Definition Macros.h:730
#define EIGEN_STACK_ALLOCATION_LIMIT
Definition Macros.h:801
int scale(const int val)
Definition WipeTowerDialog.cpp:14
const unsigned int DirectAccessBit
Definition Constants.h:150

◆ stableNormalize()

EIGEN_STRONG_INLINE void Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::stableNormalize
inherited

Normalizes the vector while avoid underflow and overflow

\only_for_vectors

This method is analogue to the normalize() method, but it reduces the risk of underflow and overflow when computing the norm.

Warning
If the input vector is too small (i.e., this->norm()==0), then *this is left unchanged.
See also
stableNorm(), stableNormalized(), normalize()
192{
193 RealScalar w = cwiseAbs().maxCoeff();
194 RealScalar z = (derived()/w).squaredNorm();
195 if(z>RealScalar(0))
196 derived() /= numext::sqrt(z)*w;
197}

◆ stableNormalized()

EIGEN_STRONG_INLINE const MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::stableNormalized
inherited
Returns
an expression of the quotient of *this by its own norm while avoiding underflow and overflow.

\only_for_vectors

This method is analogue to the normalized() method, but it reduces the risk of underflow and overflow when computing the norm.

Warning
If the input vector is too small (i.e., this->norm()==0), then this function returns a copy of the input.
See also
stableNorm(), stableNormalize(), normalized()
168{
169 typedef typename internal::nested_eval<Derived,3>::type _Nested;
170 _Nested n(derived());
171 RealScalar w = n.cwiseAbs().maxCoeff();
172 RealScalar z = (n/w).squaredNorm();
173 if(z>RealScalar(0))
174 return n / (numext::sqrt(z)*w);
175 else
176 return n;
177}

◆ sum()

template<typename Derived >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::sum
inherited
Returns
the sum of all coefficients of *this

If *this is empty, then the value 0 is returned.

See also
trace(), prod(), mean()
450{
452 return Scalar(0);
453 return derived().redux(Eigen::internal::scalar_sum_op<Scalar,Scalar>());
454}

References Eigen::Dynamic.

Referenced by igl::normalize_row_sums(), and Eigen::internal::lpNorm_selector< Derived, 1 >::run().

+ Here is the caller graph for this function:

◆ swap() [1/2]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::swap ( const DenseBase< OtherDerived > &  other)
inlineinherited

swaps *this with the expression other.

415 {
416 EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
417 eigen_assert(rows()==other.rows() && cols()==other.cols());
418 call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
419 }

References eigen_assert, and EIGEN_STATIC_ASSERT.

Referenced by Eigen::internal::conservative_resize_like_impl< Derived, OtherDerived, IsVector >::run(), and Eigen::internal::conservative_resize_like_impl< Derived, OtherDerived, IsVector >::run().

+ Here is the caller graph for this function:

◆ swap() [2/2]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::swap ( PlainObjectBase< OtherDerived > &  other)
inlineinherited

swaps *this with the matrix or array other.

427 {
428 eigen_assert(rows()==other.rows() && cols()==other.cols());
429 call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
430 }

References Eigen::PlainObjectBase< Derived >::cols(), eigen_assert, and Eigen::PlainObjectBase< Derived >::rows().

+ Here is the call graph for this function:

◆ trace()

EIGEN_STRONG_INLINE internal::traits< Homogeneous< MatrixType, _Direction > >::Scalar Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::trace
inherited
Returns
the trace of *this, i.e. the sum of the coefficients on the main diagonal.

*this can be any matrix, not necessarily square.

See also
diagonal(), sum()
499{
500 return derived().diagonal().sum();
501}

◆ transpose() [1/2]

template<typename Derived >
Transpose< Derived > Eigen::DenseBase< Derived >::transpose
inlineinherited
Returns
an expression of the transpose of *this.

Example:

Output:

Warning
If you want to replace a matrix by its own transpose, do NOT do this:
m = m.transpose(); // bug!!! caused by aliasing effect
Instead, use the transposeInPlace() method:
m.transposeInPlace();
which gives Eigen good opportunities for optimization, or alternatively you can also do:
m = m.transpose().eval();
See also
transposeInPlace(), adjoint()
173{
174 return TransposeReturnType(derived());
175}
Transpose< Derived > TransposeReturnType
Definition DenseBase.h:319

Referenced by igl::AABB< DerivedV, DIM >::find(), igl::AABB< DerivedV, DIM >::init(), igl::project(), igl::signed_distance_winding_number(), and igl::unproject().

+ Here is the caller graph for this function:

◆ transpose() [2/2]

template<typename Derived >
DenseBase< Derived >::ConstTransposeReturnType Eigen::DenseBase< Derived >::transpose
inlineinherited

This is the const version of transpose().

Make sure you read the warning for transpose() !

See also
transposeInPlace(), adjoint()
185{
186 return ConstTransposeReturnType(derived());
187}
internal::add_const< Transpose< constDerived > >::type ConstTransposeReturnType
Definition DenseBase.h:322

◆ transposeInPlace()

template<typename Derived >
void Eigen::DenseBase< Derived >::transposeInPlace
inlineinherited

This is the "in place" version of transpose(): it replaces *this by its own transpose. Thus, doing

m.transposeInPlace();

has the same effect on m as doing

m = m.transpose().eval();

and is faster and also safer because in the latter line of code, forgetting the eval() results in a bug caused by aliasing.

Notice however that this method is only useful if you want to replace a matrix by its own transpose. If you just need the transpose of a matrix, use transpose().

Note
if the matrix is not square, then *this must be a resizable matrix. This excludes (non-square) fixed-size matrices, block-expressions and maps.
See also
transpose(), adjoint(), adjointInPlace()
285{
287 && "transposeInPlace() called on a non-square non-resizable matrix");
288 internal::inplace_transpose_selector<Derived>::run(derived());
289}

References Eigen::Dynamic, and eigen_assert.

◆ triangularView() [1/4]

EIGEN_DEVICE_FUNC TriangularViewReturnType< Mode >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::triangularView ( )
inherited

◆ triangularView() [2/4]

MatrixBase< Homogeneous< MatrixType, _Direction > >::template TriangularViewReturnType< Mode >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::triangularView ( )
inherited
Returns
an expression of a triangular view extracted from the current matrix

The parameter Mode can have the following values: Upper, StrictlyUpper, UnitUpper, Lower, StrictlyLower, UnitLower.

Example:

Output:

See also
class TriangularView
629{
630 return typename TriangularViewReturnType<Mode>::Type(derived());
631}

◆ triangularView() [3/4]

EIGEN_DEVICE_FUNC ConstTriangularViewReturnType< Mode >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::triangularView ( ) const
inherited

◆ triangularView() [4/4]

MatrixBase< Homogeneous< MatrixType, _Direction > >::template ConstTriangularViewReturnType< Mode >::Type Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::triangularView ( ) const
inherited

This is the const version of MatrixBase::triangularView()

638{
639 return typename ConstTriangularViewReturnType<Mode>::Type(derived());
640}

◆ Unit() [1/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Homogeneous< MatrixType, _Direction > >::BasisReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::Unit ( Index  i)
staticinherited
Returns
an expression of the i-th unit (basis) vector.

\only_for_vectors

This variant is for fixed-size vector only.

See also
MatrixBase::Unit(Index,Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
819{
821 return BasisReturnType(SquareMatrixType::Identity(),i);
822}
Block< const CwiseNullaryOp< internal::scalar_identity_op< Scalar >, SquareMatrixType >, internal::traits< Homogeneous< MatrixType, _Direction > >::RowsAtCompileTime, internal::traits< Homogeneous< MatrixType, _Direction > >::ColsAtCompileTime > BasisReturnType
Definition MatrixBase.h:120

◆ Unit() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Homogeneous< MatrixType, _Direction > >::BasisReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::Unit ( Index  newSize,
Index  i 
)
staticinherited
Returns
an expression of the i-th unit (basis) vector.

\only_for_vectors

See also
MatrixBase::Unit(Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
804{
806 return BasisReturnType(SquareMatrixType::Identity(newSize,newSize), i);
807}

◆ unitOrthogonal()

EIGEN_DEVICE_FUNC MatrixBase< Homogeneous< MatrixType, _Direction > >::PlainObject Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::unitOrthogonal ( void  ) const
inlineinherited

\geometry_module

Returns
a unit vector which is orthogonal to *this

The size of *this must be at least 2. If the size is exactly 2, then the returned vector is a counter clock wise rotation of *this, i.e., (-y,x).normalized().

See also
cross()
227{
229 return internal::unitOrthogonal_selector<Derived>::run(derived());
230}

◆ UnitW()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Homogeneous< MatrixType, _Direction > >::BasisReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::UnitW
staticinherited
Returns
an expression of the W axis unit vector (0,0,0,1)

\only_for_vectors

See also
MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
862{ return Derived::Unit(3); }

◆ UnitX()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Homogeneous< MatrixType, _Direction > >::BasisReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::UnitX
staticinherited
Returns
an expression of the X axis unit vector (1{,0}^*)

\only_for_vectors

See also
MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
832{ return Derived::Unit(0); }

◆ UnitY()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Homogeneous< MatrixType, _Direction > >::BasisReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::UnitY
staticinherited
Returns
an expression of the Y axis unit vector (0,1{,0}^*)

\only_for_vectors

See also
MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
842{ return Derived::Unit(1); }

◆ UnitZ()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Homogeneous< MatrixType, _Direction > >::BasisReturnType Eigen::MatrixBase< Homogeneous< MatrixType, _Direction > >::UnitZ
staticinherited
Returns
an expression of the Z axis unit vector (0,0,1{,0}^*)

\only_for_vectors

See also
MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
852{ return Derived::Unit(2); }

◆ value()

template<typename Derived >
EIGEN_DEVICE_FUNC CoeffReturnType Eigen::DenseBase< Derived >::value ( ) const
inlineinherited
Returns
the unique coefficient of a 1x1 expression
481 {
483 eigen_assert(this->rows() == 1 && this->cols() == 1);
484 return derived().coeff(0,0);
485 }
#define EIGEN_STATIC_ASSERT_SIZE_1x1(TYPE)
Definition StaticAssert.h:194

References eigen_assert, and EIGEN_STATIC_ASSERT_SIZE_1x1.

Referenced by igl::find(), and Eigen::ArrayBase< Derived >::operator=().

+ Here is the caller graph for this function:

◆ visit()

template<typename Derived >
template<typename Visitor >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::visit ( Visitor &  visitor) const
inherited

Applies the visitor visitor to the whole coefficients of the matrix or vector.

The template parameter Visitor is the type of the visitor and provides the following interface:

struct MyVisitor {
// called for the first coefficient
void init(const Scalar& value, Index i, Index j);
// called for all other coefficients
void operator() (const Scalar& value, Index i, Index j);
};
Note
compared to one or two for loops, visitors offer automatic unrolling for small fixed size matrix.
See also
minCoeff(Index*,Index*), maxCoeff(Index*,Index*), DenseBase::redux()
108{
109 typedef typename internal::visitor_evaluator<Derived> ThisEvaluator;
110 ThisEvaluator thisEval(derived());
111
112 enum {
113 unroll = SizeAtCompileTime != Dynamic
115 };
116 return internal::visitor_impl<Visitor, ThisEvaluator, unroll ? int(SizeAtCompileTime) : Dynamic>::run(thisEval, visitor);
117}
@ Cost
Definition XprHelper.h:150

References Eigen::Dynamic, and EIGEN_UNROLLING_LIMIT.

◆ Zero() [1/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Zero
staticinherited
Returns
an expression of a fixed-size zero matrix or vector.

This variant is only for fixed-size MatrixBase types. For dynamic-size types, you need to use the variants taking size arguments.

Example:

Output:

See also
Zero(Index), Zero(Index,Index)
468{
469 return Constant(Scalar(0));
470}

◆ Zero() [2/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Zero ( Index  rows,
Index  cols 
)
staticinherited
Returns
an expression of a zero matrix.

The parameters rows and cols are the number of rows and of columns of the returned matrix. Must be compatible with this MatrixBase type.

This variant is meant to be used for dynamic-size matrix types. For fixed-size types, it is redundant to pass rows and cols as arguments, so Zero() should be used instead.

Example:

Output:

See also
Zero(), Zero(Index)
428{
429 return Constant(rows, cols, Scalar(0));
430}

◆ Zero() [3/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Zero ( Index  size)
staticinherited
Returns
an expression of a zero vector.

The parameter size is the size of the returned vector. Must be compatible with this MatrixBase type.

\only_for_vectors

This variant is meant to be used for dynamic-size vector types. For fixed-size types, it is redundant to pass size as argument, so Zero() should be used instead.

Example:

Output:

See also
Zero(), Zero(Index,Index)
451{
452 return Constant(size, Scalar(0));
453}

Friends And Related Symbol Documentation

◆ operator* [1/2]

template<typename MatrixType , int _Direction>
template<typename Lhs >
EIGEN_DEVICE_FUNC const Product< Lhs, Homogeneous > operator* ( const MatrixBase< Lhs > &  lhs,
const Homogeneous< MatrixType, _Direction > &  rhs 
)
friend
91 {
93 return Product<Lhs,Homogeneous>(lhs.derived(),rhs);
94 }

◆ operator* [2/2]

template<typename MatrixType , int _Direction>
template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC const Product< Transform< Scalar, Dim, Mode, Options >, Homogeneous > operator* ( const Transform< Scalar, Dim, Mode, Options > &  lhs,
const Homogeneous< MatrixType, _Direction > &  rhs 
)
friend
99 {
101 return Product<Transform<Scalar,Dim,Mode,Options>, Homogeneous>(lhs,rhs);
102 }
EIGEN_DEVICE_FUNC Homogeneous(const MatrixType &matrix)
Definition Homogeneous.h:71

◆ operator<<()

template<typename Derived >
std::ostream & operator<< ( std::ostream &  s,
const DenseBase< Derived > &  m 
)
related

Outputs the matrix, to the given stream.

If you wish to print the matrix with a format different than the default, use DenseBase::format().

It is also possible to change the default format by defining EIGEN_DEFAULT_IO_FORMAT before including Eigen headers. If not defined, this will automatically be defined to Eigen::IOFormat(), that is the Eigen::IOFormat with default parameters.

See also
DenseBase::format()
219{
221}
#define EIGEN_DEFAULT_IO_FORMAT
Definition Macros.h:810
std::ostream & print_matrix(std::ostream &s, const Derived &_m, const IOFormat &fmt)
Definition IO.h:129

References EIGEN_DEFAULT_IO_FORMAT, and Eigen::internal::print_matrix().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_matrix

template<typename MatrixType , int _Direction>
MatrixType::Nested Eigen::Homogeneous< MatrixType, _Direction >::m_matrix
protected

◆ Eigen::Hyperplane

class Eigen::Hyperplane
template<typename _Scalar, int _AmbientDim, int _Options>
class Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >

A hyperplane.

\geometry_module

A hyperplane is an affine subspace of dimension n-1 in a space of dimension n. For example, a hyperplane in a plane is a line; a hyperplane in 3-space is a plane.

Template Parameters
_Scalarthe scalar type, i.e., the type of the coefficients
_AmbientDimthe dimension of the ambient space, can be a compile time value or Dynamic. Notice that the dimension of the hyperplane is _AmbientDim-1.

This class represents an hyperplane as the zero set of the implicit equation $ n \cdot x + d = 0 $ where $ n $ is a unit normal vector of the plane (linear part) and $ d $ is the distance (offset) to the origin.

+ Collaboration diagram for Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >:

Public Types

enum  { AmbientDimAtCompileTime = _AmbientDim , Options = _Options }
 
typedef _Scalar Scalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef Eigen::Index Index
 
typedef Matrix< Scalar, AmbientDimAtCompileTime, 1 > VectorType
 
typedef Matrix< Scalar, Index(AmbientDimAtCompileTime)==Dynamic ? Dynamic :Index(AmbientDimAtCompileTime)+1, 1, OptionsCoefficients
 
typedef Block< Coefficients, AmbientDimAtCompileTime, 1 > NormalReturnType
 
typedef const Block< const Coefficients, AmbientDimAtCompileTime, 1 > ConstNormalReturnType
 

Public Member Functions

EIGEN_DEVICE_FUNC Hyperplane ()
 
template<int OtherOptions>
EIGEN_DEVICE_FUNC Hyperplane (const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &other)
 
EIGEN_DEVICE_FUNC Hyperplane (Index _dim)
 
EIGEN_DEVICE_FUNC Hyperplane (const VectorType &n, const VectorType &e)
 
EIGEN_DEVICE_FUNC Hyperplane (const VectorType &n, const Scalar &d)
 
EIGEN_DEVICE_FUNC Hyperplane (const ParametrizedLine< Scalar, AmbientDimAtCompileTime > &parametrized)
 
EIGEN_DEVICE_FUNC ~Hyperplane ()
 
EIGEN_DEVICE_FUNC Index dim () const
 
EIGEN_DEVICE_FUNC void normalize (void)
 
EIGEN_DEVICE_FUNC Scalar signedDistance (const VectorType &p) const
 
EIGEN_DEVICE_FUNC Scalar absDistance (const VectorType &p) const
 
EIGEN_DEVICE_FUNC VectorType projection (const VectorType &p) const
 
EIGEN_DEVICE_FUNC ConstNormalReturnType normal () const
 
EIGEN_DEVICE_FUNC NormalReturnType normal ()
 
EIGEN_DEVICE_FUNC const Scalaroffset () const
 
EIGEN_DEVICE_FUNC Scalaroffset ()
 
EIGEN_DEVICE_FUNC const Coefficientscoeffs () const
 
EIGEN_DEVICE_FUNC Coefficientscoeffs ()
 
EIGEN_DEVICE_FUNC VectorType intersection (const Hyperplane &other) const
 
template<typename XprType >
EIGEN_DEVICE_FUNC Hyperplanetransform (const MatrixBase< XprType > &mat, TransformTraits traits=Affine)
 
template<int TrOptions>
EIGEN_DEVICE_FUNC Hyperplanetransform (const Transform< Scalar, AmbientDimAtCompileTime, Affine, TrOptions > &t, TransformTraits traits=Affine)
 
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Hyperplane, Hyperplane< NewScalarType, AmbientDimAtCompileTime, Options > >::type cast () const
 
template<typename OtherScalarType , int OtherOptions>
EIGEN_DEVICE_FUNC Hyperplane (const Hyperplane< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &other)
 
template<int OtherOptions>
EIGEN_DEVICE_FUNC bool isApprox (const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC Hyperplane Through (const VectorType &p0, const VectorType &p1)
 
static EIGEN_DEVICE_FUNC Hyperplane Through (const VectorType &p0, const VectorType &p1, const VectorType &p2)
 

Protected Attributes

Coefficients m_coeffs
 

Member Typedef Documentation

◆ Coefficients

template<typename _Scalar , int _AmbientDim, int _Options>
typedef Matrix<Scalar,Index(AmbientDimAtCompileTime)==Dynamic ? Dynamic : Index(AmbientDimAtCompileTime)+1,1,Options> Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Coefficients

◆ ConstNormalReturnType

template<typename _Scalar , int _AmbientDim, int _Options>
typedef const Block<const Coefficients,AmbientDimAtCompileTime,1> Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::ConstNormalReturnType

◆ Index

template<typename _Scalar , int _AmbientDim, int _Options>
typedef Eigen::Index Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Index

◆ NormalReturnType

template<typename _Scalar , int _AmbientDim, int _Options>
typedef Block<Coefficients,AmbientDimAtCompileTime,1> Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::NormalReturnType

◆ RealScalar

template<typename _Scalar , int _AmbientDim, int _Options>
typedef NumTraits<Scalar>::Real Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::RealScalar

◆ Scalar

template<typename _Scalar , int _AmbientDim, int _Options>
typedef _Scalar Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Scalar

◆ VectorType

template<typename _Scalar , int _AmbientDim, int _Options>
typedef Matrix<Scalar,AmbientDimAtCompileTime,1> Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::VectorType

Member Enumeration Documentation

◆ anonymous enum

template<typename _Scalar , int _AmbientDim, int _Options>
anonymous enum
Enumerator
AmbientDimAtCompileTime 
Options 
38 {
39 AmbientDimAtCompileTime = _AmbientDim,
40 Options = _Options
41 };
@ Options
Definition Hyperplane.h:40
@ AmbientDimAtCompileTime
Definition Hyperplane.h:39

Constructor & Destructor Documentation

◆ Hyperplane() [1/7]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane ( )
inline

Default constructor without initialization

53{}

Referenced by Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::cast().

+ Here is the caller graph for this function:

◆ Hyperplane() [2/7]

template<typename _Scalar , int _AmbientDim, int _Options>
template<int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane ( const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &  other)
inline
57 : m_coeffs(other.coeffs())
58 {}
Coefficients m_coeffs
Definition Hyperplane.h:277

◆ Hyperplane() [3/7]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane ( Index  _dim)
inlineexplicit

Constructs a dynamic-size hyperplane with _dim the dimension of the ambient space

62: m_coeffs(_dim+1) {}

◆ Hyperplane() [4/7]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane ( const VectorType n,
const VectorType e 
)
inline

Construct a plane from its normal n and a point e onto the plane.

Warning
the vector normal is assumed to be normalized.
68 : m_coeffs(n.size()+1)
69 {
70 normal() = n;
71 offset() = -n.dot(e);
72 }
EIGEN_DEVICE_FUNC const Scalar & offset() const
Definition Hyperplane.h:167
EIGEN_DEVICE_FUNC ConstNormalReturnType normal() const
Definition Hyperplane.h:157

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::offset().

+ Here is the call graph for this function:

◆ Hyperplane() [5/7]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane ( const VectorType n,
const Scalar d 
)
inline

Constructs a plane from its normal n and distance to the origin d such that the algebraic equation of the plane is $ n \cdot x + d = 0 $.

Warning
the vector normal is assumed to be normalized.
79 : m_coeffs(n.size()+1)
80 {
81 normal() = n;
82 offset() = d;
83 }

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::offset().

+ Here is the call graph for this function:

◆ Hyperplane() [6/7]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane ( const ParametrizedLine< Scalar, AmbientDimAtCompileTime > &  parametrized)
inlineexplicit

Constructs a hyperplane passing through the parametrized line parametrized. If the dimension of the ambient space is greater than 2, then there isn't uniqueness, so an arbitrary choice is made.

124 {
125 normal() = parametrized.direction().unitOrthogonal();
126 offset() = -parametrized.origin().dot(normal());
127 }

References Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::direction(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::offset(), and Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::origin().

+ Here is the call graph for this function:

◆ ~Hyperplane()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::~Hyperplane ( )
inline
129{}

◆ Hyperplane() [7/7]

template<typename _Scalar , int _AmbientDim, int _Options>
template<typename OtherScalarType , int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane ( const Hyperplane< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &  other)
inlineexplicit

Copy constructor with scalar type conversion

265 { m_coeffs = other.coeffs().template cast<Scalar>(); }

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::coeffs(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.

+ Here is the call graph for this function:

Member Function Documentation

◆ absDistance()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Scalar Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::absDistance ( const VectorType p) const
inline
Returns
the absolute distance between the plane *this and a point p.
See also
signedDistance()
148{ return numext::abs(signedDistance(p)); }
EIGEN_DEVICE_FUNC Scalar signedDistance(const VectorType &p) const
Definition Hyperplane.h:143
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE internal::enable_if< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typenameNumTraits< T >::Real >::type abs(const T &x)
Definition MathFunctions.h:1049

References Eigen::numext::abs(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::signedDistance().

Referenced by Slic3r::Measure::get_measurement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast()

template<typename _Scalar , int _AmbientDim, int _Options>
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Hyperplane, Hyperplane< NewScalarType, AmbientDimAtCompileTime, Options > >::type Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::cast ( ) const
inline
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

257 {
258 return typename internal::cast_return_type<Hyperplane,
259 Hyperplane<NewScalarType,AmbientDimAtCompileTime,Options> >::type(*this);
260 }
EIGEN_DEVICE_FUNC Hyperplane()
Definition Hyperplane.h:53

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane().

+ Here is the call graph for this function:

◆ coeffs() [1/2]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Coefficients & Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::coeffs ( )
inline
Returns
a non-constant reference to the coefficients c_i of the plane equation: $ c_0*x_0 + ... + c_{d-1}*x_{d-1} + c_d = 0 $
181{ return m_coeffs; }

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.

◆ coeffs() [2/2]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC const Coefficients & Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::coeffs ( ) const
inline
Returns
a constant reference to the coefficients c_i of the plane equation: $ c_0*x_0 + ... + c_{d-1}*x_{d-1} + c_d = 0 $
176{ return m_coeffs; }

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.

Referenced by Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::intersection().

+ Here is the caller graph for this function:

◆ dim()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Index Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::dim ( ) const
inline

◆ intersection()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC VectorType Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::intersection ( const Hyperplane< _Scalar, _AmbientDim, _Options > &  other) const
inline
Returns
the intersection of *this with other.
Warning
The ambient space must be a plane, i.e. have dimension 2, so that *this and other are lines.
Note
If other is approximately parallel to *this, this method will return any point on *this.
190 {
192 Scalar det = coeffs().coeff(0) * other.coeffs().coeff(1) - coeffs().coeff(1) * other.coeffs().coeff(0);
193 // since the line equations ax+by=c are normalized with a^2+b^2=1, the following tests
194 // whether the two lines are approximately parallel.
195 if(internal::isMuchSmallerThan(det, Scalar(1)))
196 { // special case where the two lines are approximately parallel. Pick any point on the first line.
197 if(numext::abs(coeffs().coeff(1))>numext::abs(coeffs().coeff(0)))
198 return VectorType(coeffs().coeff(1), -coeffs().coeff(2)/coeffs().coeff(1)-coeffs().coeff(0));
199 else
200 return VectorType(-coeffs().coeff(2)/coeffs().coeff(0)-coeffs().coeff(1), coeffs().coeff(0));
201 }
202 else
203 { // general case
204 Scalar invdet = Scalar(1) / det;
205 return VectorType(invdet*(coeffs().coeff(1)*other.coeffs().coeff(2)-other.coeffs().coeff(1)*coeffs().coeff(2)),
206 invdet*(other.coeffs().coeff(0)*coeffs().coeff(2)-coeffs().coeff(0)*other.coeffs().coeff(2)));
207 }
208 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & coeff(Index rowId, Index colId) const
Definition PlainObjectBase.h:160
EIGEN_DEVICE_FUNC const Coefficients & coeffs() const
Definition Hyperplane.h:176
_Scalar Scalar
Definition Hyperplane.h:42
Matrix< Scalar, AmbientDimAtCompileTime, 1 > VectorType
Definition Hyperplane.h:45

References Eigen::numext::abs(), Eigen::PlainObjectBase< Derived >::coeff(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::coeffs(), EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::internal::isMuchSmallerThan().

Referenced by Slic3r::Measure::angle_edge_edge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isApprox()

template<typename _Scalar , int _AmbientDim, int _Options>
template<int OtherOptions>
EIGEN_DEVICE_FUNC bool Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::isApprox ( const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &  other,
const typename NumTraits< Scalar >::Real &  prec = NumTraits<Scalar>::dummy_precision() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()
273 { return m_coeffs.isApprox(other.m_coeffs, prec); }

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.

◆ normal() [1/2]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC NormalReturnType Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal ( )
inline
Returns
a non-constant reference to the unit normal vector of the plane, which corresponds to the linear part of the implicit equation.
162{ return NormalReturnType(m_coeffs,0,0,dim(),1); }
EIGEN_DEVICE_FUNC Index dim() const
Definition Hyperplane.h:132
Block< Coefficients, AmbientDimAtCompileTime, 1 > NormalReturnType
Definition Hyperplane.h:49

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::dim(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.

+ Here is the call graph for this function:

◆ normal() [2/2]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC ConstNormalReturnType Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal ( ) const
inline
Returns
a constant reference to the unit normal vector of the plane, which corresponds to the linear part of the implicit equation.
157{ return ConstNormalReturnType(m_coeffs,0,0,dim(),1); }
const Block< const Coefficients, AmbientDimAtCompileTime, 1 > ConstNormalReturnType
Definition Hyperplane.h:50

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::dim(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.

Referenced by Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane(), Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::ParametrizedLine(), Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::intersectionParameter(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normalize(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::projection(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::signedDistance(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Through(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Through(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::transform(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalize()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC void Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normalize ( void  )
inline

normalizes *this

136 {
137 m_coeffs /= normal().norm();
138 }

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs, and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal().

+ Here is the call graph for this function:

◆ offset() [1/2]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Scalar & Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::offset ( )
inline
Returns
a non-constant reference to the distance to the origin, which is also the constant part of the implicit equation
171{ return m_coeffs(dim()); }

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::dim(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.

+ Here is the call graph for this function:

◆ offset() [2/2]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC const Scalar & Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::offset ( ) const
inline

◆ projection()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC VectorType Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::projection ( const VectorType p) const
inline
Returns
the projection of a point p onto the plane *this.
152{ return p - signedDistance(p) * normal(); }

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::signedDistance().

Referenced by Slic3r::Measure::angle_edge_edge(), Slic3r::sla::DrainHole::get_intersections(), and Slic3r::Measure::get_measurement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ signedDistance()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Scalar Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::signedDistance ( const VectorType p) const
inline
Returns
the signed distance between the plane *this and a point p.
See also
absDistance()
143{ return normal().dot(p) + offset(); }

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::offset().

Referenced by Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::absDistance(), Slic3r::sla::DrainHole::get_intersections(), Slic3r::sla::DrainHole::is_inside(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::projection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Through() [1/2]

template<typename _Scalar , int _AmbientDim, int _Options>
static EIGEN_DEVICE_FUNC Hyperplane Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Through ( const VectorType p0,
const VectorType p1 
)
inlinestatic

Constructs a hyperplane passing through the two points. If the dimension of the ambient space is greater than 2, then there isn't uniqueness, so an arbitrary choice is made.

89 {
90 Hyperplane result(p0.size());
91 result.normal() = (p1 - p0).unitOrthogonal();
92 result.offset() = -p0.dot(result.normal());
93 return result;
94 }

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::offset().

Referenced by Slic3r::Measure::angle_edge_edge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Through() [2/2]

template<typename _Scalar , int _AmbientDim, int _Options>
static EIGEN_DEVICE_FUNC Hyperplane Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::Through ( const VectorType p0,
const VectorType p1,
const VectorType p2 
)
inlinestatic

Constructs a hyperplane passing through the three points. The dimension of the ambient space is required to be exactly 3.

100 {
102 Hyperplane result(p0.size());
103 VectorType v0(p2 - p0), v1(p1 - p0);
104 result.normal() = v0.cross(v1);
105 RealScalar norm = result.normal().norm();
106 if(norm <= v0.norm() * v1.norm() * NumTraits<RealScalar>::epsilon())
107 {
108 Matrix<Scalar,2,3> m; m << v0.transpose(), v1.transpose();
109 JacobiSVD<Matrix<Scalar,2,3> > svd(m, ComputeFullV);
110 result.normal() = svd.matrixV().col(2);
111 }
112 else
113 result.normal() /= norm;
114 result.offset() = -p0.dot(result.normal());
115 return result;
116 }
NumTraits< Scalar >::Real RealScalar
Definition Hyperplane.h:43
@ ComputeFullV
Definition Constants.h:387

References Eigen::ComputeFullV, EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, Eigen::SVDBase< Derived >::matrixV(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::offset().

+ Here is the call graph for this function:

◆ transform() [1/2]

template<typename _Scalar , int _AmbientDim, int _Options>
template<typename XprType >
EIGEN_DEVICE_FUNC Hyperplane & Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::transform ( const MatrixBase< XprType > &  mat,
TransformTraits  traits = Affine 
)
inline

Applies the transformation matrix mat to *this and returns a reference to *this.

Parameters
matthe Dim x Dim transformation matrix
traitsspecifies whether the matrix mat represents an Isometry or a more generic Affine transformation. The default is Affine.
218 {
219 if (traits==Affine)
220 {
221 normal() = mat.inverse().transpose() * normal();
222 m_coeffs /= normal().norm();
223 }
224 else if (traits==Isometry)
225 normal() = mat * normal();
226 else
227 {
228 eigen_assert(0 && "invalid traits value in Hyperplane::transform()");
229 }
230 return *this;
231 }
@ Affine
Definition Constants.h:450
@ Isometry
Definition Constants.h:447

References Eigen::Affine, eigen_assert, Eigen::MatrixBase< Derived >::inverse(), Eigen::Isometry, Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs, and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal().

Referenced by Slic3r::GUI::MeshClipper::recalculate_triangles(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transform() [2/2]

template<typename _Scalar , int _AmbientDim, int _Options>
template<int TrOptions>
EIGEN_DEVICE_FUNC Hyperplane & Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::transform ( const Transform< Scalar, AmbientDimAtCompileTime, Affine, TrOptions > &  t,
TransformTraits  traits = Affine 
)
inline

Applies the transformation t to *this and returns a reference to *this.

Parameters
tthe transformation of dimension Dim
traitsspecifies whether the transformation t represents an Isometry or a more generic Affine transformation. The default is Affine. Other kind of transformations are not supported.
243 {
244 transform(t.linear(), traits);
245 offset() -= normal().dot(t.translation());
246 return *this;
247 }
EIGEN_DEVICE_FUNC Hyperplane & transform(const MatrixBase< XprType > &mat, TransformTraits traits=Affine)
Definition Hyperplane.h:217

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::offset(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::transform(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translation().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_coeffs

◆ Eigen::ParametrizedLine

class Eigen::ParametrizedLine
template<typename _Scalar, int _AmbientDim, int _Options>
class Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >

A parametrized line.

\geometry_module

A parametrized line is defined by an origin point $ \mathbf{o} $ and a unit direction vector $ \mathbf{d} $ such that the line corresponds to the set $ l(t) = \mathbf{o} + t \mathbf{d} $, $ t \in \mathbf{R} $.

Template Parameters
_Scalarthe scalar type, i.e., the type of the coefficients
_AmbientDimthe dimension of the ambient space, can be a compile time value or Dynamic.
+ Collaboration diagram for Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >:

Public Types

enum  { AmbientDimAtCompileTime = _AmbientDim , Options = _Options }
 
typedef _Scalar Scalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef Eigen::Index Index
 
typedef Matrix< Scalar, AmbientDimAtCompileTime, 1, OptionsVectorType
 

Public Member Functions

EIGEN_DEVICE_FUNC ParametrizedLine ()
 
template<int OtherOptions>
EIGEN_DEVICE_FUNC ParametrizedLine (const ParametrizedLine< Scalar, AmbientDimAtCompileTime, OtherOptions > &other)
 
EIGEN_DEVICE_FUNC ParametrizedLine (Index _dim)
 
EIGEN_DEVICE_FUNC ParametrizedLine (const VectorType &origin, const VectorType &direction)
 
template<int OtherOptions>
EIGEN_DEVICE_FUNC ParametrizedLine (const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &hyperplane)
 
EIGEN_DEVICE_FUNC ~ParametrizedLine ()
 
EIGEN_DEVICE_FUNC Index dim () const
 
EIGEN_DEVICE_FUNC const VectorTypeorigin () const
 
EIGEN_DEVICE_FUNC VectorTypeorigin ()
 
EIGEN_DEVICE_FUNC const VectorTypedirection () const
 
EIGEN_DEVICE_FUNC VectorTypedirection ()
 
EIGEN_DEVICE_FUNC RealScalar squaredDistance (const VectorType &p) const
 
EIGEN_DEVICE_FUNC RealScalar distance (const VectorType &p) const
 
EIGEN_DEVICE_FUNC VectorType projection (const VectorType &p) const
 
EIGEN_DEVICE_FUNC VectorType pointAt (const Scalar &t) const
 
template<int OtherOptions>
EIGEN_DEVICE_FUNC Scalar intersectionParameter (const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &hyperplane) const
 
template<int OtherOptions>
EIGEN_DEVICE_FUNC Scalar intersection (const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &hyperplane) const
 
template<int OtherOptions>
EIGEN_DEVICE_FUNC VectorType intersectionPoint (const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &hyperplane) const
 
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< ParametrizedLine, ParametrizedLine< NewScalarType, AmbientDimAtCompileTime, Options > >::type cast () const
 
template<typename OtherScalarType , int OtherOptions>
EIGEN_DEVICE_FUNC ParametrizedLine (const ParametrizedLine< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &other)
 
EIGEN_DEVICE_FUNC bool isApprox (const ParametrizedLine &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<int OtherOptions>
EIGEN_DEVICE_FUNC _Scalar intersectionParameter (const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &hyperplane) const
 
template<int OtherOptions>
EIGEN_DEVICE_FUNC _Scalar intersection (const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &hyperplane) const
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC ParametrizedLine Through (const VectorType &p0, const VectorType &p1)
 

Protected Attributes

VectorType m_origin
 
VectorType m_direction
 

Member Typedef Documentation

◆ Index

template<typename _Scalar , int _AmbientDim, int _Options>
typedef Eigen::Index Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::Index

◆ RealScalar

template<typename _Scalar , int _AmbientDim, int _Options>
typedef NumTraits<Scalar>::Real Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::RealScalar

◆ Scalar

template<typename _Scalar , int _AmbientDim, int _Options>
typedef _Scalar Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::Scalar

◆ VectorType

template<typename _Scalar , int _AmbientDim, int _Options>
typedef Matrix<Scalar,AmbientDimAtCompileTime,1,Options> Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::VectorType

Member Enumeration Documentation

◆ anonymous enum

template<typename _Scalar , int _AmbientDim, int _Options>
anonymous enum
Enumerator
AmbientDimAtCompileTime 
Options 
34 {
35 AmbientDimAtCompileTime = _AmbientDim,
36 Options = _Options
37 };
@ AmbientDimAtCompileTime
Definition ParametrizedLine.h:35
@ Options
Definition ParametrizedLine.h:36

Constructor & Destructor Documentation

◆ ParametrizedLine() [1/6]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::ParametrizedLine ( )
inline

Default constructor without initialization

44{}

Referenced by Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::cast(), and Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::Through().

+ Here is the caller graph for this function:

◆ ParametrizedLine() [2/6]

template<typename _Scalar , int _AmbientDim, int _Options>
template<int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::ParametrizedLine ( const ParametrizedLine< Scalar, AmbientDimAtCompileTime, OtherOptions > &  other)
inline
48 : m_origin(other.origin()), m_direction(other.direction())
49 {}
VectorType m_direction
Definition ParametrizedLine.h:137
VectorType m_origin
Definition ParametrizedLine.h:137

◆ ParametrizedLine() [3/6]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::ParametrizedLine ( Index  _dim)
inlineexplicit

Constructs a dynamic-size line with _dim the dimension of the ambient space

53: m_origin(_dim), m_direction(_dim) {}

◆ ParametrizedLine() [4/6]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::ParametrizedLine ( const VectorType origin,
const VectorType direction 
)
inline

Initializes a parametrized line of direction direction and origin origin.

Warning
the vector direction is assumed to be normalized.
EIGEN_DEVICE_FUNC const VectorType & direction() const
Definition ParametrizedLine.h:76
EIGEN_DEVICE_FUNC const VectorType & origin() const
Definition ParametrizedLine.h:73

◆ ParametrizedLine() [5/6]

template<typename _Scalar , int _AmbientDim, int _Options>
template<int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::ParametrizedLine ( const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &  hyperplane)
inlineexplicit

Constructs a parametrized line from a 2D hyperplane

Warning
the ambient space must have dimension 2 such that the hyperplane actually describes a line
147{
149 direction() = hyperplane.normal().unitOrthogonal();
150 origin() = -hyperplane.normal()*hyperplane.offset();
151}
Matrix< Scalar, AmbientDimAtCompileTime, 1, Options > VectorType
Definition ParametrizedLine.h:41

References EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::offset().

+ Here is the call graph for this function:

◆ ~ParametrizedLine()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::~ParametrizedLine ( )
inline
68{}

◆ ParametrizedLine() [6/6]

template<typename _Scalar , int _AmbientDim, int _Options>
template<typename OtherScalarType , int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::ParametrizedLine ( const ParametrizedLine< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &  other)
inlineexplicit

Copy constructor with scalar type conversion

123 {
124 m_origin = other.origin().template cast<Scalar>();
125 m_direction = other.direction().template cast<Scalar>();
126 }

References Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::direction(), Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::m_direction, Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::m_origin, and Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::origin().

+ Here is the call graph for this function:

Member Function Documentation

◆ cast()

template<typename _Scalar , int _AmbientDim, int _Options>
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< ParametrizedLine, ParametrizedLine< NewScalarType, AmbientDimAtCompileTime, Options > >::type Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::cast ( ) const
inline
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

115 {
116 return typename internal::cast_return_type<ParametrizedLine,
117 ParametrizedLine<NewScalarType,AmbientDimAtCompileTime,Options> >::type(*this);
118 }
EIGEN_DEVICE_FUNC ParametrizedLine()
Definition ParametrizedLine.h:44

References Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::ParametrizedLine().

+ Here is the call graph for this function:

◆ dim()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC Index Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::dim ( ) const
inline
Returns
the dimension in which the line holds
71{ return m_direction.size(); }

References Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::m_direction.

◆ direction() [1/2]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC VectorType & Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::direction ( )
inline

◆ direction() [2/2]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC const VectorType & Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::direction ( ) const
inline

◆ distance()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC RealScalar Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::distance ( const VectorType p) const
inline
Returns
the distance of a point p to its projection onto the line *this.
See also
squaredDistance()
90{ EIGEN_USING_STD_MATH(sqrt) return sqrt(squaredDistance(p)); }
EIGEN_DEVICE_FUNC RealScalar squaredDistance(const VectorType &p) const
Definition ParametrizedLine.h:82

References sqrt(), and Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::squaredDistance().

Referenced by Slic3r::Measure::get_measurement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ intersection() [1/2]

template<typename _Scalar , int _AmbientDim, int _Options>
template<int OtherOptions>
EIGEN_DEVICE_FUNC Scalar Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::intersection ( const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &  hyperplane) const

◆ intersection() [2/2]

template<typename _Scalar , int _AmbientDim, int _Options>
template<int OtherOptions>
EIGEN_DEVICE_FUNC _Scalar Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::intersection ( const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &  hyperplane) const
inline
Returns
the parameter value of the intersection between *this and the given hyperplane
179{
180 return intersectionParameter(hyperplane);
181}
EIGEN_DEVICE_FUNC Scalar intersectionParameter(const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &hyperplane) const

◆ intersectionParameter() [1/2]

template<typename _Scalar , int _AmbientDim, int _Options>
template<int OtherOptions>
EIGEN_DEVICE_FUNC Scalar Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::intersectionParameter ( const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &  hyperplane) const

Referenced by Slic3r::sla::DrainHole::get_intersections().

+ Here is the caller graph for this function:

◆ intersectionParameter() [2/2]

template<typename _Scalar , int _AmbientDim, int _Options>
template<int OtherOptions>
EIGEN_DEVICE_FUNC _Scalar Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::intersectionParameter ( const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &  hyperplane) const
inline
Returns
the parameter value of the intersection between *this and the given hyperplane
167{
168 return -(hyperplane.offset()+hyperplane.normal().dot(origin()))
169 / hyperplane.normal().dot(direction());
170}

References Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::offset().

+ Here is the call graph for this function:

◆ intersectionPoint()

template<typename _Scalar , int _AmbientDim, int _Options>
template<int OtherOptions>
EIGEN_DEVICE_FUNC ParametrizedLine< _Scalar, _AmbientDim, _Options >::VectorType Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::intersectionPoint ( const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &  hyperplane) const
inline
Returns
the point of the intersection between *this and the given hyperplane
189{
190 return pointAt(intersectionParameter(hyperplane));
191}
EIGEN_DEVICE_FUNC VectorType pointAt(const Scalar &t) const
Definition ParametrizedLine.h:157

Referenced by Slic3r::Measure::angle_edge_plane(), Slic3r::sla::DrainHole::get_intersections(), and Slic3r::Measure::get_measurement().

+ Here is the caller graph for this function:

◆ isApprox()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC bool Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::isApprox ( const ParametrizedLine< _Scalar, _AmbientDim, _Options > &  other,
const typename NumTraits< Scalar >::Real &  prec = NumTraits<Scalar>::dummy_precision() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()
133 { return m_origin.isApprox(other.m_origin, prec) && m_direction.isApprox(other.m_direction, prec); }

References Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::m_direction, and Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::m_origin.

◆ origin() [1/2]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC VectorType & Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::origin ( )
inline

◆ origin() [2/2]

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC const VectorType & Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::origin ( ) const
inline

◆ pointAt()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC ParametrizedLine< _Scalar, _AmbientDim, _Options >::VectorType Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::pointAt ( const Scalar t) const
inline
Returns
the point at t along this line
158{
159 return origin() + (direction()*t);
160}

Referenced by Slic3r::sla::DrainHole::get_intersections().

+ Here is the caller graph for this function:

◆ projection()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC VectorType Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::projection ( const VectorType p) const
inline
Returns
the projection of a point p onto the line *this.
94 { return origin() + direction().dot(p-origin()) * direction(); }

References Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::direction(), and Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::origin().

Referenced by Slic3r::Measure::angle_plane_plane(), Slic3r::sla::DrainHole::get_intersections(), and Slic3r::Measure::get_measurement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ squaredDistance()

template<typename _Scalar , int _AmbientDim, int _Options>
EIGEN_DEVICE_FUNC RealScalar Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::squaredDistance ( const VectorType p) const
inline
Returns
the squared distance of a point p to its projection onto the line *this.
See also
distance()
83 {
84 VectorType diff = p - origin();
85 return (diff - direction().dot(diff) * direction()).squaredNorm();
86 }
Slic3r::Polygons diff(const Slic3r::Polygon &subject, const Slic3r::Polygon &clip, ApplySafetyOffset do_safety_offset)
Definition ClipperUtils.cpp:672
IGL_INLINE double dot(const double *a, const double *b)
Definition dot.cpp:11

References Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::direction(), and Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::origin().

Referenced by Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::distance(), Slic3r::sla::DrainHole::get_intersections(), and Slic3r::sla::DrainHole::is_inside().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Through()

template<typename _Scalar , int _AmbientDim, int _Options>
static EIGEN_DEVICE_FUNC ParametrizedLine Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::Through ( const VectorType p0,
const VectorType p1 
)
inlinestatic

Constructs a parametrized line going from p0 to p1.

66 { return ParametrizedLine(p0, (p1-p0).normalized()); }

References Eigen::ParametrizedLine< _Scalar, _AmbientDim, _Options >::ParametrizedLine().

Referenced by Slic3r::Measure::angle_edge_plane(), and Slic3r::Measure::get_measurement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_direction

◆ m_origin

◆ Eigen::QuaternionBase

class Eigen::QuaternionBase
template<class Derived>
class Eigen::QuaternionBase< Derived >

Base class for quaternion expressions.

\geometry_module

Template Parameters
Derivedderived type (CRTP)
See also
class Quaternion
+ Inheritance diagram for Eigen::QuaternionBase< Derived >:
+ Collaboration diagram for Eigen::QuaternionBase< Derived >:

Public Types

enum  { Flags = Eigen::internal::traits<Derived>::Flags }
 
typedef RotationBase< Derived, 3 > Base
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef internal::traits< Derived >::Coefficients Coefficients
 
typedef Coefficients::CoeffReturnType CoeffReturnType
 
typedef internal::conditional< bool(internal::traits< Derived >::Flags &LvalueBit), Scalar &, CoeffReturnType >::type NonConstCoeffReturnType
 
typedef Matrix< Scalar, 3, 1 > Vector3
 
typedef Matrix< Scalar, 3, 3 > Matrix3
 
typedef AngleAxis< ScalarAngleAxisType
 
enum  
 
typedef Matrix< Scalar, Dim, DimRotationMatrixType
 
typedef Matrix< Scalar, Dim, 1 > VectorType
 

Public Member Functions

EIGEN_DEVICE_FUNC CoeffReturnType x () const
 
EIGEN_DEVICE_FUNC CoeffReturnType y () const
 
EIGEN_DEVICE_FUNC CoeffReturnType z () const
 
EIGEN_DEVICE_FUNC CoeffReturnType w () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType x ()
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType y ()
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType z ()
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType w ()
 
EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > vec () const
 
EIGEN_DEVICE_FUNC VectorBlock< Coefficients, 3 > vec ()
 
EIGEN_DEVICE_FUNC const internal::traits< Derived >::Coefficientscoeffs () const
 
EIGEN_DEVICE_FUNC internal::traits< Derived >::Coefficientscoeffs ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE QuaternionBase< Derived > & operator= (const QuaternionBase< Derived > &other)
 
template<class OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator= (const QuaternionBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC Derived & operator= (const AngleAxisType &aa)
 
template<class OtherDerived >
EIGEN_DEVICE_FUNC Derived & operator= (const MatrixBase< OtherDerived > &m)
 
EIGEN_DEVICE_FUNC QuaternionBasesetIdentity ()
 
EIGEN_DEVICE_FUNC Scalar squaredNorm () const
 
EIGEN_DEVICE_FUNC Scalar norm () const
 
EIGEN_DEVICE_FUNC void normalize ()
 
EIGEN_DEVICE_FUNC Quaternion< Scalarnormalized () const
 
template<class OtherDerived >
EIGEN_DEVICE_FUNC Scalar dot (const QuaternionBase< OtherDerived > &other) const
 
template<class OtherDerived >
EIGEN_DEVICE_FUNC Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Matrix3 toRotationMatrix () const
 
template<typename Derived1 , typename Derived2 >
EIGEN_DEVICE_FUNC Derived & setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
 
template<class OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< Scalaroperator* (const QuaternionBase< OtherDerived > &q) const
 
template<class OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator*= (const QuaternionBase< OtherDerived > &q)
 
EIGEN_DEVICE_FUNC Quaternion< Scalarinverse () const
 
EIGEN_DEVICE_FUNC Quaternion< Scalarconjugate () const
 
template<class OtherDerived >
EIGEN_DEVICE_FUNC Quaternion< Scalarslerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const
 
template<class OtherDerived >
EIGEN_DEVICE_FUNC bool isApprox (const QuaternionBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Vector3 _transformVector (const Vector3 &v) const
 
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Derived, Quaternion< NewScalarType > >::type cast () const
 
template<class OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Derived >::Scalaroperator* (const QuaternionBase< OtherDerived > &other) const
 
template<class MatrixDerived >
EIGEN_DEVICE_FUNC Derived & operator= (const MatrixBase< MatrixDerived > &xpr)
 
template<class OtherDerived >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
 
template<class OtherDerived >
EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Derived >::Scalarslerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC const Derived & derived () const
 
EIGEN_DEVICE_FUNC Derived & derived ()
 
EIGEN_DEVICE_FUNC RotationMatrixType matrix () const
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometryoperator* (const Translation< Scalar, Dim > &t) const
 
EIGEN_DEVICE_FUNC RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator* (const EigenBase< OtherDerived > &e) const
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
 
EIGEN_DEVICE_FUNC VectorType _transformVector (const OtherVectorType &v) const
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC Quaternion< ScalarIdentity ()
 

Member Typedef Documentation

◆ AngleAxisType

template<class Derived >
typedef AngleAxis<Scalar> Eigen::QuaternionBase< Derived >::AngleAxisType

the equivalent angle-axis type

◆ Base

template<class Derived >
typedef RotationBase<Derived, 3> Eigen::QuaternionBase< Derived >::Base

◆ Coefficients

template<class Derived >
typedef internal::traits<Derived>::Coefficients Eigen::QuaternionBase< Derived >::Coefficients

◆ CoeffReturnType

template<class Derived >
typedef Coefficients::CoeffReturnType Eigen::QuaternionBase< Derived >::CoeffReturnType

◆ Matrix3

template<class Derived >
typedef Matrix<Scalar,3,3> Eigen::QuaternionBase< Derived >::Matrix3

the equivalent rotation matrix type

◆ NonConstCoeffReturnType

template<class Derived >
typedef internal::conditional<bool(internal::traits<Derived>::Flags&LvalueBit),Scalar&,CoeffReturnType>::type Eigen::QuaternionBase< Derived >::NonConstCoeffReturnType

◆ RealScalar

template<class Derived >
typedef NumTraits<Scalar>::Real Eigen::QuaternionBase< Derived >::RealScalar

◆ RotationMatrixType

typedef Matrix<Scalar,Dim,Dim> Eigen::RotationBase< Derived, _Dim >::RotationMatrixType
inherited

corresponding linear transformation matrix type

◆ Scalar

template<class Derived >
typedef internal::traits<Derived>::Scalar Eigen::QuaternionBase< Derived >::Scalar

◆ Vector3

template<class Derived >
typedef Matrix<Scalar,3,1> Eigen::QuaternionBase< Derived >::Vector3

the type of a 3D vector

◆ VectorType

typedef Matrix<Scalar,Dim,1> Eigen::RotationBase< Derived, _Dim >::VectorType
inherited

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
32{ Dim = _Dim };

◆ anonymous enum

template<class Derived >
anonymous enum
Enumerator
Flags 

Member Function Documentation

◆ _transformVector() [1/2]

EIGEN_DEVICE_FUNC VectorType Eigen::RotationBase< Derived, _Dim >::_transformVector ( const OtherVectorType &  v) const
inlineinherited
94 { return toRotationMatrix() * v; }

◆ _transformVector() [2/2]

template<class Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE QuaternionBase< Derived >::Vector3 Eigen::QuaternionBase< Derived >::_transformVector ( const Vector3 v) const

return the result vector of v through the rotation

Rotation of a vector by a quaternion.

Remarks
If the quaternion is used to rotate several points (>1) then it is much more efficient to first convert it to a 3x3 Matrix. Comparison of the operation cost for n transformations:
  • Quaternion2: 30n
  • Via a Matrix3: 24 + 15n
476{
477 // Note that this algorithm comes from the optimization by hand
478 // of the conversion to a Matrix followed by a Matrix/Vector product.
479 // It appears to be much faster than the common algorithm found
480 // in the literature (30 versus 39 flops). It also requires two
481 // Vector3 as temporaries.
482 Vector3 uv = this->vec().cross(v);
483 uv += uv;
484 return v + this->w() * uv + this->vec().cross(uv);
485}

◆ angularDistance() [1/2]

template<class Derived >
template<class OtherDerived >
EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Derived >::angularDistance ( const QuaternionBase< OtherDerived > &  other) const

◆ angularDistance() [2/2]

template<class Derived >
template<class OtherDerived >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar Eigen::QuaternionBase< Derived >::angularDistance ( const QuaternionBase< OtherDerived > &  other) const
inline
Returns
the angle (in radian) between two rotations
See also
dot()
709{
710 EIGEN_USING_STD_MATH(atan2)
711 Quaternion<Scalar> d = (*this) * other.conjugate();
712 return Scalar(2) * atan2( d.vec().norm(), numext::abs(d.w()) );
713}

References Eigen::numext::abs(), and Eigen::QuaternionBase< Derived >::conjugate().

+ Here is the call graph for this function:

◆ cast()

template<class Derived >
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Derived, Quaternion< NewScalarType > >::type Eigen::QuaternionBase< Derived >::cast ( ) const
inline
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

179 {
180 return typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type(derived());
181 }

References Eigen::RotationBase< Derived, 3 >::derived().

+ Here is the call graph for this function:

◆ coeffs() [1/2]

template<class Derived >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Coefficients & Eigen::QuaternionBase< Derived >::coeffs ( )
inline
Returns
a vector expression of the coefficients (x,y,z,w)
93{ return derived().coeffs(); }

References Eigen::RotationBase< Derived, 3 >::derived().

+ Here is the call graph for this function:

◆ coeffs() [2/2]

template<class Derived >
EIGEN_DEVICE_FUNC const internal::traits< Derived >::Coefficients & Eigen::QuaternionBase< Derived >::coeffs ( ) const
inline

◆ conjugate()

template<class Derived >
EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Derived >::Scalar > Eigen::QuaternionBase< Derived >::conjugate
inline
Returns
the conjugated quaternion
the conjugate of the *this which is equal to the multiplicative inverse if the quaternion is normalized. The conjugate of a quaternion represents the opposite rotation.
See also
Quaternion2::inverse()
696{
697 return internal::quat_conj<Architecture::Target, Derived,
698 typename internal::traits<Derived>::Scalar>::run(*this);
699
700}
@ Target
Definition Constants.h:476

References Eigen::Architecture::Target.

Referenced by Eigen::QuaternionBase< Derived >::angularDistance(), igl::opengl2::MouseController::drag(), igl::opengl2::RotateWidget::drag(), igl::opengl2::RotateWidget::draw_guide(), igl::Camera::orbit(), Slic3r::GUI::Camera::rotate_local_around_target(), and igl::Camera::turn_eye().

+ Here is the caller graph for this function:

◆ derived() [1/2]

EIGEN_DEVICE_FUNC Derived & Eigen::RotationBase< Derived, _Dim >::derived ( )
inlineinherited
42{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

EIGEN_DEVICE_FUNC const Derived & Eigen::RotationBase< Derived, _Dim >::derived ( ) const
inlineinherited
41{ return *static_cast<const Derived*>(this); }

◆ dot()

template<class Derived >
template<class OtherDerived >
EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Derived >::dot ( const QuaternionBase< OtherDerived > &  other) const
inline
Returns
the dot product of *this and other Geometrically speaking, the dot product of two unit quaternions corresponds to the cosine of half the angle between the two rotations.
See also
angularDistance()
139{ return coeffs().dot(other.coeffs()); }

References Eigen::QuaternionBase< Derived >::coeffs().

Referenced by igl::angular_distance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Identity()

template<class Derived >
static EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Derived >::Identity ( )
inlinestatic
Returns
a quaternion representing an identity rotation
See also
MatrixBase::Identity()
111{ return Quaternion<Scalar>(Scalar(1), Scalar(0), Scalar(0), Scalar(0)); }

◆ inverse()

template<class Derived >
EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Derived >::Scalar > Eigen::QuaternionBase< Derived >::inverse
inline
Returns
the quaternion describing the inverse rotation
the multiplicative inverse of *this Note that in most cases, i.e., if you simply want the opposite rotation, and/or the quaternion is normalized, then it is enough to use the conjugate.
See also
QuaternionBase::conjugate()
665{
666 // FIXME should this function be called multiplicativeInverse and conjugate() be called inverse() or opposite() ??
667 Scalar n2 = this->squaredNorm();
668 if (n2 > Scalar(0))
669 return Quaternion<Scalar>(conjugate().coeffs() / n2);
670 else
671 {
672 // return an invalid result to flag the error
673 return Quaternion<Scalar>(Coefficients::Zero());
674 }
675}
EIGEN_DEVICE_FUNC Quaternion< Scalar > conjugate() const
Definition Quaternion.h:695

References conjugate().

+ Here is the call graph for this function:

◆ isApprox()

template<class Derived >
template<class OtherDerived >
EIGEN_DEVICE_FUNC bool Eigen::QuaternionBase< Derived >::isApprox ( const QuaternionBase< OtherDerived > &  other,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()
167 { return coeffs().isApprox(other.coeffs(), prec); }

References Eigen::QuaternionBase< Derived >::coeffs().

+ Here is the call graph for this function:

◆ matrix()

EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< Derived, _Dim >::matrix ( ) const
inlineinherited
Returns
an equivalent rotation matrix This function is added to be conform with the Transform class' naming scheme.
50{ return derived().toRotationMatrix(); }

◆ norm()

template<class Derived >
EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Derived >::norm ( ) const
inline
Returns
the norm of the quaternion's coefficients
See also
QuaternionBase::squaredNorm(), MatrixBase::norm()
125{ return coeffs().norm(); }

References Eigen::QuaternionBase< Derived >::coeffs().

Referenced by igl::angular_distance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalize()

template<class Derived >
EIGEN_DEVICE_FUNC void Eigen::QuaternionBase< Derived >::normalize ( )
inline

Normalizes the quaternion *this

See also
normalized(), MatrixBase::normalize()
129{ coeffs().normalize(); }

References Eigen::QuaternionBase< Derived >::coeffs().

Referenced by igl::opengl2::RotateWidget::drag(), Slic3r::GUI::Camera::look_at(), Slic3r::GUI::Camera::rotate_local_around_target(), Slic3r::GUI::Camera::rotate_on_sphere(), Slic3r::GUI::Camera::set_default_orientation(), and igl::two_axis_valuator_fixed_up().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalized()

template<class Derived >
EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Derived >::normalized ( ) const
inline
Returns
a normalized copy of *this
See also
normalize(), MatrixBase::normalized()
132{ return Quaternion<Scalar>(coeffs().normalized()); }

References Eigen::QuaternionBase< Derived >::coeffs(), and Eigen::QuaternionBase< Derived >::normalized().

Referenced by Eigen::QuaternionBase< Derived >::normalized().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator*() [1/6]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType Eigen::RotationBase< Derived, _Dim >::operator* ( const EigenBase< OtherDerived > &  e) const
inlineinherited
Returns
the concatenation of the rotation *this with a generic expression e e can be:
  • a DimxDim linear transformation matrix
  • a DimxDim diagonal matrix (axis aligned scaling)
  • a vector of size Dim
72 { return internal::rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); }

◆ operator*() [2/6]

template<class Derived >
template<class OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Derived >::Scalar > Eigen::QuaternionBase< Derived >::operator* ( const QuaternionBase< OtherDerived > &  other) const
Returns
the concatenation of two rotations as a quaternion-quaternion product
450{
452 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
453 return internal::quat_product<Architecture::Target, Derived, OtherDerived,
454 typename internal::traits<Derived>::Scalar>::run(*this, other);
455}

References EIGEN_STATIC_ASSERT, and Eigen::Architecture::Target.

◆ operator*() [3/6]

template<class Derived >
template<class OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< Scalar > Eigen::QuaternionBase< Derived >::operator* ( const QuaternionBase< OtherDerived > &  q) const

◆ operator*() [4/6]

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > Eigen::RotationBase< Derived, _Dim >::operator* ( const Transform< Scalar, Dim, Mode, Options > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a transformation t
90 { return toRotationMatrix() * t; }

◆ operator*() [5/6]

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometry > Eigen::RotationBase< Derived, _Dim >::operator* ( const Translation< Scalar, Dim > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a translation t
57 { return Transform<Scalar,Dim,Isometry>(*this) * t; }

◆ operator*() [6/6]

EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< Derived, _Dim >::operator* ( const UniformScaling< Scalar > &  s) const
inlineinherited
Returns
the concatenation of the rotation *this with a uniform scaling s
61 { return toRotationMatrix() * s.factor(); }

◆ operator*=()

template<class Derived >
template<class OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::QuaternionBase< Derived >::operator*= ( const QuaternionBase< OtherDerived > &  other)
See also
operator*(Quaternion)
461{
462 derived() = derived() * other.derived();
463 return derived();
464}

References Eigen::RotationBase< Derived, _Dim >::derived().

+ Here is the call graph for this function:

◆ operator=() [1/5]

template<class Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::QuaternionBase< Derived >::operator= ( const AngleAxisType aa)

Set *this from an angle-axis aa and returns a reference to *this

506{
507 EIGEN_USING_STD_MATH(cos)
508 EIGEN_USING_STD_MATH(sin)
509 Scalar ha = Scalar(0.5)*aa.angle(); // Scalar(0.5) to suppress precision loss warnings
510 this->w() = cos(ha);
511 this->vec() = sin(ha) * aa.axis();
512 return derived();
513}

References Eigen::AngleAxis< _Scalar >::angle(), Eigen::AngleAxis< _Scalar >::axis(), cos(), and sin().

+ Here is the call graph for this function:

◆ operator=() [2/5]

template<class Derived >
template<class MatrixDerived >
EIGEN_DEVICE_FUNC Derived & Eigen::QuaternionBase< Derived >::operator= ( const MatrixBase< MatrixDerived > &  xpr)
inline

Set *this from the expression xpr:

  • if xpr is a 4x1 vector, then xpr is assumed to be a quaternion
  • if xpr is a 3x3 matrix, then xpr is assumed to be rotation matrix and xpr is converted to a quaternion
524{
526 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
527 internal::quaternionbase_assign_impl<MatrixDerived>::run(*this, xpr.derived());
528 return derived();
529}

References EIGEN_STATIC_ASSERT.

◆ operator=() [3/5]

template<class Derived >
template<class OtherDerived >
EIGEN_DEVICE_FUNC Derived & Eigen::QuaternionBase< Derived >::operator= ( const MatrixBase< OtherDerived > &  m)

◆ operator=() [4/5]

template<class Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE QuaternionBase< Derived > & Eigen::QuaternionBase< Derived >::operator= ( const QuaternionBase< Derived > &  other)
489{
490 coeffs() = other.coeffs();
491 return derived();
492}

References Eigen::QuaternionBase< Derived >::coeffs().

+ Here is the call graph for this function:

◆ operator=() [5/5]

template<class Derived >
template<class OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::QuaternionBase< Derived >::operator= ( const QuaternionBase< OtherDerived > &  other)
497{
498 coeffs() = other.coeffs();
499 return derived();
500}

References Eigen::QuaternionBase< Derived >::coeffs().

+ Here is the call graph for this function:

◆ setFromTwoVectors()

template<class Derived >
template<typename Derived1 , typename Derived2 >
EIGEN_DEVICE_FUNC Derived & Eigen::QuaternionBase< Derived >::setFromTwoVectors ( const MatrixBase< Derived1 > &  a,
const MatrixBase< Derived2 > &  b 
)
inline
Returns
the quaternion which transform a into b through a rotation

Sets *this to be a quaternion representing a rotation between the two arbitrary vectors a and b. In other words, the built rotation represent a rotation sending the line of direction a to the line of direction b, both lines passing through the origin.

Returns
a reference to *this.

Note that the two input vectors do not have to be normalized, and do not need to have the same norm.

583{
584 EIGEN_USING_STD_MATH(sqrt)
585 Vector3 v0 = a.normalized();
586 Vector3 v1 = b.normalized();
587 Scalar c = v1.dot(v0);
588
589 // if dot == -1, vectors are nearly opposites
590 // => accurately compute the rotation axis by computing the
591 // intersection of the two planes. This is done by solving:
592 // x^T v0 = 0
593 // x^T v1 = 0
594 // under the constraint:
595 // ||x|| = 1
596 // which yields a singular value problem
597 if (c < Scalar(-1)+NumTraits<Scalar>::dummy_precision())
598 {
599 c = numext::maxi(c,Scalar(-1));
600 Matrix<Scalar,2,3> m; m << v0.transpose(), v1.transpose();
601 JacobiSVD<Matrix<Scalar,2,3> > svd(m, ComputeFullV);
602 Vector3 axis = svd.matrixV().col(2);
603
604 Scalar w2 = (Scalar(1)+c)*Scalar(0.5);
605 this->w() = sqrt(w2);
606 this->vec() = axis * sqrt(Scalar(1) - w2);
607 return derived();
608 }
609 Vector3 axis = v0.cross(v1);
610 Scalar s = sqrt((Scalar(1)+c)*Scalar(2));
611 Scalar invs = Scalar(1)/s;
612 this->vec() = axis * invs;
613 this->w() = s * Scalar(0.5);
614
615 return derived();
616}

References Eigen::ComputeFullV, Eigen::SVDBase< Derived >::matrixV(), Eigen::numext::maxi(), and sqrt().

Referenced by igl::opengl2::RotateWidget::draw(), igl::opengl2::draw_skeleton_3d(), Slic3r::Measure::MeasuringImpl::extract_features(), Eigen::Quaternion< _Scalar, _Options >::FromTwoVectors(), Slic3r::GUI::GLGizmoCut3D::process_cut_line(), Slic3r::GUI::MeshClipper::recalculate_triangles(), Slic3r::GUI::GLGizmoHollow::render_points(), Slic3r::GUI::GLGizmoSlaSupports::render_points(), igl::opengl2::MouseController::set_selection(), Slic3r::sla::DrainHole::to_mesh(), Slic3r::GUI::GLGizmoHollow::update_hole_raycasters_for_picking_transform(), Slic3r::GUI::GLGizmoFlatten::update_planes(), and Slic3r::GUI::GLGizmoSlaSupports::update_point_raycasters_for_picking_transform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setIdentity()

template<class Derived >
EIGEN_DEVICE_FUNC QuaternionBase & Eigen::QuaternionBase< Derived >::setIdentity ( )
inline
See also
QuaternionBase::Identity(), MatrixBase::setIdentity()
115{ coeffs() << Scalar(0), Scalar(0), Scalar(0), Scalar(1); return *this; }

References Eigen::QuaternionBase< Derived >::coeffs().

+ Here is the call graph for this function:

◆ slerp() [1/2]

template<class Derived >
template<class OtherDerived >
EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Derived >::slerp ( const Scalar t,
const QuaternionBase< OtherDerived > &  other 
) const

◆ slerp() [2/2]

template<class Derived >
template<class OtherDerived >
EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Derived >::Scalar > Eigen::QuaternionBase< Derived >::slerp ( const Scalar t,
const QuaternionBase< OtherDerived > &  other 
) const
Returns
the spherical linear interpolation between the two quaternions *this and other at the parameter t in [0;1].

This represents an interpolation for a constant motion between *this and other, see also http://en.wikipedia.org/wiki/Slerp.

727{
728 EIGEN_USING_STD_MATH(acos)
729 EIGEN_USING_STD_MATH(sin)
730 const Scalar one = Scalar(1) - NumTraits<Scalar>::epsilon();
731 Scalar d = this->dot(other);
732 Scalar absD = numext::abs(d);
733
734 Scalar scale0;
735 Scalar scale1;
736
737 if(absD>=one)
738 {
739 scale0 = Scalar(1) - t;
740 scale1 = t;
741 }
742 else
743 {
744 // theta is the angle between the 2 quaternions
745 Scalar theta = acos(absD);
746 Scalar sinTheta = sin(theta);
747
748 scale0 = sin( ( Scalar(1) - t ) * theta) / sinTheta;
749 scale1 = sin( ( t * theta) ) / sinTheta;
750 }
751 if(d<Scalar(0)) scale1 = -scale1;
752
753 return Quaternion<Scalar>(scale0 * coeffs() + scale1 * other.coeffs());
754}

References Eigen::numext::abs(), acos(), Eigen::QuaternionBase< Derived >::coeffs(), and sin().

+ Here is the call graph for this function:

◆ squaredNorm()

template<class Derived >
EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Derived >::squaredNorm ( ) const
inline
Returns
the squared norm of the quaternion's coefficients
See also
QuaternionBase::norm(), MatrixBase::squaredNorm()
120{ return coeffs().squaredNorm(); }

References Eigen::QuaternionBase< Derived >::coeffs().

+ Here is the call graph for this function:

◆ toRotationMatrix()

template<class Derived >
EIGEN_DEVICE_FUNC QuaternionBase< Derived >::Matrix3 Eigen::QuaternionBase< Derived >::toRotationMatrix ( void  ) const
inline
Returns
an equivalent 3x3 rotation matrix

Convert the quaternion to a 3x3 rotation matrix. The quaternion is required to be normalized, otherwise the result is undefined.

537{
538 // NOTE if inlined, then gcc 4.2 and 4.4 get rid of the temporary (not gcc 4.3 !!)
539 // if not inlined then the cost of the return by value is huge ~ +35%,
540 // however, not inlining this function is an order of magnitude slower, so
541 // it has to be inlined, and so the return by value is not an issue
542 Matrix3 res;
543
544 const Scalar tx = Scalar(2)*this->x();
545 const Scalar ty = Scalar(2)*this->y();
546 const Scalar tz = Scalar(2)*this->z();
547 const Scalar twx = tx*this->w();
548 const Scalar twy = ty*this->w();
549 const Scalar twz = tz*this->w();
550 const Scalar txx = tx*this->x();
551 const Scalar txy = ty*this->x();
552 const Scalar txz = tz*this->x();
553 const Scalar tyy = ty*this->y();
554 const Scalar tyz = tz*this->y();
555 const Scalar tzz = tz*this->z();
556
557 res.coeffRef(0,0) = Scalar(1)-(tyy+tzz);
558 res.coeffRef(0,1) = txy-twz;
559 res.coeffRef(0,2) = txz+twy;
560 res.coeffRef(1,0) = txy+twz;
561 res.coeffRef(1,1) = Scalar(1)-(txx+tzz);
562 res.coeffRef(1,2) = tyz-twx;
563 res.coeffRef(2,0) = txz-twy;
564 res.coeffRef(2,1) = tyz+twx;
565 res.coeffRef(2,2) = Scalar(1)-(txx+tyy);
566
567 return res;
568}

References Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::coeffRef().

Referenced by Slic3r::FillAdaptive::build_octree(), and Slic3r::PrintObject::prepare_adaptive_infill_data().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vec() [1/2]

template<class Derived >
EIGEN_DEVICE_FUNC VectorBlock< Coefficients, 3 > Eigen::QuaternionBase< Derived >::vec ( )
inline
Returns
a vector expression of the imaginary part (x,y,z)
87{ return coeffs().template head<3>(); }

References Eigen::QuaternionBase< Derived >::coeffs().

+ Here is the call graph for this function:

◆ vec() [2/2]

template<class Derived >
EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > Eigen::QuaternionBase< Derived >::vec ( ) const
inline
Returns
a read-only vector expression of the imaginary part (x,y,z)
84{ return coeffs().template head<3>(); }

References Eigen::QuaternionBase< Derived >::coeffs().

Referenced by Eigen::AngleAxis< _Scalar >::operator=().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ w() [1/2]

template<class Derived >
EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Derived >::w ( )
inline
Returns
a reference to the w coefficient (if Derived is a non-const lvalue)
81{ return this->derived().coeffs().w(); }

References Eigen::RotationBase< Derived, 3 >::derived().

+ Here is the call graph for this function:

◆ w() [2/2]

template<class Derived >
EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Derived >::w ( ) const
inline
Returns
the w coefficient
72{ return this->derived().coeffs().coeff(3); }

References Eigen::RotationBase< Derived, 3 >::derived().

Referenced by igl::serialization::deserialize(), Eigen::AngleAxis< _Scalar >::operator=(), Eigen::internal::quat_conj< Arch, Derived, Scalar >::run(), Eigen::internal::quaternionbase_assign_impl< Other, 3, 3 >::run(), igl::matlab::MatlabWorkspace::save(), and igl::serialization::serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ x() [1/2]

template<class Derived >
EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Derived >::x ( )
inline
Returns
a reference to the x coefficient (if Derived is a non-const lvalue)
75{ return this->derived().coeffs().x(); }

References Eigen::RotationBase< Derived, 3 >::derived().

+ Here is the call graph for this function:

◆ x() [2/2]

template<class Derived >
EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Derived >::x ( ) const
inline
Returns
the x coefficient
66{ return this->derived().coeffs().coeff(0); }

References Eigen::RotationBase< Derived, 3 >::derived().

Referenced by igl::serialization::deserialize(), Eigen::internal::quat_product< Architecture::SSE, Derived, OtherDerived, float >::run(), Eigen::internal::quat_product< Architecture::SSE, Derived, OtherDerived, double >::run(), Eigen::internal::quat_conj< Architecture::SSE, Derived, float >::run(), Eigen::internal::quat_conj< Architecture::SSE, Derived, double >::run(), Eigen::internal::quat_conj< Arch, Derived, Scalar >::run(), Eigen::internal::quaternionbase_assign_impl< Other, 3, 3 >::run(), igl::matlab::MatlabWorkspace::save(), and igl::serialization::serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ y() [1/2]

template<class Derived >
EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Derived >::y ( )
inline
Returns
a reference to the y coefficient (if Derived is a non-const lvalue)
77{ return this->derived().coeffs().y(); }

References Eigen::RotationBase< Derived, 3 >::derived().

+ Here is the call graph for this function:

◆ y() [2/2]

template<class Derived >
EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Derived >::y ( ) const
inline
Returns
the y coefficient
68{ return this->derived().coeffs().coeff(1); }

References Eigen::RotationBase< Derived, 3 >::derived().

Referenced by igl::serialization::deserialize(), Eigen::internal::quat_conj< Arch, Derived, Scalar >::run(), Eigen::internal::quaternionbase_assign_impl< Other, 3, 3 >::run(), igl::matlab::MatlabWorkspace::save(), and igl::serialization::serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ z() [1/2]

template<class Derived >
EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Derived >::z ( )
inline
Returns
a reference to the z coefficient (if Derived is a non-const lvalue)
79{ return this->derived().coeffs().z(); }

References Eigen::RotationBase< Derived, 3 >::derived().

+ Here is the call graph for this function:

◆ z() [2/2]

template<class Derived >
EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Derived >::z ( ) const
inline
Returns
the z coefficient
70{ return this->derived().coeffs().coeff(2); }

References Eigen::RotationBase< Derived, 3 >::derived().

Referenced by igl::serialization::deserialize(), Eigen::internal::quat_product< Architecture::SSE, Derived, OtherDerived, double >::run(), Eigen::internal::quat_conj< Architecture::SSE, Derived, double >::run(), Eigen::internal::quat_conj< Arch, Derived, Scalar >::run(), Eigen::internal::quaternionbase_assign_impl< Other, 3, 3 >::run(), igl::matlab::MatlabWorkspace::save(), and igl::serialization::serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Eigen::Quaternion

class Eigen::Quaternion
template<typename _Scalar, int _Options>
class Eigen::Quaternion< _Scalar, _Options >

The quaternion class used to represent 3D orientations and rotations.

\geometry_module

Template Parameters
_Scalarthe scalar type, i.e., the type of the coefficients
_Optionscontrols the memory alignment of the coefficients. Can be # AutoAlign or # DontAlign. Default is AutoAlign.

This class represents a quaternion $ w+xi+yj+zk $ that is a convenient representation of orientations and rotations of objects in three dimensions. Compared to other representations like Euler angles or 3x3 matrices, quaternions offer the following advantages:

  • compact storage (4 scalars)
  • efficient to compose (28 flops),
  • stable spherical interpolation

The following two typedefs are provided for convenience:

  • Quaternionf for float
  • Quaterniond for double
Warning
Operations interpreting the quaternion as rotation have undefined behavior if the quaternion is not normalized.
See also
class AngleAxis, class Transform
+ Inheritance diagram for Eigen::Quaternion< _Scalar, _Options >:
+ Collaboration diagram for Eigen::Quaternion< _Scalar, _Options >:

Public Types

enum  
 
typedef QuaternionBase< Quaternion< _Scalar, _Options > > Base
 
typedef _Scalar Scalar
 
typedef internal::traits< Quaternion >::Coefficients Coefficients
 
typedef Base::AngleAxisType AngleAxisType
 
enum  
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef Coefficients::CoeffReturnType CoeffReturnType
 
typedef internal::conditional< bool(internal::traits< Quaternion< _Scalar, _Options > >::Flags &LvalueBit), Scalar &, CoeffReturnType >::type NonConstCoeffReturnType
 
typedef Matrix< Scalar, 3, 1 > Vector3
 
typedef Matrix< Scalar, 3, 3 > Matrix3
 
enum  { Dim = _Dim }
 
typedef Matrix< Scalar, Dim, DimRotationMatrixType
 
typedef Matrix< Scalar, Dim, 1 > VectorType
 

Public Member Functions

EIGEN_DEVICE_FUNC Quaternion ()
 
EIGEN_DEVICE_FUNC Quaternion (const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z)
 
EIGEN_DEVICE_FUNC Quaternion (const Scalar *data)
 
template<class Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion (const QuaternionBase< Derived > &other)
 
EIGEN_DEVICE_FUNC Quaternion (const AngleAxisType &aa)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Quaternion (const MatrixBase< Derived > &other)
 
template<typename OtherScalar , int OtherOptions>
EIGEN_DEVICE_FUNC Quaternion (const Quaternion< OtherScalar, OtherOptions > &other)
 
EIGEN_DEVICE_FUNC Coefficientscoeffs ()
 
EIGEN_DEVICE_FUNC const Coefficientscoeffs () const
 
template<typename Derived1 , typename Derived2 >
EIGEN_DEVICE_FUNC Quaternion< Scalar, Options > FromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
 
EIGEN_DEVICE_FUNC CoeffReturnType x () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType x ()
 
EIGEN_DEVICE_FUNC CoeffReturnType y () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType y ()
 
EIGEN_DEVICE_FUNC CoeffReturnType z () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType z ()
 
EIGEN_DEVICE_FUNC CoeffReturnType w () const
 
EIGEN_DEVICE_FUNC NonConstCoeffReturnType w ()
 
EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > vec () const
 
EIGEN_DEVICE_FUNC VectorBlock< Coefficients, 3 > vec ()
 
EIGEN_DEVICE_FUNC QuaternionBasesetIdentity ()
 
EIGEN_DEVICE_FUNC Scalar squaredNorm () const
 
EIGEN_DEVICE_FUNC Scalar norm () const
 
EIGEN_DEVICE_FUNC void normalize ()
 
EIGEN_DEVICE_FUNC Quaternion< Scalarnormalized () const
 
EIGEN_DEVICE_FUNC Scalar dot (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC internal::traits< Quaternion< _Scalar, _Options > >::Scalar angularDistance (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Matrix3 toRotationMatrix () const
 
EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > & setFromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< Scalaroperator* (const QuaternionBase< OtherDerived > &q) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::Scalaroperator* (const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometryoperator* (const Translation< Scalar, Dim > &t) const
 
EIGEN_DEVICE_FUNC RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator* (const EigenBase< OtherDerived > &e) const
 
template<int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< _Scalar, _Options > & operator*= (const QuaternionBase< OtherDerived > &q)
 
EIGEN_DEVICE_FUNC Quaternion< Scalarinverse () const
 
EIGEN_DEVICE_FUNC Quaternion< Scalarconjugate () const
 
EIGEN_DEVICE_FUNC Quaternion< Scalarslerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::Scalarslerp (const Scalar &t, const QuaternionBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC bool isApprox (const QuaternionBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Vector3 _transformVector (const Vector3 &v) const
 
template<typename OtherVectorType >
EIGEN_DEVICE_FUNC VectorType _transformVector (const OtherVectorType &v) const
 
EIGEN_DEVICE_FUNC internal::cast_return_type< Quaternion< _Scalar, _Options >, Quaternion< NewScalarType > >::type cast () const
 
EIGEN_DEVICE_FUNC const Derived & derived () const
 
EIGEN_DEVICE_FUNC Derived & derived ()
 
EIGEN_DEVICE_FUNC RotationMatrixType matrix () const
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC Quaternion UnitRandom ()
 
template<typename Derived1 , typename Derived2 >
static EIGEN_DEVICE_FUNC Quaternion FromTwoVectors (const MatrixBase< Derived1 > &a, const MatrixBase< Derived2 > &b)
 
static EIGEN_DEVICE_FUNC Quaternion< ScalarIdentity ()
 

Static Protected Member Functions

static EIGEN_STRONG_INLINE void _check_template_params ()
 

Protected Attributes

Coefficients m_coeffs
 

Member Typedef Documentation

◆ AngleAxisType

template<typename _Scalar , int _Options>
typedef Base::AngleAxisType Eigen::Quaternion< _Scalar, _Options >::AngleAxisType

◆ Base

template<typename _Scalar , int _Options>
typedef QuaternionBase<Quaternion<_Scalar,_Options> > Eigen::Quaternion< _Scalar, _Options >::Base

◆ Coefficients

template<typename _Scalar , int _Options>
typedef internal::traits<Quaternion>::Coefficients Eigen::Quaternion< _Scalar, _Options >::Coefficients

◆ CoeffReturnType

typedef Coefficients::CoeffReturnType Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::CoeffReturnType
inherited

◆ Matrix3

typedef Matrix<Scalar,3,3> Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::Matrix3
inherited

the equivalent rotation matrix type

◆ NonConstCoeffReturnType

typedef internal::conditional<bool(internal::traits<Quaternion< _Scalar, _Options > >::Flags&LvalueBit),Scalar&,CoeffReturnType>::type Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::NonConstCoeffReturnType
inherited

◆ RealScalar

typedef NumTraits<Scalar>::Real Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::RealScalar
inherited

◆ RotationMatrixType

template<typename Derived , int _Dim>
typedef Matrix<Scalar,Dim,Dim> Eigen::RotationBase< Derived, _Dim >::RotationMatrixType
inherited

corresponding linear transformation matrix type

◆ Scalar

template<typename _Scalar , int _Options>
typedef _Scalar Eigen::Quaternion< _Scalar, _Options >::Scalar

◆ Vector3

typedef Matrix<Scalar,3,1> Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::Vector3
inherited

the type of a 3D vector

◆ VectorType

template<typename Derived , int _Dim>
typedef Matrix<Scalar,Dim,1> Eigen::RotationBase< Derived, _Dim >::VectorType
inherited

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived , int _Dim>
anonymous enum
inherited
Enumerator
Dim 
32{ Dim = _Dim };

◆ anonymous enum

anonymous enum
inherited

◆ anonymous enum

template<typename _Scalar , int _Options>
anonymous enum
236{ NeedsAlignment = internal::traits<Quaternion>::Alignment>0 };

Constructor & Destructor Documentation

◆ Quaternion() [1/7]

template<typename _Scalar , int _Options>
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( )
inline

Default constructor leaving the quaternion uninitialized.

247{}

◆ Quaternion() [2/7]

template<typename _Scalar , int _Options>
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const Scalar w,
const Scalar x,
const Scalar y,
const Scalar z 
)
inline

Constructs and initializes the quaternion $ w+xi+yj+zk $ from its four coefficients w, x, y and z.

Warning
Note the order of the arguments: the real w coefficient first, while internally the coefficients are stored in the following order: [x, y, z, w]
256: m_coeffs(x, y, z, w){}
Coefficients m_coeffs
Definition Quaternion.h:294

◆ Quaternion() [3/7]

template<typename _Scalar , int _Options>
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const Scalar data)
inlineexplicit

Constructs and initialize a quaternion from the array data

259: m_coeffs(data) {}

◆ Quaternion() [4/7]

template<typename _Scalar , int _Options>
template<class Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const QuaternionBase< Derived > &  other)
inline

Copy constructor

262{ this->Base::operator=(other); }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE QuaternionBase< Quaternion< _Scalar, _Options > > & operator=(const QuaternionBase< Quaternion< _Scalar, _Options > > &other)
Definition Quaternion.h:488

References Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::operator=().

+ Here is the call graph for this function:

◆ Quaternion() [5/7]

template<typename _Scalar , int _Options>
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const AngleAxisType aa)
inlineexplicit

Constructs and initializes a quaternion from the angle-axis aa

265{ *this = aa; }

◆ Quaternion() [6/7]

template<typename _Scalar , int _Options>
template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const MatrixBase< Derived > &  other)
inlineexplicit

Constructs and initializes a quaternion from either:

  • a rotation matrix expression,
  • a 4D vector expression representing quaternion coefficients.
272{ *this = other; }

◆ Quaternion() [7/7]

template<typename _Scalar , int _Options>
template<typename OtherScalar , int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::Quaternion< _Scalar, _Options >::Quaternion ( const Quaternion< OtherScalar, OtherOptions > &  other)
inlineexplicit

Explicit copy constructor with scalar conversion

277 { m_coeffs = other.coeffs().template cast<Scalar>(); }

References Eigen::Quaternion< _Scalar, _Options >::coeffs(), and Eigen::Quaternion< _Scalar, _Options >::m_coeffs.

+ Here is the call graph for this function:

Member Function Documentation

◆ _check_template_params()

template<typename _Scalar , int _Options>
static EIGEN_STRONG_INLINE void Eigen::Quaternion< _Scalar, _Options >::_check_template_params ( )
inlinestaticprotected
298 {
299 EIGEN_STATIC_ASSERT( (_Options & DontAlign) == _Options,
300 INVALID_MATRIX_TEMPLATE_PARAMETERS)
301 }
@ DontAlign
Definition Constants.h:326

References Eigen::DontAlign, and EIGEN_STATIC_ASSERT.

◆ _transformVector() [1/2]

template<typename Derived , int _Dim>
template<typename OtherVectorType >
EIGEN_DEVICE_FUNC VectorType Eigen::RotationBase< Derived, _Dim >::_transformVector ( const OtherVectorType &  v) const
inlineinherited
94 { return toRotationMatrix() * v; }

References Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

◆ _transformVector() [2/2]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE QuaternionBase< Quaternion< _Scalar, _Options > >::Vector3 Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::_transformVector ( const Vector3 v) const
inherited

return the result vector of v through the rotation

Rotation of a vector by a quaternion.

Remarks
If the quaternion is used to rotate several points (>1) then it is much more efficient to first convert it to a 3x3 Matrix. Comparison of the operation cost for n transformations:
  • Quaternion2: 30n
  • Via a Matrix3: 24 + 15n
476{
477 // Note that this algorithm comes from the optimization by hand
478 // of the conversion to a Matrix followed by a Matrix/Vector product.
479 // It appears to be much faster than the common algorithm found
480 // in the literature (30 versus 39 flops). It also requires two
481 // Vector3 as temporaries.
482 Vector3 uv = this->vec().cross(v);
483 uv += uv;
484 return v + this->w() * uv + this->vec().cross(uv);
485}

◆ angularDistance() [1/2]

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::angularDistance ( const QuaternionBase< OtherDerived > &  other) const
inherited

◆ angularDistance() [2/2]

EIGEN_DEVICE_FUNC internal::traits< Quaternion< _Scalar, _Options > >::Scalar Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::angularDistance ( const QuaternionBase< OtherDerived > &  other) const
inlineinherited
Returns
the angle (in radian) between two rotations
See also
dot()
709{
710 EIGEN_USING_STD_MATH(atan2)
711 Quaternion<Scalar> d = (*this) * other.conjugate();
712 return Scalar(2) * atan2( d.vec().norm(), numext::abs(d.w()) );
713}

◆ cast()

EIGEN_DEVICE_FUNC internal::cast_return_type< Quaternion< _Scalar, _Options > , Quaternion< NewScalarType > >::type Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::cast ( ) const
inlineinherited
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

179 {
180 return typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type(derived());
181 }

◆ coeffs() [1/2]

template<typename _Scalar , int _Options>
EIGEN_DEVICE_FUNC Coefficients & Eigen::Quaternion< _Scalar, _Options >::coeffs ( )
inline
284{ return m_coeffs;}

References Eigen::Quaternion< _Scalar, _Options >::m_coeffs.

Referenced by Eigen::Quaternion< _Scalar, _Options >::Quaternion(), igl::opengl2::RotateWidget::drag(), igl::opengl2::MouseController::set_selection(), igl::snap_to_canonical_view_quat(), and igl::trackball().

+ Here is the caller graph for this function:

◆ coeffs() [2/2]

template<typename _Scalar , int _Options>
EIGEN_DEVICE_FUNC const Coefficients & Eigen::Quaternion< _Scalar, _Options >::coeffs ( ) const
inline

◆ conjugate()

EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::Scalar > Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::conjugate
inlineinherited
Returns
the conjugated quaternion
the conjugate of the *this which is equal to the multiplicative inverse if the quaternion is normalized. The conjugate of a quaternion represents the opposite rotation.
See also
Quaternion2::inverse()
696{
697 return internal::quat_conj<Architecture::Target, Derived,
698 typename internal::traits<Derived>::Scalar>::run(*this);
699
700}

◆ derived() [1/2]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC Derived & Eigen::RotationBase< Derived, _Dim >::derived ( )
inlineinherited
42{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC const Derived & Eigen::RotationBase< Derived, _Dim >::derived ( ) const
inlineinherited
41{ return *static_cast<const Derived*>(this); }

Referenced by Eigen::RotationBase< Derived, _Dim >::inverse(), Eigen::RotationBase< Derived, _Dim >::matrix(), Eigen::RotationBase< Derived, _Dim >::operator*(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*(), Eigen::QuaternionBase< Derived >::operator*=(), and Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the caller graph for this function:

◆ dot()

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::dot ( const QuaternionBase< OtherDerived > &  other) const
inlineinherited
Returns
the dot product of *this and other Geometrically speaking, the dot product of two unit quaternions corresponds to the cosine of half the angle between the two rotations.
See also
angularDistance()
139{ return coeffs().dot(other.coeffs()); }

◆ FromTwoVectors() [1/2]

template<typename _Scalar , int _Options>
template<typename Derived1 , typename Derived2 >
static EIGEN_DEVICE_FUNC Quaternion Eigen::Quaternion< _Scalar, _Options >::FromTwoVectors ( const MatrixBase< Derived1 > &  a,
const MatrixBase< Derived2 > &  b 
)
static

◆ FromTwoVectors() [2/2]

template<typename _Scalar , int _Options>
template<typename Derived1 , typename Derived2 >
EIGEN_DEVICE_FUNC Quaternion< Scalar, Options > Eigen::Quaternion< _Scalar, _Options >::FromTwoVectors ( const MatrixBase< Derived1 > &  a,
const MatrixBase< Derived2 > &  b 
)

Returns a quaternion representing a rotation between the two arbitrary vectors a and b. In other words, the built rotation represent a rotation sending the line of direction a to the line of direction b, both lines passing through the origin.

Returns
resulting quaternion

Note that the two input vectors do not have to be normalized, and do not need to have the same norm.

650{
651 Quaternion quat;
652 quat.setFromTwoVectors(a, b);
653 return quat;
654}
EIGEN_DEVICE_FUNC Quaternion()
Definition Quaternion.h:247

References Eigen::QuaternionBase< Derived >::setFromTwoVectors().

+ Here is the call graph for this function:

◆ Identity()

static EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::Identity ( )
inlinestaticinherited
Returns
a quaternion representing an identity rotation
See also
MatrixBase::Identity()
111{ return Quaternion<Scalar>(Scalar(1), Scalar(0), Scalar(0), Scalar(0)); }

◆ inverse()

EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::Scalar > Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::inverse
inlineinherited
Returns
the quaternion describing the inverse rotation
the multiplicative inverse of *this Note that in most cases, i.e., if you simply want the opposite rotation, and/or the quaternion is normalized, then it is enough to use the conjugate.
See also
QuaternionBase::conjugate()
665{
666 // FIXME should this function be called multiplicativeInverse and conjugate() be called inverse() or opposite() ??
667 Scalar n2 = this->squaredNorm();
668 if (n2 > Scalar(0))
669 return Quaternion<Scalar>(conjugate().coeffs() / n2);
670 else
671 {
672 // return an invalid result to flag the error
673 return Quaternion<Scalar>(Coefficients::Zero());
674 }
675}

◆ isApprox()

EIGEN_DEVICE_FUNC bool Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::isApprox ( const QuaternionBase< OtherDerived > &  other,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
inlineinherited
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()
167 { return coeffs().isApprox(other.coeffs(), prec); }

◆ matrix()

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< Derived, _Dim >::matrix ( ) const
inlineinherited
Returns
an equivalent rotation matrix This function is added to be conform with the Transform class' naming scheme.
50{ return derived().toRotationMatrix(); }

References Eigen::RotationBase< Derived, _Dim >::derived().

Referenced by Slic3r::Emboss::create_transformation_onto_surface(), and igl::snap_to_fixed_up().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ norm()

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::norm ( ) const
inlineinherited
Returns
the norm of the quaternion's coefficients
See also
QuaternionBase::squaredNorm(), MatrixBase::norm()
125{ return coeffs().norm(); }

◆ normalize()

EIGEN_DEVICE_FUNC void Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::normalize ( )
inlineinherited

Normalizes the quaternion *this

See also
normalized(), MatrixBase::normalize()
129{ coeffs().normalize(); }

◆ normalized()

EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::normalized ( ) const
inlineinherited
Returns
a normalized copy of *this
See also
normalize(), MatrixBase::normalized()
132{ return Quaternion<Scalar>(coeffs().normalized()); }

◆ operator*() [1/6]

template<typename Derived , int _Dim>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType Eigen::RotationBase< Derived, _Dim >::operator* ( const EigenBase< OtherDerived > &  e) const
inlineinherited
Returns
the concatenation of the rotation *this with a generic expression e e can be:
  • a DimxDim linear transformation matrix
  • a DimxDim diagonal matrix (axis aligned scaling)
  • a vector of size Dim
72 { return internal::rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); }

References Eigen::EigenBase< Derived >::derived(), and Eigen::RotationBase< Derived, _Dim >::derived().

+ Here is the call graph for this function:

◆ operator*() [2/6]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::Scalar > Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::operator* ( const QuaternionBase< OtherDerived > &  other) const
inherited
Returns
the concatenation of two rotations as a quaternion-quaternion product
450{
451 EIGEN_STATIC_ASSERT((internal::is_same<typename Derived::Scalar, typename OtherDerived::Scalar>::value),
452 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
453 return internal::quat_product<Architecture::Target, Derived, OtherDerived,
454 typename internal::traits<Derived>::Scalar>::run(*this, other);
455}

◆ operator*() [3/6]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< Scalar > Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::operator* ( const QuaternionBase< OtherDerived > &  q) const
inherited

◆ operator*() [4/6]

template<typename Derived , int _Dim>
template<int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > Eigen::RotationBase< Derived, _Dim >::operator* ( const Transform< Scalar, Dim, Mode, Options > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a transformation t
90 { return toRotationMatrix() * t; }

References Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

◆ operator*() [5/6]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometry > Eigen::RotationBase< Derived, _Dim >::operator* ( const Translation< Scalar, Dim > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a translation t
57 { return Transform<Scalar,Dim,Isometry>(*this) * t; }

◆ operator*() [6/6]

template<typename Derived , int _Dim>
EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< Derived, _Dim >::operator* ( const UniformScaling< Scalar > &  s) const
inlineinherited
Returns
the concatenation of the rotation *this with a uniform scaling s
61 { return toRotationMatrix() * s.factor(); }

References Eigen::UniformScaling< _Scalar >::factor(), and Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

◆ operator*=()

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion< _Scalar, _Options > & Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::operator*= ( const QuaternionBase< OtherDerived > &  other)
inherited
See also
operator*(Quaternion)
461{
462 derived() = derived() * other.derived();
463 return derived();
464}

◆ setFromTwoVectors()

EIGEN_DEVICE_FUNC Quaternion< _Scalar, _Options > & Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::setFromTwoVectors ( const MatrixBase< Derived1 > &  a,
const MatrixBase< Derived2 > &  b 
)
inlineinherited
Returns
the quaternion which transform a into b through a rotation

Sets *this to be a quaternion representing a rotation between the two arbitrary vectors a and b. In other words, the built rotation represent a rotation sending the line of direction a to the line of direction b, both lines passing through the origin.

Returns
a reference to *this.

Note that the two input vectors do not have to be normalized, and do not need to have the same norm.

583{
584 EIGEN_USING_STD_MATH(sqrt)
585 Vector3 v0 = a.normalized();
586 Vector3 v1 = b.normalized();
587 Scalar c = v1.dot(v0);
588
589 // if dot == -1, vectors are nearly opposites
590 // => accurately compute the rotation axis by computing the
591 // intersection of the two planes. This is done by solving:
592 // x^T v0 = 0
593 // x^T v1 = 0
594 // under the constraint:
595 // ||x|| = 1
596 // which yields a singular value problem
597 if (c < Scalar(-1)+NumTraits<Scalar>::dummy_precision())
598 {
599 c = numext::maxi(c,Scalar(-1));
600 Matrix<Scalar,2,3> m; m << v0.transpose(), v1.transpose();
601 JacobiSVD<Matrix<Scalar,2,3> > svd(m, ComputeFullV);
602 Vector3 axis = svd.matrixV().col(2);
603
604 Scalar w2 = (Scalar(1)+c)*Scalar(0.5);
605 this->w() = sqrt(w2);
606 this->vec() = axis * sqrt(Scalar(1) - w2);
607 return derived();
608 }
609 Vector3 axis = v0.cross(v1);
610 Scalar s = sqrt((Scalar(1)+c)*Scalar(2));
611 Scalar invs = Scalar(1)/s;
612 this->vec() = axis * invs;
613 this->w() = s * Scalar(0.5);
614
615 return derived();
616}

◆ setIdentity()

EIGEN_DEVICE_FUNC QuaternionBase & Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::setIdentity ( )
inlineinherited
See also
QuaternionBase::Identity(), MatrixBase::setIdentity()
115{ coeffs() << Scalar(0), Scalar(0), Scalar(0), Scalar(1); return *this; }

◆ slerp() [1/2]

EIGEN_DEVICE_FUNC Quaternion< Scalar > Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::slerp ( const Scalar t,
const QuaternionBase< OtherDerived > &  other 
) const
inherited

◆ slerp() [2/2]

EIGEN_DEVICE_FUNC Quaternion< typename internal::traits< Quaternion< _Scalar, _Options > >::Scalar > Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::slerp ( const Scalar t,
const QuaternionBase< OtherDerived > &  other 
) const
inherited
Returns
the spherical linear interpolation between the two quaternions *this and other at the parameter t in [0;1].

This represents an interpolation for a constant motion between *this and other, see also http://en.wikipedia.org/wiki/Slerp.

727{
728 EIGEN_USING_STD_MATH(acos)
729 EIGEN_USING_STD_MATH(sin)
730 const Scalar one = Scalar(1) - NumTraits<Scalar>::epsilon();
731 Scalar d = this->dot(other);
732 Scalar absD = numext::abs(d);
733
734 Scalar scale0;
735 Scalar scale1;
736
737 if(absD>=one)
738 {
739 scale0 = Scalar(1) - t;
740 scale1 = t;
741 }
742 else
743 {
744 // theta is the angle between the 2 quaternions
745 Scalar theta = acos(absD);
746 Scalar sinTheta = sin(theta);
747
748 scale0 = sin( ( Scalar(1) - t ) * theta) / sinTheta;
749 scale1 = sin( ( t * theta) ) / sinTheta;
750 }
751 if(d<Scalar(0)) scale1 = -scale1;
752
753 return Quaternion<Scalar>(scale0 * coeffs() + scale1 * other.coeffs());
754}

◆ squaredNorm()

EIGEN_DEVICE_FUNC Scalar Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::squaredNorm ( ) const
inlineinherited
Returns
the squared norm of the quaternion's coefficients
See also
QuaternionBase::norm(), MatrixBase::squaredNorm()
120{ return coeffs().squaredNorm(); }

◆ toRotationMatrix()

EIGEN_DEVICE_FUNC QuaternionBase< Quaternion< _Scalar, _Options > >::Matrix3 Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::toRotationMatrix ( void  ) const
inlineinherited
Returns
an equivalent 3x3 rotation matrix

Convert the quaternion to a 3x3 rotation matrix. The quaternion is required to be normalized, otherwise the result is undefined.

537{
538 // NOTE if inlined, then gcc 4.2 and 4.4 get rid of the temporary (not gcc 4.3 !!)
539 // if not inlined then the cost of the return by value is huge ~ +35%,
540 // however, not inlining this function is an order of magnitude slower, so
541 // it has to be inlined, and so the return by value is not an issue
542 Matrix3 res;
543
544 const Scalar tx = Scalar(2)*this->x();
545 const Scalar ty = Scalar(2)*this->y();
546 const Scalar tz = Scalar(2)*this->z();
547 const Scalar twx = tx*this->w();
548 const Scalar twy = ty*this->w();
549 const Scalar twz = tz*this->w();
550 const Scalar txx = tx*this->x();
551 const Scalar txy = ty*this->x();
552 const Scalar txz = tz*this->x();
553 const Scalar tyy = ty*this->y();
554 const Scalar tyz = tz*this->y();
555 const Scalar tzz = tz*this->z();
556
557 res.coeffRef(0,0) = Scalar(1)-(tyy+tzz);
558 res.coeffRef(0,1) = txy-twz;
559 res.coeffRef(0,2) = txz+twy;
560 res.coeffRef(1,0) = txy+twz;
561 res.coeffRef(1,1) = Scalar(1)-(txx+tzz);
562 res.coeffRef(1,2) = tyz-twx;
563 res.coeffRef(2,0) = txz-twy;
564 res.coeffRef(2,1) = tyz+twx;
565 res.coeffRef(2,2) = Scalar(1)-(txx+tyy);
566
567 return res;
568}

◆ UnitRandom()

template<typename Scalar , int Options>
EIGEN_DEVICE_FUNC Quaternion< Scalar, Options > Eigen::Quaternion< Scalar, Options >::UnitRandom
static
Returns
a random unit quaternion following a uniform distribution law on SO(3)
Note
The implementation is based on http://planning.cs.uiuc.edu/node198.html
624{
625 EIGEN_USING_STD_MATH(sqrt)
626 EIGEN_USING_STD_MATH(sin)
627 EIGEN_USING_STD_MATH(cos)
628 const Scalar u1 = internal::random<Scalar>(0, 1),
629 u2 = internal::random<Scalar>(0, 2*EIGEN_PI),
630 u3 = internal::random<Scalar>(0, 2*EIGEN_PI);
631 const Scalar a = sqrt(1 - u1),
632 b = sqrt(u1);
633 return Quaternion (a * sin(u2), a * cos(u2), b * sin(u3), b * cos(u3));
634}
_Scalar Scalar
Definition Quaternion.h:238

References cos(), EIGEN_PI, sin(), and sqrt().

+ Here is the call graph for this function:

◆ vec() [1/2]

EIGEN_DEVICE_FUNC VectorBlock< Coefficients, 3 > Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::vec ( )
inlineinherited
Returns
a vector expression of the imaginary part (x,y,z)
87{ return coeffs().template head<3>(); }

◆ vec() [2/2]

EIGEN_DEVICE_FUNC const VectorBlock< const Coefficients, 3 > Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::vec ( ) const
inlineinherited
Returns
a read-only vector expression of the imaginary part (x,y,z)
84{ return coeffs().template head<3>(); }

◆ w() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::w ( )
inlineinherited
Returns
a reference to the w coefficient (if Derived is a non-const lvalue)
81{ return this->derived().coeffs().w(); }

◆ w() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::w ( ) const
inlineinherited
Returns
the w coefficient
72{ return this->derived().coeffs().coeff(3); }

◆ x() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::x ( )
inlineinherited
Returns
a reference to the x coefficient (if Derived is a non-const lvalue)
75{ return this->derived().coeffs().x(); }

◆ x() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::x ( ) const
inlineinherited
Returns
the x coefficient
66{ return this->derived().coeffs().coeff(0); }

◆ y() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::y ( )
inlineinherited
Returns
a reference to the y coefficient (if Derived is a non-const lvalue)
77{ return this->derived().coeffs().y(); }

◆ y() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::y ( ) const
inlineinherited
Returns
the y coefficient
68{ return this->derived().coeffs().coeff(1); }

◆ z() [1/2]

EIGEN_DEVICE_FUNC NonConstCoeffReturnType Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::z ( )
inlineinherited
Returns
a reference to the z coefficient (if Derived is a non-const lvalue)
79{ return this->derived().coeffs().z(); }

◆ z() [2/2]

EIGEN_DEVICE_FUNC CoeffReturnType Eigen::QuaternionBase< Quaternion< _Scalar, _Options > >::z ( ) const
inlineinherited
Returns
the z coefficient
70{ return this->derived().coeffs().coeff(2); }

Member Data Documentation

◆ m_coeffs

◆ Eigen::Rotation2D

class Eigen::Rotation2D
template<typename _Scalar>
class Eigen::Rotation2D< _Scalar >

Represents a rotation/orientation in a 2 dimensional space.

\geometry_module

Template Parameters
_Scalarthe scalar type, i.e., the type of the coefficients

This class is equivalent to a single scalar representing a counter clock wise rotation as a single angle in radian. It provides some additional features such as the automatic conversion from/to a 2x2 rotation matrix. Moreover this class aims to provide a similar interface to Quaternion in order to facilitate the writing of generic algorithms dealing with rotations.

See also
class Quaternion, class Transform
+ Inheritance diagram for Eigen::Rotation2D< _Scalar >:
+ Collaboration diagram for Eigen::Rotation2D< _Scalar >:

Public Types

enum  { Dim = 2 }
 
typedef _Scalar Scalar
 
typedef Matrix< Scalar, 2, 1 > Vector2
 
typedef Matrix< Scalar, 2, 2 > Matrix2
 
enum  
 
typedef Matrix< Scalar, Dim, DimRotationMatrixType
 
typedef Matrix< Scalar, Dim, 1 > VectorType
 

Public Member Functions

EIGEN_DEVICE_FUNC Rotation2D (const Scalar &a)
 
EIGEN_DEVICE_FUNC Rotation2D ()
 
template<typename Derived >
EIGEN_DEVICE_FUNC Rotation2D (const MatrixBase< Derived > &m)
 
EIGEN_DEVICE_FUNC Scalar angle () const
 
EIGEN_DEVICE_FUNC Scalarangle ()
 
EIGEN_DEVICE_FUNC Scalar smallestPositiveAngle () const
 
EIGEN_DEVICE_FUNC Scalar smallestAngle () const
 
EIGEN_DEVICE_FUNC Rotation2D inverse () const
 
EIGEN_DEVICE_FUNC Rotation2D operator* (const Rotation2D &other) const
 
EIGEN_DEVICE_FUNC Rotation2Doperator*= (const Rotation2D &other)
 
EIGEN_DEVICE_FUNC Vector2 operator* (const Vector2 &vec) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC Rotation2DfromRotationMatrix (const MatrixBase< Derived > &m)
 
EIGEN_DEVICE_FUNC Matrix2 toRotationMatrix () const
 
template<typename Derived >
EIGEN_DEVICE_FUNC Rotation2Doperator= (const MatrixBase< Derived > &m)
 
EIGEN_DEVICE_FUNC Rotation2D slerp (const Scalar &t, const Rotation2D &other) const
 
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Rotation2D, Rotation2D< NewScalarType > >::type cast () const
 
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Rotation2D (const Rotation2D< OtherScalarType > &other)
 
EIGEN_DEVICE_FUNC bool isApprox (const Rotation2D &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC Rotation2D< Scalar > & fromRotationMatrix (const MatrixBase< Derived > &mat)
 
EIGEN_DEVICE_FUNC const Rotation2D< _Scalar > & derived () const
 
EIGEN_DEVICE_FUNC Rotation2D< _Scalar > & derived ()
 
EIGEN_DEVICE_FUNC RotationMatrixType matrix () const
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometryoperator* (const Translation< Scalar, Dim > &t) const
 
EIGEN_DEVICE_FUNC RotationMatrixType operator* (const UniformScaling< Scalar > &s) const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Rotation2D< _Scalar >, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator* (const EigenBase< OtherDerived > &e) const
 
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
 
EIGEN_DEVICE_FUNC VectorType _transformVector (const OtherVectorType &v) const
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC Rotation2D Identity ()
 

Protected Attributes

Scalar m_angle
 

Private Types

typedef RotationBase< Rotation2D< _Scalar >, 2 > Base
 

Member Typedef Documentation

◆ Base

template<typename _Scalar >
typedef RotationBase<Rotation2D<_Scalar>,2> Eigen::Rotation2D< _Scalar >::Base
private

◆ Matrix2

template<typename _Scalar >
typedef Matrix<Scalar,2,2> Eigen::Rotation2D< _Scalar >::Matrix2

◆ RotationMatrixType

typedef Matrix<Scalar,Dim,Dim> Eigen::RotationBase< Rotation2D< _Scalar > , _Dim >::RotationMatrixType
inherited

corresponding linear transformation matrix type

◆ Scalar

template<typename _Scalar >
typedef _Scalar Eigen::Rotation2D< _Scalar >::Scalar

the scalar type of the coefficients

◆ Vector2

template<typename _Scalar >
typedef Matrix<Scalar,2,1> Eigen::Rotation2D< _Scalar >::Vector2

◆ VectorType

typedef Matrix<Scalar,Dim,1> Eigen::RotationBase< Rotation2D< _Scalar > , _Dim >::VectorType
inherited

Member Enumeration Documentation

◆ anonymous enum

template<typename _Scalar >
anonymous enum
Enumerator
Dim 
49{ Dim = 2 };
@ Dim
Definition Rotation2D.h:49

◆ anonymous enum

anonymous enum
inherited
32{ Dim = _Dim };

Constructor & Destructor Documentation

◆ Rotation2D() [1/4]

template<typename _Scalar >
EIGEN_DEVICE_FUNC Eigen::Rotation2D< _Scalar >::Rotation2D ( const Scalar a)
inlineexplicit

Construct a 2D counter clock wise rotation from the angle a in radian.

62: m_angle(a) {}
Scalar m_angle
Definition Rotation2D.h:57

◆ Rotation2D() [2/4]

template<typename _Scalar >
EIGEN_DEVICE_FUNC Eigen::Rotation2D< _Scalar >::Rotation2D ( )
inline

Default constructor wihtout initialization. The represented rotation is undefined.

65{}

Referenced by Eigen::Rotation2D< _Scalar >::Identity(), Eigen::Rotation2D< _Scalar >::inverse(), Eigen::Rotation2D< _Scalar >::operator*(), and Eigen::Rotation2D< _Scalar >::slerp().

+ Here is the caller graph for this function:

◆ Rotation2D() [3/4]

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::Rotation2D< _Scalar >::Rotation2D ( const MatrixBase< Derived > &  m)
inlineexplicit

Construct a 2D rotation from a 2x2 rotation matrix mat.

See also
fromRotationMatrix()
73 {
74 fromRotationMatrix(m.derived());
75 }
EIGEN_DEVICE_FUNC Rotation2D & fromRotationMatrix(const MatrixBase< Derived > &m)

References Eigen::Rotation2D< _Scalar >::fromRotationMatrix().

+ Here is the call graph for this function:

◆ Rotation2D() [4/4]

template<typename _Scalar >
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Eigen::Rotation2D< _Scalar >::Rotation2D ( const Rotation2D< OtherScalarType > &  other)
inlineexplicit

Copy constructor with scalar type conversion

148 {
149 m_angle = Scalar(other.angle());
150 }
_Scalar Scalar
Definition Rotation2D.h:51

References Eigen::Rotation2D< _Scalar >::angle(), and Eigen::Rotation2D< _Scalar >::m_angle.

+ Here is the call graph for this function:

Member Function Documentation

◆ _transformVector()

EIGEN_DEVICE_FUNC VectorType Eigen::RotationBase< Rotation2D< _Scalar > , _Dim >::_transformVector ( const OtherVectorType &  v) const
inlineinherited
94 { return toRotationMatrix() * v; }

◆ angle() [1/2]

template<typename _Scalar >
EIGEN_DEVICE_FUNC Scalar & Eigen::Rotation2D< _Scalar >::angle ( )
inline
Returns
a read-write reference to the rotation angle
81{ return m_angle; }

References Eigen::Rotation2D< _Scalar >::m_angle.

◆ angle() [2/2]

template<typename _Scalar >
EIGEN_DEVICE_FUNC Scalar Eigen::Rotation2D< _Scalar >::angle ( ) const
inline
Returns
the rotation angle
78{ return m_angle; }

References Eigen::Rotation2D< _Scalar >::m_angle.

Referenced by Eigen::Rotation2D< _Scalar >::Rotation2D().

+ Here is the caller graph for this function:

◆ cast()

template<typename _Scalar >
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Rotation2D, Rotation2D< NewScalarType > >::type Eigen::Rotation2D< _Scalar >::cast ( ) const
inline
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

143 { return typename internal::cast_return_type<Rotation2D,Rotation2D<NewScalarType> >::type(*this); }

◆ derived() [1/2]

EIGEN_DEVICE_FUNC Rotation2D< _Scalar > & Eigen::RotationBase< Rotation2D< _Scalar > , _Dim >::derived ( )
inlineinherited
42{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

EIGEN_DEVICE_FUNC const Rotation2D< _Scalar > & Eigen::RotationBase< Rotation2D< _Scalar > , _Dim >::derived ( ) const
inlineinherited
41{ return *static_cast<const Derived*>(this); }

◆ fromRotationMatrix() [1/2]

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC Rotation2D & Eigen::Rotation2D< _Scalar >::fromRotationMatrix ( const MatrixBase< Derived > &  m)

Referenced by Eigen::Rotation2D< _Scalar >::Rotation2D(), Eigen::Rotation2D< _Scalar >::operator=(), and igl::procrustes().

+ Here is the caller graph for this function:

◆ fromRotationMatrix() [2/2]

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC Rotation2D< Scalar > & Eigen::Rotation2D< _Scalar >::fromRotationMatrix ( const MatrixBase< Derived > &  mat)

Set *this from a 2x2 rotation matrix mat. In other words, this function extract the rotation angle from the rotation matrix.

177{
178 EIGEN_USING_STD_MATH(atan2)
179 EIGEN_STATIC_ASSERT(Derived::RowsAtCompileTime==2 && Derived::ColsAtCompileTime==2,YOU_MADE_A_PROGRAMMING_MISTAKE)
180 m_angle = atan2(mat.coeff(1,0), mat.coeff(0,0));
181 return *this;
182}

References EIGEN_STATIC_ASSERT.

◆ Identity()

template<typename _Scalar >
static EIGEN_DEVICE_FUNC Rotation2D Eigen::Rotation2D< _Scalar >::Identity ( )
inlinestatic
152{ return Rotation2D(0); }
EIGEN_DEVICE_FUNC Rotation2D()
Definition Rotation2D.h:65

References Eigen::Rotation2D< _Scalar >::Rotation2D().

+ Here is the call graph for this function:

◆ inverse()

template<typename _Scalar >
EIGEN_DEVICE_FUNC Rotation2D Eigen::Rotation2D< _Scalar >::inverse ( ) const
inline
Returns
the inverse rotation
98{ return Rotation2D(-m_angle); }

References Eigen::Rotation2D< _Scalar >::Rotation2D(), and Eigen::Rotation2D< _Scalar >::m_angle.

+ Here is the call graph for this function:

◆ isApprox()

template<typename _Scalar >
EIGEN_DEVICE_FUNC bool Eigen::Rotation2D< _Scalar >::isApprox ( const Rotation2D< _Scalar > &  other,
const typename NumTraits< Scalar >::Real &  prec = NumTraits<Scalar>::dummy_precision() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()
159 { return internal::isApprox(m_angle,other.m_angle, prec); }

References Eigen::internal::isApprox(), and Eigen::Rotation2D< _Scalar >::m_angle.

+ Here is the call graph for this function:

◆ matrix()

EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< Rotation2D< _Scalar > , _Dim >::matrix ( ) const
inlineinherited
Returns
an equivalent rotation matrix This function is added to be conform with the Transform class' naming scheme.
50{ return derived().toRotationMatrix(); }

◆ operator*() [1/6]

EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::rotation_base_generic_product_selector< Rotation2D< _Scalar > , OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType Eigen::RotationBase< Rotation2D< _Scalar > , _Dim >::operator* ( const EigenBase< OtherDerived > &  e) const
inlineinherited
Returns
the concatenation of the rotation *this with a generic expression e e can be:
  • a DimxDim linear transformation matrix
  • a DimxDim diagonal matrix (axis aligned scaling)
  • a vector of size Dim
72 { return internal::rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); }

◆ operator*() [2/6]

template<typename _Scalar >
EIGEN_DEVICE_FUNC Rotation2D Eigen::Rotation2D< _Scalar >::operator* ( const Rotation2D< _Scalar > &  other) const
inline

Concatenates two rotations

102 { return Rotation2D(m_angle + other.m_angle); }

References Eigen::Rotation2D< _Scalar >::Rotation2D(), and Eigen::Rotation2D< _Scalar >::m_angle.

+ Here is the call graph for this function:

◆ operator*() [3/6]

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > Eigen::RotationBase< Rotation2D< _Scalar > , _Dim >::operator* ( const Transform< Scalar, Dim, Mode, Options > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a transformation t
90 { return toRotationMatrix() * t; }

◆ operator*() [4/6]

EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Isometry > Eigen::RotationBase< Rotation2D< _Scalar > , _Dim >::operator* ( const Translation< Scalar, Dim > &  t) const
inlineinherited
Returns
the concatenation of the rotation *this with a translation t
57 { return Transform<Scalar,Dim,Isometry>(*this) * t; }

◆ operator*() [5/6]

EIGEN_DEVICE_FUNC RotationMatrixType Eigen::RotationBase< Rotation2D< _Scalar > , _Dim >::operator* ( const UniformScaling< Scalar > &  s) const
inlineinherited
Returns
the concatenation of the rotation *this with a uniform scaling s
61 { return toRotationMatrix() * s.factor(); }

◆ operator*() [6/6]

template<typename _Scalar >
EIGEN_DEVICE_FUNC Vector2 Eigen::Rotation2D< _Scalar >::operator* ( const Vector2 vec) const
inline

Applies the rotation to a 2D vector

110 { return toRotationMatrix() * vec; }
EIGEN_DEVICE_FUNC Matrix2 toRotationMatrix() const
Definition Rotation2D.h:188

References Eigen::Rotation2D< _Scalar >::toRotationMatrix().

+ Here is the call graph for this function:

◆ operator*=()

template<typename _Scalar >
EIGEN_DEVICE_FUNC Rotation2D & Eigen::Rotation2D< _Scalar >::operator*= ( const Rotation2D< _Scalar > &  other)
inline

Concatenates two rotations

106 { m_angle += other.m_angle; return *this; }

References Eigen::Rotation2D< _Scalar >::m_angle.

◆ operator=()

template<typename _Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC Rotation2D & Eigen::Rotation2D< _Scalar >::operator= ( const MatrixBase< Derived > &  m)
inline

Set *this from a 2x2 rotation matrix mat. In other words, this function extract the rotation angle from the rotation matrix.

This method is an alias for fromRotationMatrix()

See also
fromRotationMatrix()
125 { return fromRotationMatrix(m.derived()); }

References Eigen::Rotation2D< _Scalar >::fromRotationMatrix().

+ Here is the call graph for this function:

◆ slerp()

template<typename _Scalar >
EIGEN_DEVICE_FUNC Rotation2D Eigen::Rotation2D< _Scalar >::slerp ( const Scalar t,
const Rotation2D< _Scalar > &  other 
) const
inline
Returns
the spherical interpolation between *this and other using parameter t. It is in fact equivalent to a linear interpolation.
131 {
132 Scalar dist = Rotation2D(other.m_angle-m_angle).smallestAngle();
133 return Rotation2D(m_angle + dist*t);
134 }
T dist(const boost::polygon::point_data< T > &p1, const boost::polygon::point_data< T > &p2)
Definition Geometry.cpp:280

References Eigen::Rotation2D< _Scalar >::Rotation2D(), and Eigen::Rotation2D< _Scalar >::m_angle.

+ Here is the call graph for this function:

◆ smallestAngle()

template<typename _Scalar >
EIGEN_DEVICE_FUNC Scalar Eigen::Rotation2D< _Scalar >::smallestAngle ( ) const
inline
Returns
the rotation angle in [-pi,pi]
90 {
92 if(tmp>Scalar(EIGEN_PI)) tmp -= Scalar(2*EIGEN_PI);
93 else if(tmp<-Scalar(EIGEN_PI)) tmp += Scalar(2*EIGEN_PI);
94 return tmp;
95 }
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T fmod(const T &a, const T &b)
Definition MathFunctions.h:1242

References EIGEN_PI, Eigen::numext::fmod(), and Eigen::Rotation2D< _Scalar >::m_angle.

+ Here is the call graph for this function:

◆ smallestPositiveAngle()

template<typename _Scalar >
EIGEN_DEVICE_FUNC Scalar Eigen::Rotation2D< _Scalar >::smallestPositiveAngle ( ) const
inline
Returns
the rotation angle in [0,2pi]
84 {
86 return tmp<Scalar(0) ? tmp + Scalar(2*EIGEN_PI) : tmp;
87 }

References EIGEN_PI, Eigen::numext::fmod(), and Eigen::Rotation2D< _Scalar >::m_angle.

+ Here is the call graph for this function:

◆ toRotationMatrix()

template<typename Scalar >
Rotation2D< Scalar >::Matrix2 EIGEN_DEVICE_FUNC Eigen::Rotation2D< Scalar >::toRotationMatrix ( void  ) const

Constructs and

Returns
an equivalent 2x2 rotation matrix.
189{
190 EIGEN_USING_STD_MATH(sin)
191 EIGEN_USING_STD_MATH(cos)
192 Scalar sinA = sin(m_angle);
193 Scalar cosA = cos(m_angle);
194 return (Matrix2() << cosA, -sinA, sinA, cosA).finished();
195}
Matrix< Scalar, 2, 2 > Matrix2
Definition Rotation2D.h:53

References cos(), and sin().

Referenced by Eigen::Rotation2D< _Scalar >::operator*(), and Eigen::internal::toRotationMatrix().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_angle

◆ Scaling

class Scaling

Represents a generic uniform scaling transformation.

\geometry_module

Template Parameters
_Scalarthe scalar type, i.e., the type of the coefficients.

This class represent a uniform scaling transformation. It is the return type of Scaling(Scalar), and most of the time this is the only way it is used. In particular, this class is not aimed to be used to store a scaling transformation, but rather to make easier the constructions and updates of Transform objects.

To represent an axis aligned scaling, use the DiagonalMatrix class.

See also
Scaling(), class DiagonalMatrix, MatrixBase::asDiagonal(), class Translation, class Transform

◆ Eigen::Transform

class Eigen::Transform
template<typename _Scalar, int _Dim, int _Mode, int _Options>
class Eigen::Transform< _Scalar, _Dim, _Mode, _Options >

Represents an homogeneous transformation in a N dimensional space.

\geometry_module

Template Parameters
_Scalarthe scalar type, i.e., the type of the coefficients
_Dimthe dimension of the space
_Modethe type of the transformation. Can be:
  • Affine: the transformation is stored as a (Dim+1)^2 matrix, where the last row is assumed to be [0 ... 0 1].
  • AffineCompact: the transformation is stored as a (Dim)x(Dim+1) matrix.
  • Projective: the transformation is stored as a (Dim+1)^2 matrix without any assumption.
_Optionshas the same meaning as in class Matrix. It allows to specify DontAlign and/or RowMajor. These Options are passed directly to the underlying matrix type.

The homography is internally represented and stored by a matrix which is available through the matrix() method. To understand the behavior of this class you have to think a Transform object as its internal matrix representation. The chosen convention is right multiply:

v' = T * v

Therefore, an affine transformation matrix M is shaped like this:

$ \left( \begin{array}{cc}
 linear & translation\\
 0 ... 0 & 1
 \end{array} \right) $

Note that for a projective transformation the last row can be anything, and then the interpretation of different parts might be sightly different.

However, unlike a plain matrix, the Transform class provides many features simplifying both its assembly and usage. In particular, it can be composed with any other transformations (Transform,Translation,RotationBase,DiagonalMatrix) and can be directly used to transform implicit homogeneous vectors. All these operations are handled via the operator*. For the composition of transformations, its principle consists to first convert the right/left hand sides of the product to a compatible (Dim+1)^2 matrix and then perform a pure matrix product. Of course, internally, operator* tries to perform the minimal number of operations according to the nature of each terms. Likewise, when applying the transform to points, the latters are automatically promoted to homogeneous vectors before doing the matrix product. The conventions to homogeneous representations are performed as follow:

Translation t (Dim)x(1): $ \left( \begin{array}{cc}
 I & t \\
 0\,...\,0 & 1
 \end{array} \right) $

Rotation R (Dim)x(Dim): $ \left( \begin{array}{cc}
 R & 0\\
 0\,...\,0 & 1
 \end{array} \right) $

Scaling DiagonalMatrix S (Dim)x(Dim): $ \left( \begin{array}{cc}
 S & 0\\
 0\,...\,0 & 1
 \end{array} \right) $

Column point v (Dim)x(1): $ \left( \begin{array}{c}
 v\\
 1
 \end{array} \right) $

Set of column points V1...Vn (Dim)x(n): $ \left( \begin{array}{ccc}
 v_1 & ... & v_n\\
 1 & ... & 1
 \end{array} \right) $

The concatenation of a Transform object with any kind of other transformation always returns a Transform object.

A little exception to the "as pure matrix product" rule is the case of the transformation of non homogeneous vectors by an affine transformation. In that case the last matrix row can be ignored, and the product returns non homogeneous vectors.

Since, for instance, a Dim x Dim matrix is interpreted as a linear transformation, it is not possible to directly transform Dim vectors stored in a Dim x Dim matrix. The solution is either to use a Dim x Dynamic matrix or explicitly request a vector transformation by making the vector homogeneous:

m' = T * m.colwise().homogeneous();

Note that there is zero overhead.

Conversion methods from/to Qt's QMatrix and QTransform are available if the preprocessor token EIGEN_QT_SUPPORT is defined.

This class can be extended with the help of the plugin mechanism described on the page TopicCustomizing_Plugins by defining the preprocessor symbol EIGEN_TRANSFORM_PLUGIN.

See also
class Matrix, class Quaternion
+ Inheritance diagram for Eigen::Transform< _Scalar, _Dim, _Mode, _Options >:
+ Collaboration diagram for Eigen::Transform< _Scalar, _Dim, _Mode, _Options >:

Public Types

enum  { TransformTimeDiagonalMode = ((Mode==int(Isometry))?Affine:int(Mode)) }
 
typedef _Scalar Scalar
 
typedef Eigen::Index StorageIndex
 
typedef Eigen::Index Index
 
typedef internal::make_proper_matrix_type< Scalar, Rows, HDim, Options >::type MatrixType
 
typedef const MatrixType ConstMatrixType
 
typedef Matrix< Scalar, Dim, Dim, Options > LinearMatrixType
 
typedef Block< MatrixType, Dim, Dim, int(Mode)==(AffineCompact) &&(Options &RowMajor)==0 > LinearPart
 
typedef const Block< ConstMatrixType, Dim, Dim, int(Mode)==(AffineCompact) &&(Options &RowMajor)==0 > ConstLinearPart
 
typedef internal::conditional< int(Mode)==int(AffineCompact), MatrixType &, Block< MatrixType, Dim, HDim > >::type AffinePart
 
typedef internal::conditional< int(Mode)==int(AffineCompact), constMatrixType &, constBlock< constMatrixType, Dim, HDim > >::type ConstAffinePart
 
typedef Matrix< Scalar, Dim, 1 > VectorType
 
typedef Block< MatrixType, Dim, 1,!(internal::traits< MatrixType >::Flags &RowMajorBit)> TranslationPart
 
typedef const Block< ConstMatrixType, Dim, 1,!(internal::traits< MatrixType >::Flags &RowMajorBit)> ConstTranslationPart
 
typedef Translation< Scalar, Dim > TranslationType
 
typedef Transform< Scalar, Dim, TransformTimeDiagonalModeTransformTimeDiagonalReturnType
 
typedef internal::transform_take_affine_part< Transformtake_affine_part
 

Public Member Functions

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE (_Scalar, _Dim==Dynamic ? Dynamic :(_Dim+1) *(_Dim+1)) enum
 
EIGEN_DEVICE_FUNC Transform ()
 
EIGEN_DEVICE_FUNC Transform (const Transform &other)
 
EIGEN_DEVICE_FUNC Transform (const TranslationType &t)
 
EIGEN_DEVICE_FUNC Transform (const UniformScaling< Scalar > &s)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transform (const RotationBase< Derived, Dim > &r)
 
EIGEN_DEVICE_FUNC Transformoperator= (const Transform &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformoperator= (const EigenBase< OtherDerived > &other)
 
template<int OtherOptions>
EIGEN_DEVICE_FUNC Transform (const Transform< Scalar, Dim, Mode, OtherOptions > &other)
 
template<int OtherMode, int OtherOptions>
EIGEN_DEVICE_FUNC Transform (const Transform< Scalar, Dim, OtherMode, OtherOptions > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform (const ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformoperator= (const ReturnByValue< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC Index rows () const
 
EIGEN_DEVICE_FUNC Index cols () const
 
EIGEN_DEVICE_FUNC Scalar operator() (Index row, Index col) const
 
EIGEN_DEVICE_FUNC Scalaroperator() (Index row, Index col)
 
EIGEN_DEVICE_FUNC const MatrixTypematrix () const
 
EIGEN_DEVICE_FUNC MatrixTypematrix ()
 
EIGEN_DEVICE_FUNC ConstLinearPart linear () const
 
EIGEN_DEVICE_FUNC LinearPart linear ()
 
EIGEN_DEVICE_FUNC ConstAffinePart affine () const
 
EIGEN_DEVICE_FUNC AffinePart affine ()
 
EIGEN_DEVICE_FUNC ConstTranslationPart translation () const
 
EIGEN_DEVICE_FUNC TranslationPart translation ()
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::transform_right_product_impl< Transform, OtherDerived >::ResultType operator* (const EigenBase< OtherDerived > &other) const
 
template<typename DiagonalDerived >
EIGEN_DEVICE_FUNC const TransformTimeDiagonalReturnType operator* (const DiagonalBase< DiagonalDerived > &b) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformoperator*= (const EigenBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC const Transform operator* (const Transform &other) const
 
template<int OtherMode, int OtherOptions>
EIGEN_DEVICE_FUNC internal::transform_transform_product_impl< Transform, Transform< Scalar, Dim, OtherMode, OtherOptions > >::ResultType operator* (const Transform< Scalar, Dim, OtherMode, OtherOptions > &other) const
 
EIGEN_DEVICE_FUNC void setIdentity ()
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformscale (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformprescale (const MatrixBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC Transformscale (const Scalar &s)
 
EIGEN_DEVICE_FUNC Transformprescale (const Scalar &s)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformtranslate (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transformpretranslate (const MatrixBase< OtherDerived > &other)
 
template<typename RotationType >
EIGEN_DEVICE_FUNC Transformrotate (const RotationType &rotation)
 
template<typename RotationType >
EIGEN_DEVICE_FUNC Transformprerotate (const RotationType &rotation)
 
EIGEN_DEVICE_FUNC Transformshear (const Scalar &sx, const Scalar &sy)
 
EIGEN_DEVICE_FUNC Transformpreshear (const Scalar &sx, const Scalar &sy)
 
EIGEN_DEVICE_FUNC Transformoperator= (const TranslationType &t)
 
EIGEN_DEVICE_FUNC Transformoperator*= (const TranslationType &t)
 
EIGEN_DEVICE_FUNC Transform operator* (const TranslationType &t) const
 
EIGEN_DEVICE_FUNC Transformoperator= (const UniformScaling< Scalar > &t)
 
EIGEN_DEVICE_FUNC Transformoperator*= (const UniformScaling< Scalar > &s)
 
EIGEN_DEVICE_FUNC TransformTimeDiagonalReturnType operator* (const UniformScaling< Scalar > &s) const
 
EIGEN_DEVICE_FUNC Transformoperator*= (const DiagonalMatrix< Scalar, Dim > &s)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transformoperator= (const RotationBase< Derived, Dim > &r)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transformoperator*= (const RotationBase< Derived, Dim > &r)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transform operator* (const RotationBase< Derived, Dim > &r) const
 
EIGEN_DEVICE_FUNC const LinearMatrixType rotation () const
 
template<typename RotationMatrixType , typename ScalingMatrixType >
EIGEN_DEVICE_FUNC void computeRotationScaling (RotationMatrixType *rotation, ScalingMatrixType *scaling) const
 
template<typename ScalingMatrixType , typename RotationMatrixType >
EIGEN_DEVICE_FUNC void computeScalingRotation (ScalingMatrixType *scaling, RotationMatrixType *rotation) const
 
template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
EIGEN_DEVICE_FUNC TransformfromPositionOrientationScale (const MatrixBase< PositionDerived > &position, const OrientationType &orientation, const MatrixBase< ScaleDerived > &scale)
 
EIGEN_DEVICE_FUNC Transform inverse (TransformTraits traits=(TransformTraits) Mode) const
 
EIGEN_DEVICE_FUNC const Scalardata () const
 
EIGEN_DEVICE_FUNC Scalardata ()
 
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Transform, Transform< NewScalarType, Dim, Mode, Options > >::type cast () const
 
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Transform (const Transform< OtherScalarType, Dim, Mode, Options > &other)
 
EIGEN_DEVICE_FUNC bool isApprox (const Transform &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC void makeAffine ()
 
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, Dim > linearExt ()
 
EIGEN_DEVICE_FUNC const Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, Dim > linearExt () const
 
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, 1 > translationExt ()
 
EIGEN_DEVICE_FUNC const Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, 1 > translationExt () const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & scale (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & prescale (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & translate (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & pretranslate (const MatrixBase< OtherDerived > &other)
 
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & rotate (const RotationType &rotation)
 
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & prerotate (const RotationType &rotation)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & operator= (const RotationBase< Derived, Dim > &r)
 
template<typename Derived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > operator* (const RotationBase< Derived, Dim > &r) const
 
template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & fromPositionOrientationScale (const MatrixBase< PositionDerived > &position, const OrientationType &orientation, const MatrixBase< ScaleDerived > &scale)
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC const Transform Identity ()
 Returns an identity transformation.
 

Static Protected Member Functions

static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void check_template_params ()
 

Protected Attributes

MatrixType m_matrix
 

Friends

template<typename OtherDerived >
EIGEN_DEVICE_FUNC const internal::transform_left_product_impl< OtherDerived, Mode, Options, _Dim, _Dim+1 >::ResultType operator* (const EigenBase< OtherDerived > &a, const Transform &b)
 
template<typename DiagonalDerived >
EIGEN_DEVICE_FUNC friend TransformTimeDiagonalReturnType operator* (const DiagonalBase< DiagonalDerived > &a, const Transform &b)
 

Member Typedef Documentation

◆ AffinePart

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef internal::conditional<int(Mode)==int(AffineCompact),MatrixType&,Block<MatrixType,Dim,HDim>>::type Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::AffinePart

type of read/write reference to the affine part of the transformation

◆ ConstAffinePart

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef internal::conditional<int(Mode)==int(AffineCompact),constMatrixType&,constBlock<constMatrixType,Dim,HDim>>::type Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::ConstAffinePart

type of read reference to the affine part of the transformation

◆ ConstLinearPart

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef const Block<ConstMatrixType,Dim,Dim,int(Mode)==(AffineCompact) && (Options&RowMajor)==0> Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::ConstLinearPart

type of read reference to the linear part of the transformation

◆ ConstMatrixType

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef const MatrixType Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::ConstMatrixType

constified MatrixType

◆ ConstTranslationPart

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef const Block<ConstMatrixType,Dim,1,!(internal::traits<MatrixType>::Flags & RowMajorBit)> Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::ConstTranslationPart

type of a read reference to the translation part of the rotation

◆ Index

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef Eigen::Index Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Index

◆ LinearMatrixType

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef Matrix<Scalar,Dim,Dim,Options> Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::LinearMatrixType

type of the matrix used to represent the linear part of the transformation

◆ LinearPart

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef Block<MatrixType,Dim,Dim,int(Mode)==(AffineCompact) && (Options&RowMajor)==0> Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::LinearPart

type of read/write reference to the linear part of the transformation

◆ MatrixType

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef internal::make_proper_matrix_type<Scalar,Rows,HDim,Options>::type Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::MatrixType

type of the matrix used to represent the transformation

◆ Scalar

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef _Scalar Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Scalar

the scalar type of the coefficients

◆ StorageIndex

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef Eigen::Index Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::StorageIndex

◆ take_affine_part

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef internal::transform_take_affine_part<Transform> Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::take_affine_part

◆ TransformTimeDiagonalReturnType

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef Transform<Scalar,Dim,TransformTimeDiagonalMode> Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::TransformTimeDiagonalReturnType

The return type of the product between a diagonal matrix and a transform

◆ TranslationPart

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef Block<MatrixType,Dim,1,!(internal::traits<MatrixType>::Flags & RowMajorBit)> Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::TranslationPart

type of a read/write reference to the translation part of the rotation

◆ TranslationType

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef Translation<Scalar,Dim> Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::TranslationType

corresponding translation type

◆ VectorType

template<typename _Scalar , int _Dim, int _Mode, int _Options>
typedef Matrix<Scalar,Dim,1> Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::VectorType

type of a vector

Member Enumeration Documentation

◆ anonymous enum

template<typename _Scalar , int _Dim, int _Mode, int _Options>
anonymous enum
Enumerator
TransformTimeDiagonalMode 
@ TransformTimeDiagonalMode
Definition Transform.h:244
Mode
Definition CustomGCode.hpp:48

Constructor & Destructor Documentation

◆ Transform() [1/10]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform ( )
inline

Default constructor without initialization of the meaningful coefficients. If Mode==Affine, then the last row is set to [0 ... 0 1]

257 {
259 internal::transform_make_affine<(int(Mode)==Affine) ? Affine : AffineCompact>::run(m_matrix);
260 }
MatrixType m_matrix
Definition Transform.h:250
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void check_template_params()
Definition Transform.h:690
@ AffineCompact
Definition Constants.h:452

References Eigen::Affine, Eigen::AffineCompact, Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::check_template_params(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

Referenced by Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Identity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Transform() [2/10]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform ( const Transform< _Scalar, _Dim, _Mode, _Options > &  other)
inline
263 {
265 m_matrix = other.m_matrix;
266 }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::check_template_params(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

+ Here is the call graph for this function:

◆ Transform() [3/10]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform ( const TranslationType t)
inlineexplicit
269 {
271 *this = t;
272 }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::check_template_params().

+ Here is the call graph for this function:

◆ Transform() [4/10]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform ( const UniformScaling< Scalar > &  s)
inlineexplicit
274 {
276 *this = s;
277 }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::check_template_params().

+ Here is the call graph for this function:

◆ Transform() [5/10]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform ( const RotationBase< Derived, Dim > &  r)
inlineexplicit
280 {
282 *this = r;
283 }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::check_template_params().

+ Here is the call graph for this function:

◆ Transform() [6/10]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform ( const EigenBase< OtherDerived > &  other)
inlineexplicit

Constructs and initializes a transformation from a Dim^2 or a (Dim+1)^2 matrix.

293 {
295 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
296
298 internal::transform_construct_from_matrix<OtherDerived,Mode,Options,Dim,HDim>::run(this, other.derived());
299 }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::check_template_params(), Eigen::EigenBase< Derived >::derived(), and EIGEN_STATIC_ASSERT.

+ Here is the call graph for this function:

◆ Transform() [7/10]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform ( const Transform< Scalar, Dim, Mode, OtherOptions > &  other)
inline
314 {
316 // only the options change, we can directly copy the matrices
317 m_matrix = other.matrix();
318 }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::check_template_params(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix, and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::matrix().

+ Here is the call graph for this function:

◆ Transform() [8/10]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<int OtherMode, int OtherOptions>
EIGEN_DEVICE_FUNC Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform ( const Transform< Scalar, Dim, OtherMode, OtherOptions > &  other)
inline
322 {
324 // prevent conversions as:
325 // Affine | AffineCompact | Isometry = Projective
326 EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(OtherMode==int(Projective), Mode==int(Projective)),
327 YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION)
328
329 // prevent conversions as:
330 // Isometry = Affine | AffineCompact
331 EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(OtherMode==int(Affine)||OtherMode==int(AffineCompact), Mode!=int(Isometry)),
332 YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION)
333
334 enum { ModeIsAffineCompact = Mode == int(AffineCompact),
335 OtherModeIsAffineCompact = OtherMode == int(AffineCompact)
336 };
337
338 if(ModeIsAffineCompact == OtherModeIsAffineCompact)
339 {
340 // We need the block expression because the code is compiled for all
341 // combinations of transformations and will trigger a compile time error
342 // if one tries to assign the matrices directly
343 m_matrix.template block<Dim,Dim+1>(0,0) = other.matrix().template block<Dim,Dim+1>(0,0);
344 makeAffine();
345 }
346 else if(OtherModeIsAffineCompact)
347 {
348 typedef typename Transform<Scalar,Dim,OtherMode,OtherOptions>::MatrixType OtherMatrixType;
349 internal::transform_construct_from_matrix<OtherMatrixType,Mode,Options,Dim,HDim>::run(this, other.matrix());
350 }
351 else
352 {
353 // here we know that Mode == AffineCompact and OtherMode != AffineCompact.
354 // if OtherMode were Projective, the static assert above would already have caught it.
355 // So the only possibility is that OtherMode == Affine
356 linear() = other.linear();
357 translation() = other.translation();
358 }
359 }
#define EIGEN_IMPLIES(a, b)
Definition Macros.h:902
EIGEN_DEVICE_FUNC void makeAffine()
Definition Transform.h:652
internal::make_proper_matrix_type< Scalar, Rows, HDim, Options >::type MatrixType
Definition Transform.h:217
EIGEN_DEVICE_FUNC ConstLinearPart linear() const
Definition Transform.h:400
EIGEN_DEVICE_FUNC ConstTranslationPart translation() const
Definition Transform.h:410
@ Projective
Definition Constants.h:454

References Eigen::Affine, Eigen::AffineCompact, Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::check_template_params(), EIGEN_IMPLIES, EIGEN_STATIC_ASSERT, Eigen::Isometry, Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix, Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::makeAffine(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::matrix(), Eigen::Projective, and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translation().

+ Here is the call graph for this function:

◆ Transform() [9/10]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform ( const ReturnByValue< OtherDerived > &  other)
inline
363 {
365 other.evalTo(*this);
366 }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::check_template_params(), and Eigen::ReturnByValue< Derived >::evalTo().

+ Here is the call graph for this function:

◆ Transform() [10/10]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform ( const Transform< OtherScalarType, Dim, Mode, Options > &  other)
inlineexplicit

Copy constructor with scalar type conversion

638 {
640 m_matrix = other.matrix().template cast<Scalar>();
641 }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::check_template_params(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix, and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::matrix().

+ Here is the call graph for this function:

Member Function Documentation

◆ affine() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC AffinePart Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::affine ( )
inline
Returns
a writable expression of the Dim x HDim affine part of the transformation
static AffinePart run(MatrixType &m)
Definition Transform.h:1241

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix, and Eigen::internal::transform_take_affine_part< TransformType >::run().

+ Here is the call graph for this function:

◆ affine() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC ConstAffinePart Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::affine ( ) const
inline
Returns
a read-only expression of the Dim x HDim affine part of the transformation

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix, and Eigen::internal::transform_take_affine_part< TransformType >::run().

Referenced by Eigen::internal::transform_left_product_impl< Other, Mode, Options, Dim, HDim, Dim, HDim >::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast()

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Transform, Transform< NewScalarType, Dim, Mode, Options > >::type Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::cast ( ) const
inline

◆ check_template_params()

◆ cols()

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Index Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::cols ( ) const
inline
385{ return m_matrix.cols(); }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
Definition PlainObjectBase.h:153

References Eigen::PlainObjectBase< Derived >::cols(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

+ Here is the call graph for this function:

◆ computeRotationScaling()

template<typename Scalar , int Dim, int Mode, int Options>
template<typename RotationMatrixType , typename ScalingMatrixType >
EIGEN_DEVICE_FUNC void Eigen::Transform< Scalar, Dim, Mode, Options >::computeRotationScaling ( RotationMatrixType *  rotation,
ScalingMatrixType *  scaling 
) const

decomposes the linear part of the transformation as a product rotation x scaling, the scaling being not necessarily positive.

If either pointer is zero, the corresponding computation is skipped.

\svd_module

See also
computeScalingRotation(), rotation(), class SVD
1080{
1081 JacobiSVD<LinearMatrixType> svd(linear(), ComputeFullU | ComputeFullV);
1082
1083 Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant(); // so x has absolute value 1
1084 VectorType sv(svd.singularValues());
1085 sv.coeffRef(0) *= x;
1086 if(scaling) scaling->lazyAssign(svd.matrixV() * sv.asDiagonal() * svd.matrixV().adjoint());
1087 if(rotation)
1088 {
1089 LinearMatrixType m(svd.matrixU());
1090 m.col(0) /= x;
1091 rotation->lazyAssign(m * svd.matrixV().adjoint());
1092 }
1093}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & lazyAssign(const DenseBase< OtherDerived > &other)
Definition PlainObjectBase.h:465
Matrix< Scalar, Dim, Dim, Options > LinearMatrixType
Definition Transform.h:221
_Scalar Scalar
Definition Transform.h:213
EIGEN_DEVICE_FUNC const LinearMatrixType rotation() const
Definition Transform.h:1058
Matrix< Scalar, Dim, 1 > VectorType
Definition Transform.h:235
@ ComputeFullU
Definition Constants.h:383

References Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::coeffRef(), Eigen::ComputeFullU, Eigen::ComputeFullV, Eigen::SVDBase< Derived >::matrixU(), Eigen::SVDBase< Derived >::matrixV(), and Eigen::SVDBase< Derived >::singularValues().

Referenced by Slic3r::Geometry::contains_skew(), Slic3r::Geometry::extract_rotation_matrix(), Slic3r::Geometry::extract_rotation_scale(), Slic3r::Geometry::extract_scale(), and Slic3r::GUI::Selection::scale_and_translate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeScalingRotation()

template<typename Scalar , int Dim, int Mode, int Options>
template<typename ScalingMatrixType , typename RotationMatrixType >
EIGEN_DEVICE_FUNC void Eigen::Transform< Scalar, Dim, Mode, Options >::computeScalingRotation ( ScalingMatrixType *  scaling,
RotationMatrixType *  rotation 
) const

decomposes the linear part of the transformation as a product scaling x rotation, the scaling being not necessarily positive.

If either pointer is zero, the corresponding computation is skipped.

\svd_module

See also
computeRotationScaling(), rotation(), class SVD
1109{
1110 JacobiSVD<LinearMatrixType> svd(linear(), ComputeFullU | ComputeFullV);
1111
1112 Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant(); // so x has absolute value 1
1113 VectorType sv(svd.singularValues());
1114 sv.coeffRef(0) *= x;
1115 if(scaling) scaling->lazyAssign(svd.matrixU() * sv.asDiagonal() * svd.matrixU().adjoint());
1116 if(rotation)
1117 {
1118 LinearMatrixType m(svd.matrixU());
1119 m.col(0) /= x;
1120 rotation->lazyAssign(m * svd.matrixV().adjoint());
1121 }
1122}

References Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >::coeffRef(), Eigen::ComputeFullU, Eigen::ComputeFullV, Eigen::SVDBase< Derived >::matrixU(), Eigen::SVDBase< Derived >::matrixV(), and Eigen::SVDBase< Derived >::singularValues().

+ Here is the call graph for this function:

◆ data() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Scalar * Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::data ( )
inline
Returns
a non-const pointer to the column major internal matrix
624{ return m_matrix.data(); }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
Definition PlainObjectBase.h:255

References Eigen::PlainObjectBase< Derived >::data(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

+ Here is the call graph for this function:

◆ data() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC const Scalar * Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::data ( ) const
inline
Returns
a const pointer to the column major internal matrix
622{ return m_matrix.data(); }

References Eigen::PlainObjectBase< Derived >::data(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

Referenced by Slic3r::print_objects_from_model_object(), Slic3r::transform3d_equal(), and Slic3r::transform3d_lower().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE()

template<typename _Scalar , int _Dim, int _Mode, int _Options>
Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE ( _Scalar  ,
_Dim  = =Dynamic ? Dynamic : (_Dim+1)*(_Dim+1) 
)
inline

< space dimension in which the transformation holds

< size of a respective homogeneous vector

204 : (_Dim+1)*(_Dim+1))
205 enum {
206 Mode = _Mode,
207 Options = _Options,
208 Dim = _Dim,
209 HDim = _Dim+1,
210 Rows = int(Mode)==(AffineCompact) ? Dim : HDim
211 };
const constexpr int Dim
Definition Line.hpp:35

◆ fromPositionOrientationScale() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::fromPositionOrientationScale ( const MatrixBase< PositionDerived > &  position,
const OrientationType &  orientation,
const MatrixBase< ScaleDerived > &  scale 
)

Referenced by Slic3r::GUI::Camera::rotate_local_around_target(), Slic3r::GUI::Camera::rotate_on_sphere(), and Slic3r::GUI::Camera::set_default_orientation().

+ Here is the caller graph for this function:

◆ fromPositionOrientationScale() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::fromPositionOrientationScale ( const MatrixBase< PositionDerived > &  position,
const OrientationType &  orientation,
const MatrixBase< ScaleDerived > &  scale 
)

Convenient method to set *this from a position, orientation and scale of a 3D object.

1132{
1133 linear() = internal::toRotationMatrix<Scalar,Dim>(orientation);
1134 linear() *= scale.asDiagonal();
1135 translation() = position;
1136 makeAffine();
1137 return *this;
1138}
EIGEN_DEVICE_FUNC Transform & scale(const MatrixBase< OtherDerived > &other)

References scale().

+ Here is the call graph for this function:

◆ Identity()

template<typename _Scalar , int _Dim, int _Mode, int _Options>
static EIGEN_DEVICE_FUNC const Transform Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Identity ( )
inlinestatic

Returns an identity transformation.

540 {
541 return Transform(MatrixType::Identity());
542 }
EIGEN_DEVICE_FUNC Transform()
Definition Transform.h:256

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform().

Referenced by Slic3r::identity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inverse()

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > Eigen::Transform< Scalar, Dim, Mode, Options >::inverse ( TransformTraits  hint = (TransformTraits)Mode) const
inline
Returns
the inverse transformation according to some given knowledge on *this.
Parameters
hintallows to optimize the inversion process when the transformation is known to be not a general transformation (optional). The possible values are:
  • Projective if the transformation is not necessarily affine, i.e., if the last row is not guaranteed to be [0 ... 0 1]
  • Affine if the last row can be assumed to be [0 ... 0 1]
  • Isometry if the transformation is only a concatenations of translations and rotations. The default is the template class parameter Mode.
Warning
unless traits is always set to NoShear or NoScaling, this function requires the generic inverse method of MatrixBase defined in the LU module. If you forget to include this module, then you will get hard to debug linking errors.
See also
MatrixBase::inverse()
1203{
1204 Transform res;
1205 if (hint == Projective)
1206 {
1208 }
1209 else
1210 {
1211 if (hint == Isometry)
1212 {
1213 res.matrix().template topLeftCorner<Dim,Dim>() = linear().transpose();
1214 }
1215 else if(hint&Affine)
1216 {
1217 res.matrix().template topLeftCorner<Dim,Dim>() = linear().inverse();
1218 }
1219 else
1220 {
1221 eigen_assert(false && "Invalid transform traits in Transform::Inverse");
1222 }
1223 // translation and remaining parts
1224 res.matrix().template topRightCorner<Dim,1>()
1225 = - res.matrix().template topLeftCorner<Dim,Dim>() * translation();
1226 res.makeAffine(); // we do need this, because in the beginning res is uninitialized
1227 }
1228 return res;
1229}
static EIGEN_DEVICE_FUNC void run(const TransformType &, TransformType &)
Definition Transform.h:1164

References Eigen::Affine, eigen_assert, Eigen::Isometry, Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::makeAffine(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::matrix(), Eigen::Projective, and Eigen::internal::projective_transform_inverse< TransformType, Mode >::run().

Referenced by priv::apply_camera_dir(), Slic3r::GUI::GLGizmoFdmSupports::apply_data_from_backend(), Slic3r::ModelObject::bake_xy_rotation_into_meshes(), Slic3r::GUI::calc_surface_offset(), Slic3r::GUI::RaycastManager::closest(), Slic3r::GUI::RaycastManager::closest_hit(), Slic3r::TextConfigurationSerialization::create_fix_and_store(), Slic3r::GUI::GLGizmoEmboss::create_volume(), Slic3r::ModelObject::cut(), priv::cut_surface(), Slic3r::GUI::Plater::export_stl_obj(), Slic3r::Measure::MeasuringImpl::extract_features(), Slic3r::GUI::RaycastManager::first_hit(), Slic3r::Measure::get_center_and_radius(), Slic3r::GUI::GLGizmoPainterBase::get_clipping_plane_in_volume_coordinates(), Slic3r::GUI::MeshRaycaster::get_unobscured_idxs(), Slic3r::GUI::GLGizmoPainterBase::gizmo_event(), Slic3r::GUI::MeshRaycaster::is_valid_intersection(), Slic3r::GUI::MeshRaycaster::line_from_mouse_pos(), Slic3r::GUI::ObjectList::load_generic_subobject(), Slic3r::GUI::ObjectList::load_modifier(), Slic3r::GLVolumeCollection::load_object_auxiliary(), Slic3r::GUI::GLGizmoRotate::mouse_position_in_local_plane(), Slic3r::GUI::GLGizmoCut3D::mouse_position_in_local_plane(), Slic3r::GUI::on_mouse_surface_drag(), Slic3r::GUI::GLGizmoMeasure::on_render(), Slic3r::GUI::CommonGizmosDataObjects::Raycaster::on_update(), Slic3r::GUI::CommonGizmosDataObjects::ObjectClipper::on_update(), Slic3r::GUI::Selection::paste_volumes_from_clipboard(), Slic3r::GUI::GLGizmoEmboss::process(), Slic3r::GUI::GLGizmoCut3D::process_cut_line(), Slic3r::ModelObject::process_volume_cut(), Slic3r::GUI::MeshClipper::recalculate_triangles(), Slic3r::GUI::Plater::priv::reload_from_disk(), Slic3r::GUI::GLGizmoPainterBase::render_cursor_sphere(), Slic3r::GUI::CommonGizmosDataObjects::SupportsClipper::render_cut(), Slic3r::GUI::GLGizmoHollow::render_points(), Slic3r::GUI::GLGizmoSlaSupports::render_points(), Slic3r::ModelObject::reset_instance_transformation(), Slic3r::GUI::Selection::reset_skew(), Slic3r::GUI::Selection::rotate(), Slic3r::GUI::Selection::scale_and_translate(), Slic3r::TriangleSelector::seed_fill_select_triangles(), Slic3r::GUI::GLGizmoFdmSupports::select_facets_by_angle(), Slic3r::TriangleSelector::select_patch(), Slic3r::GUI::GLGizmoCut3D::set_center_pos(), priv::start_create_volume_on_surface_job(), Slic3r::GUI::Selection::transform_volume_relative(), Slic3r::GUI::GLGizmoCut3D::transformed_bounding_box(), Slic3r::GUI::Selection::translate(), Slic3r::GUI::MeshRaycaster::unproject_on_mesh(), Slic3r::GUI::GLGizmoHollow::update_hole_raycasters_for_picking_transform(), Slic3r::GUI::GLGizmoFlatten::update_planes(), Slic3r::GUI::GLGizmoSlaSupports::update_point_raycasters_for_picking_transform(), Slic3r::GUI::GLGizmoSlaBase::update_volumes(), and Slic3r::GUI::world_matrix_fixed().

+ Here is the call graph for this function:

◆ isApprox()

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC bool Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::isApprox ( const Transform< _Scalar, _Dim, _Mode, _Options > &  other,
const typename NumTraits< Scalar >::Real &  prec = NumTraits<Scalar>::dummy_precision() 
) const
inline

◆ linear() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC LinearPart Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear ( )
inline
Returns
a writable expression of the linear part of the transformation
402{ return LinearPart(m_matrix,0,0); }
Block< MatrixType, Dim, Dim, int(Mode)==(AffineCompact) &&(Options &RowMajor)==0 > LinearPart
Definition Transform.h:223

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

◆ linear() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC ConstLinearPart Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear ( ) const
inline
Returns
a read-only expression of the linear part of the transformation
400{ return ConstLinearPart(m_matrix,0,0); }
const Block< ConstMatrixType, Dim, Dim, int(Mode)==(AffineCompact) &&(Options &RowMajor)==0 > ConstLinearPart
Definition Transform.h:225

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

Referenced by Slic3r::TriangleSelector::Cursor::Cursor(), Slic3r::GUI::GLGizmoCut3D::PartSelection::PartSelection(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), Slic3r::Geometry::TransformationSVD::TransformationSVD(), priv::apply_camera_dir(), Slic3r::GUI::calc_surface_offset(), Slic3r::Emboss::calc_up(), Slic3r::GUI::GLGizmoEmboss::calculate_scale(), Slic3r::GUI::RaycastManager::closest_hit(), priv::create_projection_for_cut(), Slic3r::GUI::RaycastManager::first_hit(), Slic3r::GUI::GLGizmoPainterBase::get_clipping_plane_in_volume_coordinates(), Slic3r::Geometry::Transformation::is_left_handed(), Slic3r::GUI::is_left_handed(), Slic3r::GUI::is_rotation_xy_synchronized(), Slic3r::GUI::MeshRaycaster::line_from_mouse_pos(), Slic3r::GUI::on_mouse_surface_drag(), Eigen::Translation< _Scalar, _Dim >::operator*(), Eigen::UniformScaling< _Scalar >::operator*(), Eigen::Translation< _Scalar, _Dim >::operator*(), Slic3r::Geometry::rotation_diff_z(), Eigen::internal::transform_transform_product_impl< Transform< Scalar, Dim, LhsMode, LhsOptions >, Transform< Scalar, Dim, RhsMode, RhsOptions >, false >::run(), Eigen::internal::rotation_base_generic_product_selector< RotationDerived, DiagonalMatrix< Scalar, Dim, MaxDim >, false >::run(), Slic3r::SLAPrint::sla_trafo(), igl::swept_volume_signed_distance(), Slic3r::GUI::Selection::synchronize_unselected_instances(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::transform(), Slic3r::GUI::MeshRaycaster::unproject_on_mesh(), and Slic3r::ModelObject::update_min_max_z().

+ Here is the caller graph for this function:

◆ linearExt() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, Dim > Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linearExt ( )
inline
661 :Dim,Dim> linearExt()
662 { return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,Dim>(0,0); }
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, Dim > linearExt()
Definition Transform.h:661

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

Referenced by Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*=().

+ Here is the caller graph for this function:

◆ linearExt() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC const Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, Dim > Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linearExt ( ) const
inline
667 :Dim,Dim> linearExt() const
668 { return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,Dim>(0,0); }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

◆ makeAffine()

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC void Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::makeAffine ( )
inline

Sets the last row to [0 ... 0 1]

653 {
654 internal::transform_make_affine<int(Mode)>::run(m_matrix);
655 }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

Referenced by Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::inverse(), and Eigen::internal::transform_transform_product_impl< Transform< Scalar, Dim, LhsMode, LhsOptions >, Transform< Scalar, Dim, RhsMode, RhsOptions >, false >::run().

+ Here is the caller graph for this function:

◆ matrix() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC MatrixType & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::matrix ( )
inline
Returns
a writable expression of the transformation matrix
397{ return m_matrix; }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

◆ matrix() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC const MatrixType & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::matrix ( ) const
inline
Returns
a read-only expression of the transformation matrix
395{ return m_matrix; }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

Referenced by Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), Slic3r::Geometry::TransformationSVD::TransformationSVD(), Slic3r::GUI::GLCanvas3D::_mouse_to_3d(), Slic3r::GUI::GLCanvas3D::_render_thumbnail_internal(), Slic3r::GUI::Camera::apply_projection(), Slic3r::ModelObject::bake_xy_rotation_into_meshes(), Slic3r::Geometry::contains_skew(), Slic3r::GUI::GLGizmoEmboss::draw_window(), Slic3r::GUI::Selection::flattening_rotate(), Slic3r::GUI::Camera::get_dir_forward(), Slic3r::GUI::Camera::get_dir_right(), Slic3r::GUI::Camera::get_dir_up(), Slic3r::GUI::Camera::get_fov(), Slic3r::GUI::Camera::get_near_bottom(), Slic3r::GUI::Camera::get_near_height(), Slic3r::GUI::Camera::get_near_left(), Slic3r::GUI::Camera::get_near_right(), Slic3r::GUI::Camera::get_near_top(), Slic3r::GUI::Camera::get_near_width(), Slic3r::ModelObject::get_object_stl_stats(), Slic3r::GUI::Camera::get_position(), Slic3r::GUI::Selection::get_screen_space_bounding_box(), Slic3r::GUI::SceneRaycaster::hit(), Slic3r::GUI::init_torus_data(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::inverse(), Slic3r::is_identity(), its_transform(), Slic3r::GUI::GCodeViewer::load_toolpaths(), Slic3r::GUI::Camera::look_at(), Slic3r::GUI::GLGizmoMeasure::on_render(), Slic3r::GUI::GLGizmoSimplify::on_render(), Eigen::Translation< _Scalar, _Dim >::operator*(), Eigen::UniformScaling< _Scalar >::operator*(), Eigen::Translation< _Scalar, _Dim >::operator*(), Slic3r::GUI::GLGizmoCut3D::process_cut_line(), Slic3r::GUI::CameraUtils::project(), Slic3r::project_triangles_to_slabs(), Slic3r::GUI::CameraUtils::ray_from_ortho_screen_pos(), Slic3r::GUI::CameraUtils::ray_from_persp_screen_pos(), Slic3r::GUI::MeshClipper::recalculate_triangles(), Slic3r::GUI::GCodeViewer::COG::render(), Slic3r::GUI::GCodeViewer::SequentialView::Marker::render(), Slic3r::GUI::CoordAxes::render(), Slic3r::GLVolumeCollection::render(), Slic3r::GUI::GLGizmoBase::Grabber::render(), Slic3r::GUI::TriangleSelectorMmGui::render(), Slic3r::GUI::GLGizmoMeasure::render_dimensioning(), Slic3r::GUI::Bed3D::render_model(), Slic3r::GUI::GLGizmoHollow::render_points(), Slic3r::GUI::GLGizmoSlaSupports::render_points(), Slic3r::GUI::Selection::render_sidebar_position_hints(), Slic3r::GUI::Selection::render_sidebar_rotation_hints(), Slic3r::GUI::Selection::render_sidebar_scale_hints(), Slic3r::GUI::GLGizmoPainterBase::render_triangles(), Slic3r::GUI::GLGizmoMmuSegmentation::render_triangles(), Slic3r::GUI::GLCanvas3D::LayersEditing::render_volumes(), Eigen::internal::transform_transform_product_impl< Transform< Scalar, Dim, LhsMode, LhsOptions >, Transform< Scalar, Dim, RhsMode, RhsOptions >, true >::run(), Eigen::internal::transform_transform_product_impl< Transform< Scalar, Dim, AffineCompact, LhsOptions >, Transform< Scalar, Dim, Projective, RhsOptions >, true >::run(), Eigen::internal::transform_transform_product_impl< Transform< Scalar, Dim, Projective, LhsOptions >, Transform< Scalar, Dim, AffineCompact, RhsOptions >, true >::run(), Eigen::internal::transform_left_product_impl< Other, Mode, Options, Dim, HDim, HDim, HDim >::run(), Eigen::internal::transform_left_product_impl< Other, AffineCompact, Options, Dim, HDim, HDim, HDim >::run(), Eigen::internal::transform_left_product_impl< Other, Mode, Options, Dim, HDim, Dim, HDim >::run(), Eigen::internal::transform_left_product_impl< Other, AffineCompact, Options, Dim, HDim, Dim, HDim >::run(), Eigen::internal::transform_left_product_impl< Other, Mode, Options, Dim, HDim, Dim, Dim >::run(), cereal::serialize(), Slic3r::GLShaderProgram::set_uniform(), Slic3r::GUI::Sidebar::show_info_sizer(), Slic3r::slice_mesh_slabs(), stl_transform(), Slic3r::Geometry::trafos_differ_in_rotation_by_z_and_mirroring_by_xy_only(), Slic3r::trafos_differ_in_rotation_by_z_and_mirroring_by_xy_only(), Slic3r::TriangleMesh::transform(), and Slic3r::GUI::GLGizmoFlatten::update_planes().

◆ operator()() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Scalar & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator() ( Index  row,
Index  col 
)
inline

shortcut for m_matrix(row,col);

See also
MatrixBase::operator(Index,Index)
392{ return m_matrix(row,col); }

References col(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix, and row().

+ Here is the call graph for this function:

◆ operator()() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Scalar Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator() ( Index  row,
Index  col 
) const
inline

shortcut for m_matrix(row,col);

See also
MatrixBase::operator(Index,Index) const
389{ return m_matrix(row,col); }

References col(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix, and row().

+ Here is the call graph for this function:

◆ operator*() [1/8]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename DiagonalDerived >
EIGEN_DEVICE_FUNC const TransformTimeDiagonalReturnType Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator* ( const DiagonalBase< DiagonalDerived > &  b) const
inline
Returns
The product expression of a transform a times a diagonal matrix b

The rhs diagonal matrix is interpreted as an affine scaling transformation. The product results in a Transform of the same type (mode) as the lhs only if the lhs mode is no isometry. In that case, the returned transform is an affinity.

465 {
467 res.linearExt() *= b;
468 return res;
469 }
Transform< Scalar, Dim, TransformTimeDiagonalMode > TransformTimeDiagonalReturnType
Definition Transform.h:246

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linearExt().

+ Here is the call graph for this function:

◆ operator*() [2/8]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::transform_right_product_impl< Transform, OtherDerived >::ResultType Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator* ( const EigenBase< OtherDerived > &  other) const
inline
Returns
an expression of the product between the transform *this and a matrix expression other.

The right-hand-side other can be either:

  • an homogeneous vector of size Dim+1,
  • a set of homogeneous vectors of size Dim+1 x N,
  • a transformation matrix of size Dim+1 x Dim+1.

Moreover, if *this represents an affine transformation (i.e., Mode!=Projective), then other can also be:

  • a point of size Dim (computes:
    this->linear() * other + this->translation()
    ),
  • a set of N points as a Dim x N matrix (computes:
    (this->linear() * other).colwise() + this->translation()
    ),

In all cases, the return type is a matrix or vector of same sizes as the right-hand-side other.

If you want to interpret other as a linear or affine transformation, then first convert it to a Transform<> type, or do your own cooking.

Finally, if you want to apply Affine transformations to vectors, then explicitly apply the linear part only:

Vector3f v1, v2;
v2 = A.linear() * v1;
Represents an homogeneous transformation in a N dimensional space.
Definition Transform.h:202
442 { return internal::transform_right_product_impl<Transform, OtherDerived>::run(*this,other.derived()); }

References Eigen::EigenBase< Derived >::derived().

+ Here is the call graph for this function:

◆ operator*() [3/8]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename Derived >
EIGEN_DEVICE_FUNC Transform Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator* ( const RotationBase< Derived, Dim > &  r) const
inline

◆ operator*() [4/8]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename Derived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator* ( const RotationBase< Derived, Dim > &  r) const
inline
1039{
1040 Transform res = *this;
1041 res.rotate(r.derived());
1042 return res;
1043}

References Eigen::RotationBase< Derived, _Dim >::derived(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::rotate().

+ Here is the call graph for this function:

◆ operator*() [5/8]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC const Transform Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator* ( const Transform< _Scalar, _Dim, _Mode, _Options > &  other) const
inline

Concatenates two transformations

494 {
495 return internal::transform_transform_product_impl<Transform,Transform>::run(*this,other);
496 }

◆ operator*() [6/8]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<int OtherMode, int OtherOptions>
EIGEN_DEVICE_FUNC internal::transform_transform_product_impl< Transform, Transform< Scalar, Dim, OtherMode, OtherOptions > >::ResultType Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator* ( const Transform< Scalar, Dim, OtherMode, OtherOptions > &  other) const
inline

Concatenates two different transformations

527 {
528 return internal::transform_transform_product_impl<Transform,Transform<Scalar,Dim,OtherMode,OtherOptions> >::run(*this,other);
529 }

◆ operator*() [7/8]

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > Eigen::Transform< Scalar, Dim, Mode, Options >::operator* ( const TranslationType t) const
inline
1011{
1012 Transform res = *this;
1013 res.translate(t.vector());
1014 return res;
1015}

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translate(), and Eigen::Translation< _Scalar, _Dim >::vector().

+ Here is the call graph for this function:

◆ operator*() [8/8]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC TransformTimeDiagonalReturnType Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator* ( const UniformScaling< Scalar > &  s) const
inline
589 {
591 res.scale(s.factor());
592 return res;
593 }

References Eigen::UniformScaling< _Scalar >::factor(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::scale().

+ Here is the call graph for this function:

◆ operator*=() [1/5]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*= ( const DiagonalMatrix< Scalar, Dim > &  s)
inline
596{ linearExt() *= s; return *this; }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linearExt().

+ Here is the call graph for this function:

◆ operator*=() [2/5]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*= ( const EigenBase< OtherDerived > &  other)
inline
490{ return *this = *this * other; }

◆ operator*=() [3/5]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename Derived >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*= ( const RotationBase< Derived, Dim > &  r)
inline
601{ return rotate(r.toRotationMatrix()); }
EIGEN_DEVICE_FUNC Transform & rotate(const RotationType &rotation)

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::rotate(), and Eigen::RotationBase< Derived, _Dim >::toRotationMatrix().

+ Here is the call graph for this function:

◆ operator*=() [4/5]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*= ( const TranslationType t)
inline
577{ return translate(t.vector()); }
EIGEN_DEVICE_FUNC Transform & translate(const MatrixBase< OtherDerived > &other)

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translate(), and Eigen::Translation< _Scalar, _Dim >::vector().

+ Here is the call graph for this function:

◆ operator*=() [5/5]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*= ( const UniformScaling< Scalar > &  s)
inline
585{ return scale(s.factor()); }

References Eigen::UniformScaling< _Scalar >::factor(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::scale().

+ Here is the call graph for this function:

◆ operator=() [1/7]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator= ( const EigenBase< OtherDerived > &  other)
inline

Set *this from a Dim^2 or (Dim+1)^2 matrix.

304 {
306 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
307
308 internal::transform_construct_from_matrix<OtherDerived,Mode,Options,Dim,HDim>::run(this, other.derived());
309 return *this;
310 }

References Eigen::EigenBase< Derived >::derived(), and EIGEN_STATIC_ASSERT.

+ Here is the call graph for this function:

◆ operator=() [2/7]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator= ( const ReturnByValue< OtherDerived > &  other)
inline
370 {
371 other.evalTo(*this);
372 return *this;
373 }

References Eigen::ReturnByValue< Derived >::evalTo().

+ Here is the call graph for this function:

◆ operator=() [3/7]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename Derived >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator= ( const RotationBase< Derived, Dim > &  r)
inline

◆ operator=() [4/7]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename Derived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator= ( const RotationBase< Derived, Dim > &  r)
inline
1029{
1030 linear() = internal::toRotationMatrix<Scalar,Dim>(r);
1031 translation().setZero();
1032 makeAffine();
1033 return *this;
1034}

◆ operator=() [5/7]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator= ( const Transform< _Scalar, _Dim, _Mode, _Options > &  other)
inline
286 { m_matrix = other.m_matrix; return *this; }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

◆ operator=() [6/7]

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::operator= ( const TranslationType t)
inline
1002{
1003 linear().setIdentity();
1004 translation() = t.vector();
1005 makeAffine();
1006 return *this;
1007}

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::setIdentity(), and Eigen::Translation< _Scalar, _Dim >::vector().

+ Here is the call graph for this function:

◆ operator=() [7/7]

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::operator= ( const UniformScaling< Scalar > &  t)
inline
1019{
1020 m_matrix.setZero();
1021 linear().diagonal().fill(s.factor());
1022 makeAffine();
1023 return *this;
1024}
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
Definition CwiseNullaryOp.h:515

References Eigen::UniformScaling< _Scalar >::factor(), and Eigen::PlainObjectBase< Derived >::setZero().

+ Here is the call graph for this function:

◆ prerotate() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::prerotate ( const RotationType &  rotation)
inline

◆ prerotate() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::prerotate ( const RotationType &  rotation)

Applies on the left the rotation represented by the rotation rotation to *this and returns a reference to *this.

See rotate() for further details.

See also
rotate()
959{
960 m_matrix.template block<Dim,HDim>(0,0) = internal::toRotationMatrix<Scalar,Dim>(rotation)
961 * m_matrix.template block<Dim,HDim>(0,0);
962 return *this;
963}

◆ prescale() [1/3]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::prescale ( const MatrixBase< OtherDerived > &  other)
inline

Referenced by Slic3r::mesh_to_grid(), Eigen::UniformScaling< _Scalar >::operator*(), and Slic3r::transform_mesh_vertices_for_slicing().

+ Here is the caller graph for this function:

◆ prescale() [2/3]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::prescale ( const MatrixBase< OtherDerived > &  other)

Applies on the left the non uniform scale transformation represented by the vector other to *this and returns a reference to *this.

See also
scale()
872{
873 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim))
874 EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
875 affine().noalias() = (other.asDiagonal() * affine());
876 return *this;
877}
EIGEN_DEVICE_FUNC ConstAffinePart affine() const
Definition Transform.h:405

References Eigen::MatrixBase< Derived >::asDiagonal(), EIGEN_STATIC_ASSERT, EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::Isometry.

+ Here is the call graph for this function:

◆ prescale() [3/3]

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::prescale ( const Scalar s)
inline

Applies on the left a uniform scale of a factor c to *this and returns a reference to *this.

See also
scale(Scalar)
885{
886 EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
887 m_matrix.template topRows<Dim>() *= s;
888 return *this;
889}

References EIGEN_STATIC_ASSERT, and Eigen::Isometry.

◆ preshear()

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::preshear ( const Scalar sx,
const Scalar sy 
)

Applies on the left the shear transformation represented by the vector other to *this and returns a reference to *this.

Warning
2D only.
See also
shear()
989{
990 EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
991 EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
992 m_matrix.template block<Dim,HDim>(0,0) = LinearMatrixType(1, sx, sy, 1) * m_matrix.template block<Dim,HDim>(0,0);
993 return *this;
994}

References EIGEN_STATIC_ASSERT, and Eigen::Isometry.

◆ pretranslate() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::pretranslate ( const MatrixBase< OtherDerived > &  other)
inline

Referenced by priv::create_emboss_projection(), Eigen::Translation< _Scalar, _Dim >::operator*(), Slic3r::GUI::MeshClipper::recalculate_triangles(), and Slic3r::PrintObject::trafo_centered().

+ Here is the caller graph for this function:

◆ pretranslate() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::pretranslate ( const MatrixBase< OtherDerived > &  other)

Applies on the left the translation matrix represented by the vector other to *this and returns a reference to *this.

See also
translate()
913{
914 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim))
915 if(int(Mode)==int(Projective))
916 affine() += other * m_matrix.row(Dim);
917 else
918 translation() += other;
919 return *this;
920}

References EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::Projective.

◆ rotate() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::rotate ( const RotationType &  rotation)
inline

◆ rotate() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename RotationType >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::rotate ( const RotationType &  rotation)

Applies on the right the rotation represented by the rotation rotation to *this and returns a reference to *this.

The template parameter RotationType is the type of the rotation which must be known by internal::toRotationMatrix<>.

Natively supported types includes:

This mechanism is easily extendable to support user types such as Euler angles, or a pair of Quaternion for 4D rotations.

See also
rotate(Scalar), class Quaternion, class AngleAxis, prerotate(RotationType)
943{
944 linearExt() *= internal::toRotationMatrix<Scalar,Dim>(rotation);
945 return *this;
946}

◆ rotation()

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC const Transform< Scalar, Dim, Mode, Options >::LinearMatrixType Eigen::Transform< Scalar, Dim, Mode, Options >::rotation
Returns
the rotation part of the transformation

\svd_module

See also
computeRotationScaling(), computeScalingRotation(), class SVD
1059{
1060 LinearMatrixType result;
1062 return result;
1063}
EIGEN_DEVICE_FUNC void computeRotationScaling(RotationMatrixType *rotation, ScalingMatrixType *scaling) const
Definition Transform.h:1079

Referenced by Slic3r::GUI::GLGizmoCut3D::dragging_grabber_xy().

+ Here is the caller graph for this function:

◆ rows()

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Index Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::rows ( ) const
inline
384{ return int(Mode)==int(Projective) ? m_matrix.cols() : (m_matrix.cols()-1); }

References Eigen::PlainObjectBase< Derived >::cols(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix, and Eigen::Projective.

+ Here is the call graph for this function:

◆ scale() [1/3]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::scale ( const MatrixBase< OtherDerived > &  other)
inline

Referenced by priv::create_projection_for_cut(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator*=(), and Slic3r::GUI::CoordAxes::render().

+ Here is the caller graph for this function:

◆ scale() [2/3]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::scale ( const MatrixBase< OtherDerived > &  other)

Applies on the right the non uniform scale transformation represented by the vector other to *this and returns a reference to *this.

See also
prescale()
845{
846 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim))
847 EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
848 linearExt().noalias() = (linearExt() * other.asDiagonal());
849 return *this;
850}

References Eigen::MatrixBase< Derived >::asDiagonal(), EIGEN_STATIC_ASSERT, EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::Isometry.

+ Here is the call graph for this function:

◆ scale() [3/3]

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::scale ( const Scalar s)
inline

Applies on the right a uniform scale of a factor c to *this and returns a reference to *this.

See also
prescale(Scalar)
858{
859 EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
860 linearExt() *= s;
861 return *this;
862}

References EIGEN_STATIC_ASSERT, and Eigen::Isometry.

◆ setIdentity()

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC void Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::setIdentity ( )
inline
See also
MatrixBase::setIdentity()
533{ m_matrix.setIdentity(); }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

Referenced by Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator=().

+ Here is the caller graph for this function:

◆ shear()

template<typename Scalar , int Dim, int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< Scalar, Dim, Mode, Options >::shear ( const Scalar sx,
const Scalar sy 
)

Applies on the right the shear transformation represented by the vector other to *this and returns a reference to *this.

Warning
2D only.
See also
preshear()
973{
974 EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
975 EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
976 VectorType tmp = linear().col(0)*sy + linear().col(1);
977 linear() << linear().col(0) + linear().col(1)*sx, tmp;
978 return *this;
979}

References EIGEN_STATIC_ASSERT, and Eigen::Isometry.

◆ translate() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translate ( const MatrixBase< OtherDerived > &  other)
inline

◆ translate() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode, Options > & Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translate ( const MatrixBase< OtherDerived > &  other)

Applies on the right the translation matrix represented by the vector other to *this and returns a reference to *this.

See also
pretranslate()
899{
900 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(OtherDerived,int(Dim))
901 translationExt() += linearExt() * other;
902 return *this;
903}
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, 1 > translationExt()
Definition Transform.h:674

References EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE.

◆ translation() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC TranslationPart Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translation ( )
inline
Returns
a writable expression of the translation vector of the transformation
412{ return TranslationPart(m_matrix,0,Dim); }
Block< MatrixType, Dim, 1,!(internal::traits< MatrixType >::Flags &RowMajorBit)> TranslationPart
Definition Transform.h:237

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

◆ translation() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC ConstTranslationPart Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translation ( ) const
inline
Returns
a read-only expression of the translation vector of the transformation
410{ return ConstTranslationPart(m_matrix,0,Dim); }
const Block< ConstMatrixType, Dim, 1,!(internal::traits< MatrixType >::Flags &RowMajorBit)> ConstTranslationPart
Definition Transform.h:239

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

Referenced by Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), Slic3r::TriangleSelectorWrapper::enforce_spot(), Slic3r::GUI::Selection::get_full_scaled_instance_bounding_box(), Slic3r::GUI::Selection::get_full_unscaled_instance_bounding_box(), Slic3r::GUI::Selection::get_full_unscaled_instance_local_bounding_box(), Slic3r::Geometry::Transformation::get_offset(), Slic3r::GUI::Selection::get_scaled_instance_bounding_box(), Slic3r::GUI::Selection::get_unscaled_instance_bounding_box(), Slic3r::GUI::on_mouse_surface_drag(), Eigen::Translation< _Scalar, _Dim >::operator*(), Eigen::UniformScaling< _Scalar >::operator*(), Eigen::Translation< _Scalar, _Dim >::operator*(), Slic3r::GUI::MeshClipper::recalculate_triangles(), Slic3r::GUI::GLGizmoHollow::render_points(), Slic3r::GUI::GLGizmoSlaSupports::render_points(), Slic3r::GUI::Selection::render_sidebar_hints(), Slic3r::GUI::Camera::rotate_local_around_target(), Slic3r::GUI::Camera::rotate_on_sphere(), Eigen::internal::transform_transform_product_impl< Transform< Scalar, Dim, LhsMode, LhsOptions >, Transform< Scalar, Dim, RhsMode, RhsOptions >, false >::run(), Eigen::internal::transform_left_product_impl< Other, AffineCompact, Options, Dim, HDim, Dim, HDim >::run(), Slic3r::Geometry::Transformation::set_mirror(), Slic3r::Geometry::Transformation::set_mirror(), Slic3r::Geometry::Transformation::set_offset(), Slic3r::Geometry::Transformation::set_offset(), Slic3r::Geometry::Transformation::set_rotation(), Slic3r::Geometry::Transformation::set_rotation(), Slic3r::Geometry::Transformation::set_scaling_factor(), Slic3r::Geometry::Transformation::set_scaling_factor(), igl::swept_volume_signed_distance(), Slic3r::GUI::Selection::synchronize_unselected_instances(), Slic3r::trafo_for_bbox(), Slic3r::Geometry::trafos_differ_in_rotation_by_z_and_mirroring_by_xy_only(), Slic3r::trafos_differ_in_rotation_by_z_and_mirroring_by_xy_only(), Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::transform(), Slic3r::sla::transformed_drainhole_points(), Slic3r::GUI::GLGizmoSlaBase::unproject_on_mesh(), Slic3r::ModelObject::update_min_max_z(), Slic3r::GUI::GLCanvas3D::update_sequential_clearance(), and Slic3r::GLVolume::world_matrix().

+ Here is the caller graph for this function:

◆ translationExt() [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, 1 > Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translationExt ( )
inline
674 :Dim,1> translationExt()
675 { return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,1>(0,Dim); }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

◆ translationExt() [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
EIGEN_DEVICE_FUNC const Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, 1 > Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translationExt ( ) const
inline
680 :Dim,1> translationExt() const
681 { return m_matrix.template block<int(Mode)==int(Projective)?HDim:Dim,1>(0,Dim); }

References Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix.

Friends And Related Symbol Documentation

◆ operator* [1/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename DiagonalDerived >
EIGEN_DEVICE_FUNC friend TransformTimeDiagonalReturnType operator* ( const DiagonalBase< DiagonalDerived > &  a,
const Transform< _Scalar, _Dim, _Mode, _Options > &  b 
)
friend
Returns
The product expression of a diagonal matrix a times a transform b

The lhs diagonal matrix is interpreted as an affine scaling transformation. The product results in a Transform of the same type (mode) as the lhs only if the lhs mode is no isometry. In that case, the returned transform is an affinity.

480 {
482 res.linear().noalias() = a*b.linear();
483 res.translation().noalias() = a*b.translation();
484 if (Mode!=int(AffineCompact))
485 res.matrix().row(Dim) = b.matrix().row(Dim);
486 return res;
487 }

◆ operator* [2/2]

template<typename _Scalar , int _Dim, int _Mode, int _Options>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC const internal::transform_left_product_impl< OtherDerived, Mode, Options, _Dim, _Dim+1 >::ResultType operator* ( const EigenBase< OtherDerived > &  a,
const Transform< _Scalar, _Dim, _Mode, _Options > &  b 
)
friend
Returns
the product expression of a transformation matrix a times a transform b

The left hand side other can be either:

  • a linear transformation matrix of size Dim x Dim,
  • an affine transformation matrix of size Dim x Dim+1,
  • a general transformation matrix of size Dim+1 x Dim+1.
454 { return internal::transform_left_product_impl<OtherDerived,Mode,Options,Dim,HDim>::run(a.derived(),b); }

Member Data Documentation

◆ m_matrix

template<typename _Scalar , int _Dim, int _Mode, int _Options>
MatrixType Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::m_matrix
protected

Referenced by Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::Transform(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::affine(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::affine(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::cols(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::data(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::data(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::isApprox(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linearExt(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linearExt(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::makeAffine(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::matrix(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::matrix(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator()(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator()(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::operator=(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::rows(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::setIdentity(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translation(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translation(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translationExt(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translationExt().

◆ Eigen::Translation

class Eigen::Translation
template<typename _Scalar, int _Dim>
class Eigen::Translation< _Scalar, _Dim >

Represents a translation transformation.

\geometry_module

Template Parameters
_Scalarthe scalar type, i.e., the type of the coefficients.
_Dimthe dimension of the space, can be a compile time value or Dynamic
Note
This class is not aimed to be used to store a translation transformation, but rather to make easier the constructions and updates of Transform objects.
See also
class Scaling, class Transform
+ Collaboration diagram for Eigen::Translation< _Scalar, _Dim >:

Public Types

enum  { Dim = _Dim }
 
typedef _Scalar Scalar
 
typedef Matrix< Scalar, Dim, 1 > VectorType
 
typedef Matrix< Scalar, Dim, DimLinearMatrixType
 
typedef Transform< Scalar, Dim, AffineAffineTransformType
 
typedef Transform< Scalar, Dim, IsometryIsometryTransformType
 

Public Member Functions

EIGEN_DEVICE_FUNC Translation ()
 
EIGEN_DEVICE_FUNC Translation (const Scalar &sx, const Scalar &sy)
 
EIGEN_DEVICE_FUNC Translation (const Scalar &sx, const Scalar &sy, const Scalar &sz)
 
EIGEN_DEVICE_FUNC Translation (const VectorType &vector)
 
EIGEN_DEVICE_FUNC Scalar x () const
 Retruns the x-translation by value.
 
EIGEN_DEVICE_FUNC Scalar y () const
 Retruns the y-translation by value.
 
EIGEN_DEVICE_FUNC Scalar z () const
 Retruns the z-translation by value.
 
EIGEN_DEVICE_FUNC Scalarx ()
 Retruns the x-translation as a reference.
 
EIGEN_DEVICE_FUNC Scalary ()
 Retruns the y-translation as a reference.
 
EIGEN_DEVICE_FUNC Scalarz ()
 Retruns the z-translation as a reference.
 
EIGEN_DEVICE_FUNC const VectorTypevector () const
 
EIGEN_DEVICE_FUNC VectorTypevector ()
 
EIGEN_DEVICE_FUNC const VectorTypetranslation () const
 
EIGEN_DEVICE_FUNC VectorTypetranslation ()
 
EIGEN_DEVICE_FUNC Translation operator* (const Translation &other) const
 
EIGEN_DEVICE_FUNC AffineTransformType operator* (const UniformScaling< Scalar > &other) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC AffineTransformType operator* (const EigenBase< OtherDerived > &linear) const
 
template<typename Derived >
EIGEN_DEVICE_FUNC IsometryTransformType operator* (const RotationBase< Derived, Dim > &r) const
 
template<int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > operator* (const Transform< Scalar, Dim, Mode, Options > &t) const
 
template<typename Derived >
internal::enable_if< Derived::IsVectorAtCompileTime, VectorType >::type operator* (const MatrixBase< Derived > &vec) const
 
Translation inverse () const
 
Translationoperator= (const Translation &other)
 
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Translation, Translation< NewScalarType, Dim > >::type cast () const
 
template<typename OtherScalarType >
EIGEN_DEVICE_FUNC Translation (const Translation< OtherScalarType, Dim > &other)
 
EIGEN_DEVICE_FUNC bool isApprox (const Translation &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
 

Static Public Member Functions

static const Translation Identity ()
 

Protected Attributes

VectorType m_coeffs
 

Friends

template<typename OtherDerived >
EIGEN_DEVICE_FUNC AffineTransformType operator* (const EigenBase< OtherDerived > &linear, const Translation &t)
 

Member Typedef Documentation

◆ AffineTransformType

template<typename _Scalar , int _Dim>
typedef Transform<Scalar,Dim,Affine> Eigen::Translation< _Scalar, _Dim >::AffineTransformType

corresponding affine transformation type

◆ IsometryTransformType

template<typename _Scalar , int _Dim>
typedef Transform<Scalar,Dim,Isometry> Eigen::Translation< _Scalar, _Dim >::IsometryTransformType

corresponding isometric transformation type

◆ LinearMatrixType

template<typename _Scalar , int _Dim>
typedef Matrix<Scalar,Dim,Dim> Eigen::Translation< _Scalar, _Dim >::LinearMatrixType

corresponding linear transformation matrix type

◆ Scalar

template<typename _Scalar , int _Dim>
typedef _Scalar Eigen::Translation< _Scalar, _Dim >::Scalar

the scalar type of the coefficients

◆ VectorType

template<typename _Scalar , int _Dim>
typedef Matrix<Scalar,Dim,1> Eigen::Translation< _Scalar, _Dim >::VectorType

corresponding vector type

Member Enumeration Documentation

◆ anonymous enum

template<typename _Scalar , int _Dim>
anonymous enum

dimension of the space

Enumerator
Dim 
35{ Dim = _Dim };
@ Dim
Definition Translation.h:35
EIGEN_DEVICE_FUNC const VectorType & vector() const
Definition Translation.h:87

Constructor & Destructor Documentation

◆ Translation() [1/5]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Eigen::Translation< _Scalar, _Dim >::Translation ( )
inline

Default constructor without initialization.

54{}

Referenced by Eigen::Translation< _Scalar, _Dim >::Identity(), Eigen::Translation< _Scalar, _Dim >::inverse(), and Eigen::Translation< _Scalar, _Dim >::operator*().

+ Here is the caller graph for this function:

◆ Translation() [2/5]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Eigen::Translation< _Scalar, _Dim >::Translation ( const Scalar sx,
const Scalar sy 
)
inline
57 {
58 eigen_assert(Dim==2);
59 m_coeffs.x() = sx;
60 m_coeffs.y() = sy;
61 }
VectorType m_coeffs
Definition Translation.h:49

References Eigen::Translation< _Scalar, _Dim >::Dim, eigen_assert, and Eigen::Translation< _Scalar, _Dim >::m_coeffs.

◆ Translation() [3/5]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Eigen::Translation< _Scalar, _Dim >::Translation ( const Scalar sx,
const Scalar sy,
const Scalar sz 
)
inline

◆ Translation() [4/5]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Eigen::Translation< _Scalar, _Dim >::Translation ( const VectorType vector)
inlineexplicit

Constructs and initialize the translation transformation from a vector of translation coefficients

71: m_coeffs(vector) {}

◆ Translation() [5/5]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Eigen::Translation< _Scalar, _Dim >::Translation ( const Translation< OtherScalarType, Dim > &  other)
inlineexplicit

Copy constructor with scalar type conversion

161 { m_coeffs = other.vector().template cast<Scalar>(); }

References Eigen::Translation< _Scalar, _Dim >::m_coeffs, and Eigen::Translation< _Scalar, _Dim >::vector().

+ Here is the call graph for this function:

Member Function Documentation

◆ cast()

template<typename _Scalar , int _Dim>
template<typename NewScalarType >
EIGEN_DEVICE_FUNC internal::cast_return_type< Translation, Translation< NewScalarType, Dim > >::type Eigen::Translation< _Scalar, _Dim >::cast ( ) const
inline
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

156 { return typename internal::cast_return_type<Translation,Translation<NewScalarType,Dim> >::type(*this); }

◆ Identity()

template<typename _Scalar , int _Dim>
static const Translation Eigen::Translation< _Scalar, _Dim >::Identity ( )
inlinestatic
147{ return Translation(VectorType::Zero()); }
EIGEN_DEVICE_FUNC Translation()
Definition Translation.h:54

References Eigen::Translation< _Scalar, _Dim >::Translation().

+ Here is the call graph for this function:

◆ inverse()

template<typename _Scalar , int _Dim>
Translation Eigen::Translation< _Scalar, _Dim >::inverse ( ) const
inline
Returns
the inverse translation (opposite)
139{ return Translation(-m_coeffs); }

References Eigen::Translation< _Scalar, _Dim >::Translation(), and Eigen::Translation< _Scalar, _Dim >::m_coeffs.

+ Here is the call graph for this function:

◆ isApprox()

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC bool Eigen::Translation< _Scalar, _Dim >::isApprox ( const Translation< _Scalar, _Dim > &  other,
const typename NumTraits< Scalar >::Real &  prec = NumTraits<Scalar>::dummy_precision() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()
168 { return m_coeffs.isApprox(other.m_coeffs, prec); }

References Eigen::Translation< _Scalar, _Dim >::m_coeffs, and Eigen::Translation< _Scalar, _Dim >::vector().

+ Here is the call graph for this function:

◆ operator*() [1/6]

Concatenates a translation and a linear transformation

196{
198 res.matrix().setZero();
199 res.linear() = linear.derived();
200 res.translation() = m_coeffs;
201 res.matrix().row(Dim).setZero();
202 res(Dim,Dim) = Scalar(1);
203 return res;
204}
Transform< Scalar, Dim, Affine > AffineTransformType
Definition Translation.h:43
_Scalar Scalar
Definition Translation.h:37

References Eigen::EigenBase< Derived >::derived(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::matrix(), Eigen::PlainObjectBase< Derived >::setZero(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translation().

+ Here is the call graph for this function:

◆ operator*() [2/6]

template<typename _Scalar , int _Dim>
template<typename Derived >
internal::enable_if< Derived::IsVectorAtCompileTime, VectorType >::type Eigen::Translation< _Scalar, _Dim >::operator* ( const MatrixBase< Derived > &  vec) const
inline

Applies translation to vector

136 { return m_coeffs + vec.derived(); }

References Eigen::Translation< _Scalar, _Dim >::m_coeffs.

◆ operator*() [3/6]

template<typename _Scalar , int _Dim>
template<typename Derived >
EIGEN_DEVICE_FUNC IsometryTransformType Eigen::Translation< _Scalar, _Dim >::operator* ( const RotationBase< Derived, Dim > &  r) const
inline

Concatenates a translation and a rotation

107 { return *this * IsometryTransformType(r); }
Transform< Scalar, Dim, Isometry > IsometryTransformType
Definition Translation.h:45

◆ operator*() [4/6]

template<typename _Scalar , int _Dim>
template<int Mode, int Options>
EIGEN_DEVICE_FUNC Transform< Scalar, Dim, Mode > Eigen::Translation< _Scalar, _Dim >::operator* ( const Transform< Scalar, Dim, Mode, Options > &  t) const
inline

Concatenates a translation and a transformation

126 {
128 res.pretranslate(m_coeffs);
129 return res;
130 }

References Eigen::Translation< _Scalar, _Dim >::m_coeffs, and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::pretranslate().

+ Here is the call graph for this function:

◆ operator*() [5/6]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Translation Eigen::Translation< _Scalar, _Dim >::operator* ( const Translation< _Scalar, _Dim > &  other) const
inline

Concatenates two translation

95 { return Translation(m_coeffs + other.m_coeffs); }

References Eigen::Translation< _Scalar, _Dim >::Translation(), and Eigen::Translation< _Scalar, _Dim >::m_coeffs.

+ Here is the call graph for this function:

◆ operator*() [6/6]

Concatenates a translation and a uniform scaling

183{
185 res.matrix().setZero();
186 res.linear().diagonal().fill(other.factor());
187 res.translation() = m_coeffs;
188 res(Dim,Dim) = Scalar(1);
189 return res;
190}

References Eigen::UniformScaling< _Scalar >::factor(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::linear(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::matrix(), Eigen::PlainObjectBase< Derived >::setZero(), and Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::translation().

+ Here is the call graph for this function:

◆ operator=()

template<typename _Scalar , int _Dim>
Translation & Eigen::Translation< _Scalar, _Dim >::operator= ( const Translation< _Scalar, _Dim > &  other)
inline
142 {
143 m_coeffs = other.m_coeffs;
144 return *this;
145 }

References Eigen::Translation< _Scalar, _Dim >::m_coeffs.

◆ translation() [1/2]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC VectorType & Eigen::Translation< _Scalar, _Dim >::translation ( )
inline

◆ translation() [2/2]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC const VectorType & Eigen::Translation< _Scalar, _Dim >::translation ( ) const
inline

◆ vector() [1/2]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC VectorType & Eigen::Translation< _Scalar, _Dim >::vector ( )
inline

◆ vector() [2/2]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC const VectorType & Eigen::Translation< _Scalar, _Dim >::vector ( ) const
inline

◆ x() [1/2]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Scalar & Eigen::Translation< _Scalar, _Dim >::x ( )
inline

Retruns the x-translation as a reference.

81{ return m_coeffs.x(); }

References Eigen::Translation< _Scalar, _Dim >::m_coeffs.

◆ x() [2/2]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Scalar Eigen::Translation< _Scalar, _Dim >::x ( ) const
inline

Retruns the x-translation by value.

74{ return m_coeffs.x(); }

References Eigen::Translation< _Scalar, _Dim >::m_coeffs.

◆ y() [1/2]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Scalar & Eigen::Translation< _Scalar, _Dim >::y ( )
inline

Retruns the y-translation as a reference.

83{ return m_coeffs.y(); }

References Eigen::Translation< _Scalar, _Dim >::m_coeffs.

◆ y() [2/2]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Scalar Eigen::Translation< _Scalar, _Dim >::y ( ) const
inline

Retruns the y-translation by value.

76{ return m_coeffs.y(); }

References Eigen::Translation< _Scalar, _Dim >::m_coeffs.

◆ z() [1/2]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Scalar & Eigen::Translation< _Scalar, _Dim >::z ( )
inline

Retruns the z-translation as a reference.

85{ return m_coeffs.z(); }

References Eigen::Translation< _Scalar, _Dim >::m_coeffs.

◆ z() [2/2]

template<typename _Scalar , int _Dim>
EIGEN_DEVICE_FUNC Scalar Eigen::Translation< _Scalar, _Dim >::z ( ) const
inline

Retruns the z-translation by value.

78{ return m_coeffs.z(); }

References Eigen::Translation< _Scalar, _Dim >::m_coeffs.

Friends And Related Symbol Documentation

◆ operator*

template<typename _Scalar , int _Dim>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC AffineTransformType operator* ( const EigenBase< OtherDerived > &  linear,
const Translation< _Scalar, _Dim > &  t 
)
friend
Returns
the concatenation of a linear transformation l with the translation t
113 {
115 res.matrix().setZero();
116 res.linear() = linear.derived();
117 res.translation() = linear.derived() * t.m_coeffs;
118 res.matrix().row(Dim).setZero();
119 res(Dim,Dim) = Scalar(1);
120 return res;
121 }

Member Data Documentation

◆ m_coeffs

Typedef Documentation

◆ Affine2d

◆ Affine2f

◆ Affine3d

◆ Affine3f

◆ AffineCompact2d

◆ AffineCompact2f

◆ AffineCompact3d

◆ AffineCompact3f

◆ AngleAxisd

typedef AngleAxis<double> Eigen::AngleAxisd

#include <src/eigen/Eigen/src/Geometry/AngleAxis.h>

double precision angle-axis type

◆ AngleAxisf

typedef AngleAxis<float> Eigen::AngleAxisf

#include <src/eigen/Eigen/src/Geometry/AngleAxis.h>

single precision angle-axis type

◆ Isometry2d

◆ Isometry2f

◆ Isometry3d

◆ Isometry3f

◆ Projective2d

◆ Projective2f

◆ Projective3d

◆ Projective3f

◆ Quaterniond

typedef Quaternion<double> Eigen::Quaterniond

#include <src/eigen/Eigen/src/Geometry/Quaternion.h>

double precision quaternion type

◆ Quaternionf

#include <src/eigen/Eigen/src/Geometry/Quaternion.h>

single precision quaternion type

◆ QuaternionMapAlignedd

#include <src/eigen/Eigen/src/Geometry/Quaternion.h>

Map a 16-byte aligned array of double precision scalars as a quaternion

◆ QuaternionMapAlignedf

#include <src/eigen/Eigen/src/Geometry/Quaternion.h>

Map a 16-byte aligned array of single precision scalars as a quaternion

◆ QuaternionMapd

typedef Map<Quaternion<double>, 0> Eigen::QuaternionMapd

#include <src/eigen/Eigen/src/Geometry/Quaternion.h>

Map an unaligned array of double precision scalars as a quaternion

◆ QuaternionMapf

typedef Map<Quaternion<float>, 0> Eigen::QuaternionMapf

#include <src/eigen/Eigen/src/Geometry/Quaternion.h>

Map an unaligned array of single precision scalars as a quaternion

◆ Rotation2Dd

typedef Rotation2D<double> Eigen::Rotation2Dd

#include <src/eigen/Eigen/src/Geometry/Rotation2D.h>

double precision 2D rotation type

◆ Rotation2Df

#include <src/eigen/Eigen/src/Geometry/Rotation2D.h>

single precision 2D rotation type

Function Documentation

◆ cross() [1/2]

template<typename ExpressionType , int Direction>
template<typename OtherDerived >
EIGEN_DEVICE_FUNC const VectorwiseOp< ExpressionType, Direction >::CrossReturnType Eigen::VectorwiseOp< ExpressionType, Direction >::cross ( const MatrixBase< OtherDerived > &  other) const

#include <src/eigen/Eigen/src/Core/VectorwiseOp.h>

\geometry_module

Returns
a matrix expression of the cross product of each column or row of the referenced expression with the other vector.

The referenced matrix must have one dimension equal to 3. The result matrix has the same dimensions than the referenced one.

See also
MatrixBase::cross()
111{
113 EIGEN_STATIC_ASSERT((internal::is_same<Scalar, typename OtherDerived::Scalar>::value),
114 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
115
116 typename internal::nested_eval<ExpressionType,2>::type mat(_expression());
117 typename internal::nested_eval<OtherDerived,2>::type vec(other.derived());
118
119 CrossReturnType res(_expression().rows(),_expression().cols());
120 if(Direction==Vertical)
121 {
122 eigen_assert(CrossReturnType::RowsAtCompileTime==3 && "the matrix must have exactly 3 rows");
123 res.row(0) = (mat.row(1) * vec.coeff(2) - mat.row(2) * vec.coeff(1)).conjugate();
124 res.row(1) = (mat.row(2) * vec.coeff(0) - mat.row(0) * vec.coeff(2)).conjugate();
125 res.row(2) = (mat.row(0) * vec.coeff(1) - mat.row(1) * vec.coeff(0)).conjugate();
126 }
127 else
128 {
129 eigen_assert(CrossReturnType::ColsAtCompileTime==3 && "the matrix must have exactly 3 columns");
130 res.col(0) = (mat.col(1) * vec.coeff(2) - mat.col(2) * vec.coeff(1)).conjugate();
131 res.col(1) = (mat.col(2) * vec.coeff(0) - mat.col(0) * vec.coeff(2)).conjugate();
132 res.col(2) = (mat.col(0) * vec.coeff(1) - mat.col(1) * vec.coeff(0)).conjugate();
133 }
134 return res;
135}
EIGEN_DEVICE_FUNC const ExpressionType & _expression() const
Definition VectorwiseOp.h:259
ExpressionType::PlainObject CrossReturnType
Definition VectorwiseOp.h:631
ExpressionType::Scalar Scalar
Definition VectorwiseOp.h:160

References conjugate(), eigen_assert, EIGEN_STATIC_ASSERT, EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::Vertical.

+ Here is the call graph for this function:

◆ cross() [2/2]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC MatrixBase< Derived >::template cross_product_return_type< OtherDerived >::type Eigen::MatrixBase< Derived >::cross ( const MatrixBase< OtherDerived > &  other) const
inline

#include <src/eigen/Eigen/src/Geometry/OrthoMethods.h>

\geometry_module

Returns
the cross product of *this and other

Here is a very good explanation of cross-product: http://xkcd.com/199/

With complex numbers, the cross product is implemented as $ (\mathbf{a}+i\mathbf{b}) \times (\mathbf{c}+i\mathbf{d}) = (\mathbf{a} \times \mathbf{c} - \mathbf{b} \times \mathbf{d}) - i(\mathbf{a} \times \mathbf{d} - \mathbf{b} \times \mathbf{c})$

See also
MatrixBase::cross3()
35{
38
39 // Note that there is no need for an expression here since the compiler
40 // optimize such a small temporary very well (even within a complex expression)
41 typename internal::nested_eval<Derived,2>::type lhs(derived());
42 typename internal::nested_eval<OtherDerived,2>::type rhs(other.derived());
43 return typename cross_product_return_type<OtherDerived>::type(
44 numext::conj(lhs.coeff(1) * rhs.coeff(2) - lhs.coeff(2) * rhs.coeff(1)),
45 numext::conj(lhs.coeff(2) * rhs.coeff(0) - lhs.coeff(0) * rhs.coeff(2)),
46 numext::conj(lhs.coeff(0) * rhs.coeff(1) - lhs.coeff(1) * rhs.coeff(0))
47 );
48}

References EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE.

◆ cross3()

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC MatrixBase< Derived >::PlainObject Eigen::MatrixBase< Derived >::cross3 ( const MatrixBase< OtherDerived > &  other) const
inline

#include <src/eigen/Eigen/src/Core/MatrixBase.h>

\geometry_module

Returns
the cross product of *this and other using only the x, y, and z coefficients

The size of *this and other must be four. This function is especially useful when using 4D vectors instead of 3D ones to get advantage of SSE/AltiVec vectorization.

See also
MatrixBase::cross()
83{
86
87 typedef typename internal::nested_eval<Derived,2>::type DerivedNested;
88 typedef typename internal::nested_eval<OtherDerived,2>::type OtherDerivedNested;
89 DerivedNested lhs(derived());
90 OtherDerivedNested rhs(other.derived());
91
92 return internal::cross3_impl<Architecture::Target,
93 typename internal::remove_all<DerivedNested>::type,
94 typename internal::remove_all<OtherDerivedNested>::type>::run(lhs,rhs);
95}

References EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::Architecture::Target.

◆ eulerAngles()

template<typename Derived >
EIGEN_DEVICE_FUNC Matrix< typename MatrixBase< Derived >::Scalar, 3, 1 > Eigen::MatrixBase< Derived >::eulerAngles ( Index  a0,
Index  a1,
Index  a2 
) const
inline

#include <src/eigen/Eigen/src/Core/MatrixBase.h>

\geometry_module

Returns
the Euler-angles of the rotation matrix *this using the convention defined by the triplet (a0,a1,a2)

Each of the three parameters a0,a1,a2 represents the respective rotation axis as an integer in {0,1,2}. For instance, in:

Vector3f ea = mat.eulerAngles(2, 0, 2);

"2" represents the z axis and "0" the x axis, etc. The returned angles are such that we have the following equality:

mat == AngleAxisf(ea[0], Vector3f::UnitZ())
* AngleAxisf(ea[1], Vector3f::UnitX())
* AngleAxisf(ea[2], Vector3f::UnitZ());

This corresponds to the right-multiply conventions (with right hand side frames).

The returned angles are in the ranges [0:pi]x[-pi:pi]x[-pi:pi].

See also
class AngleAxis
38{
39 EIGEN_USING_STD_MATH(atan2)
40 EIGEN_USING_STD_MATH(sin)
41 EIGEN_USING_STD_MATH(cos)
42 /* Implemented from Graphics Gems IV */
44
45 Matrix<Scalar,3,1> res;
46 typedef Matrix<typename Derived::Scalar,2,1> Vector2;
47
48 const Index odd = ((a0+1)%3 == a1) ? 0 : 1;
49 const Index i = a0;
50 const Index j = (a0 + 1 + odd)%3;
51 const Index k = (a0 + 2 - odd)%3;
52
53 if (a0==a2)
54 {
55 res[0] = atan2(coeff(j,i), coeff(k,i));
56 if((odd && res[0]<Scalar(0)) || ((!odd) && res[0]>Scalar(0)))
57 {
58 if(res[0] > Scalar(0)) {
59 res[0] -= Scalar(EIGEN_PI);
60 }
61 else {
62 res[0] += Scalar(EIGEN_PI);
63 }
64 Scalar s2 = Vector2(coeff(j,i), coeff(k,i)).norm();
65 res[1] = -atan2(s2, coeff(i,i));
66 }
67 else
68 {
69 Scalar s2 = Vector2(coeff(j,i), coeff(k,i)).norm();
70 res[1] = atan2(s2, coeff(i,i));
71 }
72
73 // With a=(0,1,0), we have i=0; j=1; k=2, and after computing the first two angles,
74 // we can compute their respective rotation, and apply its inverse to M. Since the result must
75 // be a rotation around x, we have:
76 //
77 // c2 s1.s2 c1.s2 1 0 0
78 // 0 c1 -s1 * M = 0 c3 s3
79 // -s2 s1.c2 c1.c2 0 -s3 c3
80 //
81 // Thus: m11.c1 - m21.s1 = c3 & m12.c1 - m22.s1 = s3
82
83 Scalar s1 = sin(res[0]);
84 Scalar c1 = cos(res[0]);
85 res[2] = atan2(c1*coeff(j,k)-s1*coeff(k,k), c1*coeff(j,j) - s1 * coeff(k,j));
86 }
87 else
88 {
89 res[0] = atan2(coeff(j,k), coeff(k,k));
90 Scalar c2 = Vector2(coeff(i,i), coeff(i,j)).norm();
91 if((odd && res[0]<Scalar(0)) || ((!odd) && res[0]>Scalar(0))) {
92 if(res[0] > Scalar(0)) {
93 res[0] -= Scalar(EIGEN_PI);
94 }
95 else {
96 res[0] += Scalar(EIGEN_PI);
97 }
98 res[1] = atan2(-coeff(i,k), -c2);
99 }
100 else
101 res[1] = atan2(-coeff(i,k), c2);
102 Scalar s1 = sin(res[0]);
103 Scalar c1 = cos(res[0]);
104 res[2] = atan2(s1*coeff(k,i)-c1*coeff(j,i), c1*coeff(j,j) - s1 * coeff(k,j));
105 }
106 if (!odd)
107 res = -res;
108
109 return res;
110}

References cos(), EIGEN_PI, EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE, and sin().

+ Here is the call graph for this function:

◆ hnormalized() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC const MatrixBase< Derived >::HNormalizedReturnType Eigen::MatrixBase< Derived >::hnormalized
inline

#include <src/eigen/Eigen/src/Core/MatrixBase.h>

homogeneous normalization

\geometry_module

Returns
a vector expression of the N-1 first coefficients of *this divided by that last coefficient.

This can be used to convert homogeneous coordinates to affine coordinates.

It is essentially a shortcut for:

this->head(this->size()-1)/this->coeff(this->size()-1);

Example:

Output:

See also
VectorwiseOp::hnormalized()
173{
175 return ConstStartMinusOne(derived(),0,0,
176 ColsAtCompileTime==1?size()-1:1,
177 ColsAtCompileTime==1?1:size()-1) / coeff(size()-1);
178}

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ hnormalized() [2/2]

template<typename ExpressionType , int Direction>
EIGEN_DEVICE_FUNC const VectorwiseOp< ExpressionType, Direction >::HNormalizedReturnType Eigen::VectorwiseOp< ExpressionType, Direction >::hnormalized
inline

#include <src/eigen/Eigen/src/Core/VectorwiseOp.h>

column or row-wise homogeneous normalization

\geometry_module

Returns
an expression of the first N-1 coefficients of each column (or row) of *this divided by the last coefficient of each column (or row).

This can be used to convert homogeneous coordinates to affine coordinates.

It is conceptually equivalent to calling MatrixBase::hnormalized() to each column (or row) of *this.

Example:

Output:

See also
MatrixBase::hnormalized()
197{
198 return HNormalized_Block(_expression(),0,0,
199 Direction==Vertical ? _expression().rows()-1 : _expression().rows(),
201 Replicate<HNormalized_Factors,
209 Direction==Vertical ? _expression().rows()-1 : 1,
210 Direction==Horizontal ? _expression().cols()-1 : 1));
211}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const Derived, const OtherDerived > cwiseQuotient(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
Definition MatrixCwiseBinaryOps.h:131
Block< const ExpressionType, Direction==Vertical ? int(HNormalized_SizeMinusOne) :int(internal::traits< ExpressionType >::RowsAtCompileTime), Direction==Horizontal ? int(HNormalized_SizeMinusOne) :int(internal::traits< ExpressionType >::ColsAtCompileTime)> HNormalized_Block
Definition VectorwiseOp.h:646
@ HNormalized_SizeMinusOne
Definition VectorwiseOp.h:639
Block< const ExpressionType, Direction==Vertical ? 1 :int(internal::traits< ExpressionType >::RowsAtCompileTime), Direction==Horizontal ? 1 :int(internal::traits< ExpressionType >::ColsAtCompileTime)> HNormalized_Factors
Definition VectorwiseOp.h:650
Direction
Definition clipper.cpp:67

References cwiseQuotient(), Eigen::Horizontal, and Eigen::Vertical.

+ Here is the call graph for this function:

◆ homogeneous() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC MatrixBase< Derived >::HomogeneousReturnType Eigen::MatrixBase< Derived >::homogeneous
inline

#include <src/eigen/Eigen/src/Core/MatrixBase.h>

\geometry_module

Returns
a vector expression that is one longer than the vector argument, with the value 1 symbolically appended as the last coefficient.

This can be used to convert affine coordinates to homogeneous coordinates.

\only_for_vectors

Example:

Output:

See also
VectorwiseOp::homogeneous(), class Homogeneous
131{
133 return HomogeneousReturnType(derived());
134}

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ homogeneous() [2/2]

template<typename ExpressionType , int Direction>
EIGEN_DEVICE_FUNC Homogeneous< ExpressionType, Direction > Eigen::VectorwiseOp< ExpressionType, Direction >::homogeneous
inline

#include <src/eigen/Eigen/src/Core/VectorwiseOp.h>

\geometry_module

Returns
an expression where the value 1 is symbolically appended as the final coefficient to each column (or row) of the matrix.

This can be used to convert affine coordinates to homogeneous coordinates.

Example:

Output:

See also
MatrixBase::homogeneous(), class Homogeneous
149{
151}
Homogeneous< ExpressionType, Direction > HomogeneousReturnType
Definition VectorwiseOp.h:627

◆ umeyama()

template<typename Derived , typename OtherDerived >
internal::umeyama_transform_matrix_type< Derived, OtherDerived >::type Eigen::umeyama ( const MatrixBase< Derived > &  src,
const MatrixBase< OtherDerived > &  dst,
bool  with_scaling = true 
)

#include <src/eigen/Eigen/src/Geometry/Umeyama.h>

Returns the transformation between two point sets.

\geometry_module

The algorithm is based on: "Least-squares estimation of transformation parameters between two point patterns", Shinji Umeyama, PAMI 1991, DOI: 10.1109/34.88573

It estimates parameters $ c, \mathbf{R}, $ and $ \mathbf{t} $ such that

\begin{align*}
  \frac{1}{n} \sum_{i=1}^n \vert\vert y_i - (c\mathbf{R}x_i + \mathbf{t}) \vert\vert_2^2
\end{align*}

is minimized.

The algorithm is based on the analysis of the covariance matrix $ \Sigma_{\mathbf{x}\mathbf{y}} \in \mathbb{R}^{d \times d} $ of the input point sets $ \mathbf{x} $ and $ \mathbf{y} $ where $d$ is corresponding to the dimension (which is typically small). The analysis is involving the SVD having a complexity of $O(d^3)$ though the actual computational effort lies in the covariance matrix computation which has an asymptotic lower bound of $O(dm)$ when the input point sets have dimension $d \times m$.

Currently the method is working only for floating point matrices.

Parameters
srcSource points $ \mathbf{x} = \left( x_1, \hdots, x_n \right) $.
dstDestination points $ \mathbf{y} = \left( y_1, \hdots, y_n \right) $.
with_scalingSets $ c=1 $ when false is passed.
Returns
The homogeneous transformation

\begin{align*}
  T = \begin{bmatrix} c\mathbf{R} & \mathbf{t} \\ \mathbf{0} & 1 \end{bmatrix}
\end{align*}

minimizing the resudiual above. This transformation is always returned as an Eigen::Matrix.
96{
97 typedef typename internal::umeyama_transform_matrix_type<Derived, OtherDerived>::type TransformationMatrixType;
98 typedef typename internal::traits<TransformationMatrixType>::Scalar Scalar;
99 typedef typename NumTraits<Scalar>::Real RealScalar;
100
101 EIGEN_STATIC_ASSERT(!NumTraits<Scalar>::IsComplex, NUMERIC_TYPE_MUST_BE_REAL)
102 EIGEN_STATIC_ASSERT((internal::is_same<Scalar, typename internal::traits<OtherDerived>::Scalar>::value),
103 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
104
105 enum { Dimension = EIGEN_SIZE_MIN_PREFER_DYNAMIC(Derived::RowsAtCompileTime, OtherDerived::RowsAtCompileTime) };
106
107 typedef Matrix<Scalar, Dimension, 1> VectorType;
108 typedef Matrix<Scalar, Dimension, Dimension> MatrixType;
109 typedef typename internal::plain_matrix_type_row_major<Derived>::type RowMajorMatrixType;
110
111 const Index m = src.rows(); // dimension
112 const Index n = src.cols(); // number of measurements
113
114 // required for demeaning ...
115 const RealScalar one_over_n = RealScalar(1) / static_cast<RealScalar>(n);
116
117 // computation of mean
118 const VectorType src_mean = src.rowwise().sum() * one_over_n;
119 const VectorType dst_mean = dst.rowwise().sum() * one_over_n;
120
121 // demeaning of src and dst points
122 const RowMajorMatrixType src_demean = src.colwise() - src_mean;
123 const RowMajorMatrixType dst_demean = dst.colwise() - dst_mean;
124
125 // Eq. (36)-(37)
126 const Scalar src_var = src_demean.rowwise().squaredNorm().sum() * one_over_n;
127
128 // Eq. (38)
129 const MatrixType sigma = one_over_n * dst_demean * src_demean.transpose();
130
131 JacobiSVD<MatrixType> svd(sigma, ComputeFullU | ComputeFullV);
132
133 // Initialize the resulting transformation with an identity matrix...
134 TransformationMatrixType Rt = TransformationMatrixType::Identity(m+1,m+1);
135
136 // Eq. (39)
137 VectorType S = VectorType::Ones(m);
138
139 if ( svd.matrixU().determinant() * svd.matrixV().determinant() < 0 )
140 S(m-1) = -1;
141
142 // Eq. (40) and (43)
143 Rt.block(0,0,m,m).noalias() = svd.matrixU() * S.asDiagonal() * svd.matrixV().transpose();
144
145 if (with_scaling)
146 {
147 // Eq. (42)
148 const Scalar c = Scalar(1)/src_var * svd.singularValues().dot(S);
149
150 // Eq. (41)
151 Rt.col(m).head(m) = dst_mean;
152 Rt.col(m).head(m).noalias() -= c*Rt.topLeftCorner(m,m)*src_mean;
153 Rt.block(0,0,m,m) *= c;
154 }
155 else
156 {
157 Rt.col(m).head(m) = dst_mean;
158 Rt.col(m).head(m).noalias() -= Rt.topLeftCorner(m,m)*src_mean;
159 }
160
161 return Rt;
162}
#define EIGEN_SIZE_MIN_PREFER_DYNAMIC(a, b)
Definition Macros.h:881

References Eigen::DenseBase< Derived >::colwise(), Eigen::ComputeFullU, Eigen::ComputeFullV, EIGEN_SIZE_MIN_PREFER_DYNAMIC, EIGEN_STATIC_ASSERT, Eigen::SVDBase< Derived >::matrixU(), Eigen::SVDBase< Derived >::matrixV(), Eigen::DenseBase< Derived >::rowwise(), Eigen::SVDBase< Derived >::singularValues(), and Eigen::VectorwiseOp< ExpressionType, Direction >::sum().

+ Here is the call graph for this function:

◆ unitOrthogonal()

template<typename Derived >
EIGEN_DEVICE_FUNC MatrixBase< Derived >::PlainObject Eigen::MatrixBase< Derived >::unitOrthogonal ( void  ) const
inline

#include <src/eigen/Eigen/src/Core/MatrixBase.h>

\geometry_module

Returns
a unit vector which is orthogonal to *this

The size of *this must be at least 2. If the size is exactly 2, then the returned vector is a counter clock wise rotation of *this, i.e., (-y,x).normalized().

See also
cross()
227{
230}
static EIGEN_DEVICE_FUNC VectorType run(const Derived &src)
Definition OrthoMethods.h:147

References EIGEN_STATIC_ASSERT_VECTOR_ONLY, and Eigen::internal::unitOrthogonal_selector< Derived, Size >::run().

+ Here is the call graph for this function: