58 conj(
m_c * conj(other.
m_s) + conj(
m_s) * conj(other.
m_c)));
69 template<
typename Derived>
76 void makeGivens(
const Scalar& p,
const Scalar& q, Scalar* r=0);
92template<
typename Scalar>
136template<
typename Scalar>
137template<
typename Derived>
160template<
typename Scalar>
169template<
typename Scalar>
183 else if(p==Scalar(0))
205 m_s = -qs*conj(ps)*(m_c/p2);
222 m_s = -conj(ps) * (q/u);
229template<
typename Scalar>
237 m_c = p<Scalar(0) ? Scalar(-1) : Scalar(1);
241 else if(p==Scalar(0))
244 m_s = q<Scalar(0) ? Scalar(1) : Scalar(-1);
281template<
typename VectorX,
typename VectorY,
typename OtherScalar>
292template<
typename Derived>
293template<
typename OtherScalar>
308template<
typename Derived>
309template<
typename OtherScalar>
320template<
typename Scalar,
typename OtherScalar,
321 int SizeAtCompileTime,
int MinAlignment,
bool Vectorizable>
331 *x =
c * xi + numext::conj(s) * yi;
332 *
y = -s * xi + numext::conj(
c) * yi;
339template<
typename Scalar,
typename OtherScalar,
340 int SizeAtCompileTime,
int MinAlignment>
353 if(SizeAtCompileTime ==
Dynamic && ((incrx==1 && incry==1) || PacketSize == 1))
356 enum { Peeling = 2 };
359 Index alignedEnd = alignedStart + ((
size-alignedStart)/PacketSize)*PacketSize;
361 const OtherPacket pc = pset1<OtherPacket>(
c);
362 const OtherPacket ps = pset1<OtherPacket>(s);
366 for(
Index i=0; i<alignedStart; ++i)
370 x[i] =
c * xi + numext::conj(s) * yi;
371 y[i] = -s * xi + numext::conj(
c) * yi;
379 for(
Index i=alignedStart; i<alignedEnd; i+=PacketSize)
381 Packet xi = pload<Packet>(px);
382 Packet yi = pload<Packet>(py);
391 Index peelingEnd = alignedStart + ((
size-alignedStart)/(Peeling*PacketSize))*(Peeling*PacketSize);
392 for(
Index i=alignedStart; i<peelingEnd; i+=Peeling*PacketSize)
394 Packet xi = ploadu<Packet>(px);
395 Packet xi1 = ploadu<Packet>(px+PacketSize);
396 Packet yi = pload <Packet>(py);
397 Packet yi1 = pload <Packet>(py+PacketSize);
402 px += Peeling*PacketSize;
403 py += Peeling*PacketSize;
405 if(alignedEnd!=peelingEnd)
407 Packet xi = ploadu<Packet>(x+peelingEnd);
408 Packet yi = pload <Packet>(
y+peelingEnd);
418 x[i] =
c * xi + numext::conj(s) * yi;
419 y[i] = -s * xi + numext::conj(
c) * yi;
424 else if(SizeAtCompileTime !=
Dynamic && MinAlignment>0)
426 const OtherPacket pc = pset1<OtherPacket>(
c);
427 const OtherPacket ps = pset1<OtherPacket>(s);
434 Packet xi = pload<Packet>(px);
435 Packet yi = pload<Packet>(py);
446 apply_rotation_in_the_plane_selector<Scalar,OtherScalar,SizeAtCompileTime,MinAlignment,false>::run(x,incrx,
y,incry,
size,
c,s);
451template<
typename VectorX,
typename VectorY,
typename OtherScalar>
455 typedef typename VectorX::Scalar Scalar;
456 const bool Vectorizable = (int(VectorX::Flags) & int(VectorY::Flags) &
PacketAccessBit)
461 Index incrx = xpr_x.derived().innerStride();
462 Index incry = xpr_y.derived().innerStride();
467 OtherScalar
c = j.
c();
468 OtherScalar s = j.
s();
469 if (
c==OtherScalar(1) && s==OtherScalar(0))
474 VectorX::SizeAtCompileTime,
476 Vectorizable>::run(x,incrx,
y,incry,
size,
c,s);
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ColXpr col(Index i)
This is the const version of col().
Definition: BlockMethods.h:1097
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RowXpr row(Index i)
This is the const version of row(). */.
Definition: BlockMethods.h:1118
EIGEN_DEVICE_FUNC RealReturnType real() const
Definition: CommonCwiseUnaryOps.h:100
#define EIGEN_RESTRICT
Definition: Macros.h:1170
#define EIGEN_PLAIN_ENUM_MIN(a, b)
Definition: Macros.h:1298
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:986
#define eigen_assert(x)
Definition: Macros.h:1047
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:47
\jacobi_module
Definition: Jacobi.h:35
EIGEN_DEVICE_FUNC void makeGivens(const Scalar &p, const Scalar &q, Scalar *r=0)
Makes *this as a Givens rotation G such that applying to the left of the vector yields: .
Definition: Jacobi.h:162
EIGEN_DEVICE_FUNC JacobiRotation transpose() const
Returns the transposed transformation.
Definition: Jacobi.h:63
Scalar m_c
Definition: Jacobi.h:84
EIGEN_DEVICE_FUNC Scalar c() const
Definition: Jacobi.h:48
EIGEN_DEVICE_FUNC JacobiRotation operator*(const JacobiRotation &other)
Concatenates two planar rotation.
Definition: Jacobi.h:54
NumTraits< Scalar >::Real RealScalar
Definition: Jacobi.h:37
EIGEN_DEVICE_FUNC Scalar & s()
Definition: Jacobi.h:49
EIGEN_DEVICE_FUNC JacobiRotation()
Default constructor without any initialization.
Definition: Jacobi.h:41
EIGEN_DEVICE_FUNC JacobiRotation adjoint() const
Returns the adjoint transformation.
Definition: Jacobi.h:67
EIGEN_DEVICE_FUNC Scalar s() const
Definition: Jacobi.h:50
EIGEN_DEVICE_FUNC JacobiRotation(const Scalar &c, const Scalar &s)
Construct a planar rotation from a cosine-sine pair (c, s).
Definition: Jacobi.h:45
Scalar m_s
Definition: Jacobi.h:84
EIGEN_DEVICE_FUNC Scalar & c()
Definition: Jacobi.h:47
EIGEN_DEVICE_FUNC bool makeJacobi(const MatrixBase< Derived > &, Index p, Index q)
Makes *this as a Jacobi rotation J such that applying J on both the right and left sides of the 2x2 s...
Definition: Jacobi.h:139
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:50
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
replaces *this by other * *this.
Definition: MatrixBase.h:540
void applyOnTheRight(const EigenBase< OtherDerived > &other)
replaces *this by *this * other.
Definition: MatrixBase.h:528
Base::RowXpr RowXpr
Definition: MatrixBase.h:87
Base::ColXpr ColXpr
Definition: MatrixBase.h:88
type
Definition: core.h:575
sign::type sign_t
Definition: core.h:2088
UnitType abs(const UnitType x) noexcept
Compute absolute value.
Definition: math.h:721
auto sqrt(const UnitType &value) noexcept -> unit_t< square_root< typename units::traits::unit_t_traits< UnitType >::unit_type >, typename units::traits::unit_t_traits< UnitType >::underlying_type, linear_scale >
computes the square root of value
Definition: math.h:483
const unsigned int PacketAccessBit
Short version: means the expression might be vectorized.
Definition: Constants.h:94
constexpr common_t< T1, T2 > min(const T1 x, const T2 y) noexcept
Compile-time pairwise minimum function.
Definition: min.hpp:35
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:215
const Scalar & y
Definition: MathFunctions.h:821
EIGEN_CONSTEXPR Index size(const T &x)
Definition: Meta.h:479
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:696
EIGEN_DEVICE_FUNC void apply_rotation_in_the_plane(DenseBase< VectorX > &xpr_x, DenseBase< VectorY > &xpr_y, const JacobiRotation< OtherScalar > &j)
\jacobi_module Applies the clock wise 2D rotation j to the set of 2D vectors of coordinates x and y:
Definition: Jacobi.h:453
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:700
EIGEN_DEVICE_FUNC Packet psub(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:222
EIGEN_DEVICE_FUNC Index first_default_aligned(const Scalar *array, Index size)
Definition: Memory.h:497
EIGEN_DEVICE_FUNC bool abs2(bool x)
Definition: MathFunctions.h:1292
Namespace containing all symbols from the Eigen library.
Definition: Core:141
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition: Constants.h:22
Definition: Eigen_Colamd.h:50
static constexpr const velocity::meters_per_second_t c(299792458.0)
Speed of light in vacuum.
Holds information about the various numeric (i.e.
Definition: NumTraits.h:233
static void run(Scalar *x, Index incrx, Scalar *y, Index incry, Index size, OtherScalar c, OtherScalar s)
Definition: Jacobi.h:343
static EIGEN_DEVICE_FUNC void run(Scalar *x, Index incrx, Scalar *y, Index incry, Index size, OtherScalar c, OtherScalar s)
Definition: Jacobi.h:325
Definition: ConjHelper.h:63
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmul(const LhsType &x, const RhsType &y) const
Definition: ConjHelper.h:71
Definition: CoreEvaluators.h:91
Definition: GenericPacketMath.h:107
T type
Definition: GenericPacketMath.h:108