10 #ifndef EIGEN_EULERSYSTEM_H
11 #define EIGEN_EULERSYSTEM_H
18 template <
typename Scalar_,
class _System>
24 template <
int Num,
bool IsPositive = (Num > 0)>
31 struct Abs<Num, false>
33 enum { value = -Num };
39 enum { value = Axis != 0 && Abs<Axis>::value <= 3 };
42 template<
typename System,
44 int OtherRows=Other::RowsAtCompileTime,
45 int OtherCols=Other::ColsAtCompileTime>
46 struct eulerangles_assign_impl;
49 #define EIGEN_EULER_ANGLES_CLASS_STATIC_ASSERT(COND,MSG) typedef char static_assertion_##MSG[(COND)?1:-1]
127 template <
int _AlphaAxis,
int _BetaAxis,
int _GammaAxis>
164 ALPHA_AXIS_IS_INVALID);
167 BETA_AXIS_IS_INVALID);
170 GAMMA_AXIS_IS_INVALID);
173 ALPHA_AXIS_CANT_BE_EQUAL_TO_BETA_AXIS);
176 BETA_AXIS_CANT_BE_EQUAL_TO_GAMMA_AXIS);
188 template <
typename Derived>
194 typedef typename Derived::Scalar Scalar;
196 const Scalar plusMinus =
IsEven? 1 : -1;
197 const Scalar minusPlus =
IsOdd? 1 : -1;
207 else if(plusMinus *
mat(
I_,
K_) > 0) {
210 Scalar alphaPlusMinusGamma =
atan2(spos, cpos);
211 res[0] = alphaPlusMinusGamma;
215 Scalar sneg = plusMinus * (
mat(
K_,
J_) + minusPlus *
mat(
J_,
I_));
217 Scalar alphaMinusPlusBeta =
atan2(sneg, cneg);
218 res[0] = alphaMinusPlusBeta;
223 template <
typename Derived>
230 typedef typename Derived::Scalar Scalar;
232 const Scalar plusMinus =
IsEven? 1 : -1;
233 const Scalar minusPlus =
IsOdd? 1 : -1;
258 template<
typename Scalar>
265 std::conditional_t<IsTaitBryan, internal::true_type, internal::false_type>());
268 res.alpha() = -
res.alpha();
274 res.gamma() = -
res.gamma();
277 template <
typename Scalar_,
class _System>
284 friend struct internal::eulerangles_assign_impl;
287 #define EIGEN_EULER_SYSTEM_TYPEDEF(A, B, C) \
289 typedef EulerSystem<EULER_##A, EULER_##B, EULER_##C> EulerSystem##A##B##C;
#define EIGEN_EULER_SYSTEM_TYPEDEF(A, B, C)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
internal::traits< Derived >::Scalar Scalar
Represents a rotation in a 3 dimensional space as three Euler angles.
Represents a fixed Euler rotation system.
static constexpr int AlphaAxis
static void CalcEulerAngles(EulerAngles< Scalar, EulerSystem > &res, const typename EulerAngles< Scalar, EulerSystem >::Matrix3 &mat)
static constexpr int GammaAxis
EIGEN_EULER_ANGLES_CLASS_STATIC_ASSERT(internal::IsValidAxis< AlphaAxis >::value, ALPHA_AXIS_IS_INVALID)
EIGEN_EULER_ANGLES_CLASS_STATIC_ASSERT(internal::IsValidAxis< BetaAxis >::value, BETA_AXIS_IS_INVALID)
EIGEN_EULER_ANGLES_CLASS_STATIC_ASSERT((unsigned) BetaAxisAbs !=(unsigned) GammaAxisAbs, BETA_AXIS_CANT_BE_EQUAL_TO_GAMMA_AXIS)
EIGEN_EULER_ANGLES_CLASS_STATIC_ASSERT((unsigned) AlphaAxisAbs !=(unsigned) BetaAxisAbs, ALPHA_AXIS_CANT_BE_EQUAL_TO_BETA_AXIS)
static void CalcEulerAngles_imp(Matrix< typename MatrixBase< Derived >::Scalar, 3, 1 > &res, const MatrixBase< Derived > &mat, internal::true_type)
static void CalcEulerAngles_imp(Matrix< typename MatrixBase< Derived >::Scalar, 3, 1 > &res, const MatrixBase< Derived > &mat, internal::false_type)
EIGEN_EULER_ANGLES_CLASS_STATIC_ASSERT(internal::IsValidAxis< GammaAxis >::value, GAMMA_AXIS_IS_INVALID)
static constexpr int BetaAxis
EulerAxis
Representation of a fixed signed rotation axis for EulerSystem.
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
Eigen::AutoDiffScalar< EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Eigen::internal::remove_all_t< DerType >, typename Eigen::internal::traits< Eigen::internal::remove_all_t< DerType >>::Scalar, product) > sqrt(const Eigen::AutoDiffScalar< DerType > &x)
AutoDiffScalar< Matrix< typename internal::traits< internal::remove_all_t< DerTypeA > >::Scalar, Dynamic, 1 > > atan2(const AutoDiffScalar< DerTypeA > &a, const AutoDiffScalar< DerTypeB > &b)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sqrt_op< typename Derived::Scalar >, const Derived > sqrt(const Eigen::ArrayBase< Derived > &x)