11#ifndef EIGEN_ORTHOMETHODS_H
12#define EIGEN_ORTHOMETHODS_H
27template<
typename Derived>
28template<
typename OtherDerived>
29inline typename MatrixBase<Derived>::template cross_product_return_type<OtherDerived>::type
32 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived,3)
40 numext::conj(lhs.coeff(1) * rhs.coeff(2) - lhs.coeff(2) * rhs.coeff(1)),
41 numext::conj(lhs.coeff(2) * rhs.coeff(0) - lhs.coeff(0) * rhs.coeff(2)),
42 numext::conj(lhs.coeff(0) * rhs.coeff(1) - lhs.coeff(1) * rhs.coeff(0))
49 typename Scalar =
typename VectorLhs::Scalar,
50 bool Vectorizable = bool((VectorLhs::Flags&VectorRhs::Flags)&
PacketAccessBit)>
56 numext::conj(lhs.coeff(1) * rhs.coeff(2) - lhs.coeff(2) * rhs.coeff(1)),
57 numext::conj(lhs.coeff(2) * rhs.coeff(0) - lhs.coeff(0) * rhs.coeff(2)),
58 numext::conj(lhs.coeff(0) * rhs.coeff(1) - lhs.coeff(1) * rhs.coeff(0)),
75template<
typename Derived>
76template<
typename OtherDerived>
80 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived,4)
102template<
typename ExpressionType,
int Direction>
103template<
typename OtherDerived>
104const typename VectorwiseOp<ExpressionType,Direction>::CrossReturnType
107 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
OtherDerived,3)
109 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
114 CrossReturnType res(_expression().rows(),_expression().cols());
117 eigen_assert(CrossReturnType::RowsAtCompileTime==3 &&
"the matrix must have exactly 3 rows");
118 res.row(0) = (
mat.row(1) * vec.coeff(2) -
mat.row(2) * vec.coeff(1)).conjugate();
119 res.row(1) = (
mat.row(2) * vec.coeff(0) -
mat.row(0) * vec.coeff(2)).conjugate();
120 res.row(2) = (
mat.row(0) * vec.coeff(1) -
mat.row(1) * vec.coeff(0)).conjugate();
124 eigen_assert(CrossReturnType::ColsAtCompileTime==3 &&
"the matrix must have exactly 3 columns");
125 res.col(0) = (
mat.col(1) * vec.coeff(2) -
mat.col(2) * vec.coeff(1)).conjugate();
126 res.col(1) = (
mat.col(2) * vec.coeff(0) -
mat.col(0) * vec.coeff(2)).conjugate();
127 res.col(2) = (
mat.col(0) * vec.coeff(1) -
mat.col(1) * vec.coeff(0)).conjugate();
134template<
typename Derived,
int Size = Derived::SizeAtCompileTime>
139 typedef typename NumTraits<Scalar>::Real
RealScalar;
142 static inline VectorType run(
const Derived&
src)
144 VectorType
perp = VectorType::Zero(
src.size());
147 src.cwiseAbs().maxCoeff(&maxi);
158template<
typename Derived>
163 typedef typename NumTraits<Scalar>::Real
RealScalar;
165 static inline VectorType run(
const Derived&
src)
175 if((!isMuchSmallerThan(
src.x(),
src.z()))
176 || (!isMuchSmallerThan(
src.y(),
src.z())))
181 perp.coeffRef(2) = 0;
190 perp.coeffRef(0) = 0;
199template<
typename Derived>
204 static inline VectorType run(
const Derived&
src)
205 {
return VectorType(-numext::conj(
src.y()), numext::conj(
src.x())).normalized(); }
217template<
typename Derived>
221 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Pseudo expression representing a solving operation.
Definition Solve.h:63
Pseudo expression providing partial reduction operations.
Definition VectorwiseOp.h:157
@ Vertical
For Reverse, all columns are reversed; for PartialReduxExpr and VectorwiseOp, act on columns.
Definition Constants.h:265
const unsigned int PacketAccessBit
Short version: means the expression might be vectorized.
Definition Constants.h:88
Definition OrthoMethods.h:51
Definition XprHelper.h:235
Definition ForwardDeclarations.h:17
Definition OrthoMethods.h:136