10#ifndef EIGEN_SCALING_H
11#define EIGEN_SCALING_H
32template<
typename _Scalar>
50 inline const Scalar& factor()
const {
return m_factor; }
51 inline Scalar& factor() {
return m_factor; }
62 template<
int Dim,
int Mode,
int Options>
66 res.prescale(factor());
72 template<
typename Derived>
74 {
return other * m_factor; }
76 template<
typename Derived,
int Dim>
78 {
return r.toRotationMatrix() * m_factor; }
89 template<
typename NewScalarType>
94 template<
typename OtherScalarType>
96 { m_factor =
Scalar(other.factor()); }
103 {
return internal::isApprox(m_factor, other.factor(),
prec); }
110template<
typename Derived>
typename MatrixBase<Derived>::ScalarMultipleReturnType
112{
return derived() * s.factor(); }
117static inline UniformScaling<double>
Scaling(
double s) {
return UniformScaling<double>(s); }
119template<
typename RealScalar>
120static inline UniformScaling<std::complex<RealScalar> >
Scaling(
const std::complex<RealScalar>& s)
121{
return UniformScaling<std::complex<RealScalar> >(s); }
124template<
typename Scalar>
125static inline DiagonalMatrix<Scalar,2>
Scaling(
const Scalar& sx,
const Scalar& sy)
126{
return DiagonalMatrix<Scalar,2>(sx, sy); }
128template<
typename Scalar>
129static inline DiagonalMatrix<Scalar,3>
Scaling(
const Scalar& sx,
const Scalar& sy,
const Scalar& sz)
130{
return DiagonalMatrix<Scalar,3>(sx, sy, sz); }
135template<
typename Derived>
136static inline const DiagonalWrapper<const Derived>
Scaling(
const MatrixBase<Derived>& coeffs)
137{
return coeffs.asDiagonal(); }
142typedef DiagonalMatrix<float, 2> AlignedScaling2f;
144typedef DiagonalMatrix<double,2> AlignedScaling2d;
146typedef DiagonalMatrix<float, 3> AlignedScaling3f;
148typedef DiagonalMatrix<double,3> AlignedScaling3d;
151template<
typename Scalar>
153inline Transform<Scalar,Dim,Affine>
157 res.matrix().setZero();
158 res.linear().diagonal().fill(factor());
159 res.translation() = factor() * t.vector();
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Pseudo expression representing a solving operation.
Definition Solve.h:63
@ Affine
Transformation is an affine transformation stored as a (Dim+1)^2 matrix whose last row is assumed to ...
Definition Constants.h:450
@ Isometry
Transformation is an isometry.
Definition Constants.h:447
Holds information about the various numeric (i.e.
Definition NumTraits.h:108
Definition XprHelper.h:235