mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Explicit type casting
This commit is contained in:
parent
8d81a2339c
commit
a32e6a4047
@ -82,8 +82,8 @@ template<typename Derived> struct determinant_impl<Derived, 4>
|
||||
Scalar d3_1 = det3(m, 0,d2_23, 2,d2_03, 3,d2_02);
|
||||
Scalar d3_2 = det3(m, 0,d2_13, 1,d2_03, 3,d2_01);
|
||||
Scalar d3_3 = det3(m, 0,d2_12, 1,d2_02, 2,d2_01);
|
||||
return internal::pmadd(-m(0,3),d3_0, m(1,3)*d3_1) +
|
||||
internal::pmadd(-m(2,3),d3_2, m(3,3)*d3_3);
|
||||
return internal::pmadd(static_cast<Scalar>(-m(0,3)),d3_0, static_cast<Scalar>(m(1,3)*d3_1)) +
|
||||
internal::pmadd(static_cast<Scalar>(-m(2,3)),d3_2, static_cast<Scalar>(m(3,3)*d3_3));
|
||||
}
|
||||
protected:
|
||||
static EIGEN_DEVICE_FUNC
|
||||
@ -95,7 +95,7 @@ protected:
|
||||
static EIGEN_DEVICE_FUNC
|
||||
Scalar det3(const Derived& m, Index i0, const Scalar& d0, Index i1, const Scalar& d1, Index i2, const Scalar& d2)
|
||||
{
|
||||
return internal::pmadd(m(i0,2), d0, internal::pmadd(-m(i1,2), d1, m(i2,2)*d2));
|
||||
return internal::pmadd(m(i0,2), d0, internal::pmadd(static_cast<Scalar>(-m(i1,2)), d1, static_cast<Scalar>(m(i2,2)*d2)));
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user