11 #ifndef EIGEN_ORTHOMETHODS_H 12 #define EIGEN_ORTHOMETHODS_H 27 template<
typename Derived>
28 template<
typename OtherDerived>
29 #ifndef EIGEN_PARSED_BY_DOXYGEN 30 EIGEN_DEVICE_FUNC
inline typename MatrixBase<Derived>::template cross_product_return_type<OtherDerived>::type
43 return typename cross_product_return_type<OtherDerived>::type(
52 template<
int Arch,
typename VectorLhs,
typename VectorRhs,
54 bool Vectorizable = bool((VectorLhs::Flags&VectorRhs::Flags)&
PacketAccessBit)>
57 run(
const VectorLhs& lhs,
const VectorRhs& rhs)
60 numext::conj(lhs.coeff(1) * rhs.coeff(2) - lhs.coeff(2) * rhs.coeff(1)),
61 numext::conj(lhs.coeff(2) * rhs.coeff(0) - lhs.coeff(0) * rhs.coeff(2)),
62 numext::conj(lhs.coeff(0) * rhs.coeff(1) - lhs.coeff(1) * rhs.coeff(0)),
79 template<
typename Derived>
80 template<
typename OtherDerived>
89 DerivedNested lhs(derived());
90 OtherDerivedNested rhs(other.derived());
106 template<
typename ExpressionType,
int Direction>
107 template<
typename OtherDerived>
114 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
122 eigen_assert(CrossReturnType::RowsAtCompileTime==3 &&
"the matrix must have exactly 3 rows");
129 eigen_assert(CrossReturnType::ColsAtCompileTime==3 &&
"the matrix must have exactly 3 columns");
139 template<
typename Derived,
int Size = Derived::SizeAtCompileTime>
147 static inline VectorType
run(
const Derived& src)
149 VectorType perp = VectorType::Zero(src.size());
152 src.cwiseAbs().maxCoeff(&maxi);
155 RealScalar invnm =
RealScalar(1)/(Vector2() << src.coeff(sndi),src.coeff(maxi)).finished().norm();
156 perp.coeffRef(maxi) = -
numext::conj(src.coeff(sndi)) * invnm;
157 perp.coeffRef(sndi) =
numext::conj(src.coeff(maxi)) * invnm;
163 template<
typename Derived>
170 static inline VectorType
run(
const Derived& src)
183 RealScalar invnm =
RealScalar(1)/src.template head<2>().norm();
186 perp.coeffRef(2) = 0;
194 RealScalar invnm =
RealScalar(1)/src.template tail<2>().norm();
195 perp.coeffRef(0) = 0;
204 template<
typename Derived>
209 static inline VectorType
run(
const Derived& src)
224 template<
typename Derived>
234 #endif // EIGEN_ORTHOMETHODS_H EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
NumTraits< Scalar >::Real RealScalar
internal::traits< Derived >::Scalar Scalar
EIGEN_DEVICE_FUNC PlainObject unitOrthogonal(void) const
EIGEN_DEVICE_FUNC PlainObject cross3(const MatrixBase< OtherDerived > &other) const
traits< Derived >::Scalar Scalar
plain_matrix_type< Derived >::type VectorType
traits< Derived >::Scalar Scalar
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
static EIGEN_DEVICE_FUNC internal::plain_matrix_type< VectorLhs >::type run(const VectorLhs &lhs, const VectorRhs &rhs)
const unsigned int PacketAccessBit
EIGEN_DEVICE_FUNC cross_product_return_type< OtherDerived >::type cross(const MatrixBase< OtherDerived > &other) const
NumTraits< Scalar >::Real RealScalar
Matrix< Scalar, 2, 1 > Vector2
static EIGEN_DEVICE_FUNC VectorType run(const Derived &src)
static EIGEN_DEVICE_FUNC VectorType run(const Derived &src)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC const CrossReturnType cross(const MatrixBase< OtherDerived > &other) const
Base::PlainObject PlainObject
EIGEN_DEVICE_FUNC ConjugateReturnType conjugate() const
plain_matrix_type< Derived >::type VectorType
virtual EIGEN_DEVICE_FUNC const Scalar coeff(DenseIndex index) const
static EIGEN_DEVICE_FUNC VectorType run(const Derived &src)
plain_matrix_type< Derived >::type VectorType
The matrix class, also used for vectors and row-vectors.
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
ExpressionType::PlainObject CrossReturnType
Base class for all dense matrices, vectors, and expressions.
NumTraits< Scalar >::Real RealScalar
#define EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE)