Lines Matching refs:Scalar
43 typedef typename internal::traits<Derived>::Scalar Scalar; typedef
44 typedef typename NumTraits<Scalar>::Real RealScalar;
52 typedef Matrix<Scalar,3,1> Vector3;
54 typedef Matrix<Scalar,3,3> Matrix3;
56 typedef AngleAxis<Scalar> AngleAxisType;
61 EIGEN_DEVICE_FUNC inline Scalar x() const { return this->derived().coeffs().coeff(0); } in x()
63 EIGEN_DEVICE_FUNC inline Scalar y() const { return this->derived().coeffs().coeff(1); } in y()
65 EIGEN_DEVICE_FUNC inline Scalar z() const { return this->derived().coeffs().coeff(2); } in z()
67 EIGEN_DEVICE_FUNC inline Scalar w() const { return this->derived().coeffs().coeff(3); } in w()
70 EIGEN_DEVICE_FUNC inline Scalar& x() { return this->derived().coeffs().coeffRef(0); } in x()
72 EIGEN_DEVICE_FUNC inline Scalar& y() { return this->derived().coeffs().coeffRef(1); } in y()
74 EIGEN_DEVICE_FUNC inline Scalar& z() { return this->derived().coeffs().coeffRef(2); } in z()
76 EIGEN_DEVICE_FUNC inline Scalar& w() { return this->derived().coeffs().coeffRef(3); } in w()
106 …CE_FUNC static inline Quaternion<Scalar> Identity() { return Quaternion<Scalar>(Scalar(1), Scalar(… in Identity()
110 …_FUNC inline QuaternionBase& setIdentity() { coeffs() << Scalar(0), Scalar(0), Scalar(0), Scalar(1… in setIdentity()
115 EIGEN_DEVICE_FUNC inline Scalar squaredNorm() const { return coeffs().squaredNorm(); } in squaredNorm()
120 EIGEN_DEVICE_FUNC inline Scalar norm() const { return coeffs().norm(); } in norm()
127 …EIGEN_DEVICE_FUNC inline Quaternion<Scalar> normalized() const { return Quaternion<Scalar>(coeffs(… in normalized()
134 …template<class OtherDerived> EIGEN_DEVICE_FUNC inline Scalar dot(const QuaternionBase<OtherDerived… in dot()
136 …template<class OtherDerived> EIGEN_DEVICE_FUNC Scalar angularDistance(const QuaternionBase<OtherDe…
145 …template<class OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion<Scalar> operator* (c…
149 EIGEN_DEVICE_FUNC Quaternion<Scalar> inverse() const;
152 EIGEN_DEVICE_FUNC Quaternion<Scalar> conjugate() const;
154 …template<class OtherDerived> EIGEN_DEVICE_FUNC Quaternion<Scalar> slerp(const Scalar& t, const Qua…
161 … QuaternionBase<OtherDerived>& other, const RealScalar& prec = NumTraits<Scalar>::dummy_precision(…
217 typedef _Scalar Scalar;
233 typedef _Scalar Scalar;
251 …EIGEN_DEVICE_FUNC inline Quaternion(const Scalar& w, const Scalar& x, const Scalar& y, const Scala…
254 EIGEN_DEVICE_FUNC explicit inline Quaternion(const Scalar* data) : m_coeffs(data) {}
272 { m_coeffs = other.coeffs().template cast<Scalar>(); }
349 typedef _Scalar Scalar;
360 EIGEN_DEVICE_FUNC explicit EIGEN_STRONG_INLINE Map(const Scalar* coeffs) : m_coeffs(coeffs) {}
386 typedef _Scalar Scalar;
397 EIGEN_DEVICE_FUNC explicit EIGEN_STRONG_INLINE Map(Scalar* coeffs) : m_coeffs(coeffs) {}
426 template<int Arch, class Derived1, class Derived2, typename Scalar> struct quat_product
428 …EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Quaternion<Scalar> run(const QuaternionBase<Derived1>…
429 return Quaternion<Scalar>
443 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Quaternion<typename internal::traits<Derived>::Scalar>
446 …EIGEN_STATIC_ASSERT((internal::is_same<typename Derived::Scalar, typename OtherDerived::Scalar>::v…
449 typename internal::traits<Derived>::Scalar>::run(*this, other);
504 Scalar ha = Scalar(0.5)*aa.angle(); // Scalar(0.5) to suppress precision loss warnings
520 …EIGEN_STATIC_ASSERT((internal::is_same<typename Derived::Scalar, typename MatrixDerived::Scalar>::…
539 const Scalar tx = Scalar(2)*this->x();
540 const Scalar ty = Scalar(2)*this->y();
541 const Scalar tz = Scalar(2)*this->z();
542 const Scalar twx = tx*this->w();
543 const Scalar twy = ty*this->w();
544 const Scalar twz = tz*this->w();
545 const Scalar txx = tx*this->x();
546 const Scalar txy = ty*this->x();
547 const Scalar txz = tz*this->x();
548 const Scalar tyy = ty*this->y();
549 const Scalar tyz = tz*this->y();
550 const Scalar tzz = tz*this->z();
552 res.coeffRef(0,0) = Scalar(1)-(tyy+tzz);
556 res.coeffRef(1,1) = Scalar(1)-(txx+tzz);
560 res.coeffRef(2,2) = Scalar(1)-(txx+tyy);
582 Scalar c = v1.dot(v0);
592 if (c < Scalar(-1)+NumTraits<Scalar>::dummy_precision())
594 c = numext::maxi(c,Scalar(-1));
595 Matrix<Scalar,2,3> m; m << v0.transpose(), v1.transpose();
596 JacobiSVD<Matrix<Scalar,2,3> > svd(m, ComputeFullV);
599 Scalar w2 = (Scalar(1)+c)*Scalar(0.5);
601 this->vec() = axis * sqrt(Scalar(1) - w2);
605 Scalar s = sqrt((Scalar(1)+c)*Scalar(2));
606 Scalar invs = Scalar(1)/s;
608 this->w() = s * Scalar(0.5);
617 template<typename Scalar, int Options>
618 EIGEN_DEVICE_FUNC Quaternion<Scalar,Options> Quaternion<Scalar,Options>::UnitRandom()
623 const Scalar u1 = internal::random<Scalar>(0, 1),
624 u2 = internal::random<Scalar>(0, 2*EIGEN_PI),
625 u3 = internal::random<Scalar>(0, 2*EIGEN_PI);
626 const Scalar a = sqrt(1 - u1),
642 template<typename Scalar, int Options>
644 EIGEN_DEVICE_FUNC Quaternion<Scalar,Options> Quaternion<Scalar,Options>::FromTwoVectors(const Matri…
659 EIGEN_DEVICE_FUNC inline Quaternion<typename internal::traits<Derived>::Scalar> QuaternionBase<Deri…
662 Scalar n2 = this->squaredNorm();
663 if (n2 > Scalar(0))
664 return Quaternion<Scalar>(conjugate().coeffs() / n2);
668 return Quaternion<Scalar>(Coefficients::Zero());
674 template<int Arch, class Derived, typename Scalar> struct quat_conj
676 …EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Quaternion<Scalar> run(const QuaternionBase<Derived>&…
677 return Quaternion<Scalar>(q.w(),-q.x(),-q.y(),-q.z());
689 EIGEN_DEVICE_FUNC inline Quaternion<typename internal::traits<Derived>::Scalar>
693 typename internal::traits<Derived>::Scalar>::run(*this);
702 EIGEN_DEVICE_FUNC inline typename internal::traits<Derived>::Scalar
706 Quaternion<Scalar> d = (*this) * other.conjugate();
707 return Scalar(2) * atan2( d.vec().norm(), numext::abs(d.w()) );
720 EIGEN_DEVICE_FUNC Quaternion<typename internal::traits<Derived>::Scalar>
721 QuaternionBase<Derived>::slerp(const Scalar& t, const QuaternionBase<OtherDerived>& other) const
725 const Scalar one = Scalar(1) - NumTraits<Scalar>::epsilon();
726 Scalar d = this->dot(other);
727 Scalar absD = numext::abs(d);
729 Scalar scale0;
730 Scalar scale1;
734 scale0 = Scalar(1) - t;
740 Scalar theta = acos(absD);
741 Scalar sinTheta = sin(theta);
743 scale0 = sin( ( Scalar(1) - t ) * theta) / sinTheta;
746 if(d<Scalar(0)) scale1 = -scale1;
748 return Quaternion<Scalar>(scale0 * coeffs() + scale1 * other.coeffs());
757 typedef typename Other::Scalar Scalar;
764 Scalar t = mat.trace();
765 if (t > Scalar(0))
767 t = sqrt(t + Scalar(1.0));
768 q.w() = Scalar(0.5)*t;
769 t = Scalar(0.5)/t;
784 t = sqrt(mat.coeff(i,i)-mat.coeff(j,j)-mat.coeff(k,k) + Scalar(1.0));
785 q.coeffs().coeffRef(i) = Scalar(0.5) * t;
786 t = Scalar(0.5)/t;
798 typedef typename Other::Scalar Scalar;