11 #ifndef EIGEN_JACOBI_H 12 #define EIGEN_JACOBI_H 34 template<
typename Scalar>
class JacobiRotation
64 template<
typename Derived>
82 template<
typename Scalar>
124 template<
typename Scalar>
125 template<
typename Derived>
147 template<
typename Scalar>
155 template<
typename Scalar>
214 template<
typename Scalar>
265 template<
typename VectorX,
typename VectorY,
typename OtherScalar>
275 template<
typename Derived>
276 template<
typename OtherScalar>
290 template<
typename Derived>
291 template<
typename OtherScalar>
301 template<
typename Scalar,
typename OtherScalar,
302 int SizeAtCompileTime,
int MinAlignment,
bool Vectorizable>
319 template<
typename Scalar,
typename OtherScalar,
320 int SizeAtCompileTime,
int MinAlignment>
333 if(SizeAtCompileTime ==
Dynamic && ((incrx==1 && incry==1) || PacketSize == 1))
336 enum { Peeling = 2 };
339 Index alignedEnd = alignedStart + ((size-alignedStart)/PacketSize)*PacketSize;
341 const OtherPacket
pc = pset1<OtherPacket>(
c);
342 const OtherPacket
ps = pset1<OtherPacket>(
s);
359 for(
Index i=alignedStart;
i<alignedEnd;
i+=PacketSize)
361 Packet
xi = pload<Packet>(
px);
362 Packet yi = pload<Packet>(
py);
371 Index peelingEnd = alignedStart + ((size-alignedStart)/(Peeling*PacketSize))*(Peeling*PacketSize);
372 for(
Index i=alignedStart;
i<peelingEnd;
i+=Peeling*PacketSize)
374 Packet
xi = ploadu<Packet>(
px);
375 Packet xi1 = ploadu<Packet>(px+PacketSize);
376 Packet yi = pload <Packet>(
py);
377 Packet yi1 = pload <Packet>(py+PacketSize);
382 px += Peeling*PacketSize;
383 py += Peeling*PacketSize;
385 if(alignedEnd!=peelingEnd)
387 Packet
xi = ploadu<Packet>(x+peelingEnd);
388 Packet yi = pload <Packet>(y+peelingEnd);
404 else if(SizeAtCompileTime !=
Dynamic && MinAlignment>0)
406 const OtherPacket
pc = pset1<OtherPacket>(
c);
407 const OtherPacket
ps = pset1<OtherPacket>(
s);
414 Packet
xi = pload<Packet>(
px);
415 Packet yi = pload<Packet>(
py);
426 apply_rotation_in_the_plane_selector<Scalar,OtherScalar,SizeAtCompileTime,MinAlignment,false>::run(x,incrx,y,incry,size,c,s);
431 template<
typename VectorX,
typename VectorY,
typename OtherScalar>
435 const bool Vectorizable = (VectorX::Flags & VectorY::Flags &
PacketAccessBit)
440 Index incrx = xpr_x.derived().innerStride();
441 Index incry = xpr_y.derived().innerStride();
446 OtherScalar
c = j.c();
447 OtherScalar
s = j.s();
448 if (c==OtherScalar(1) && s==OtherScalar(0))
453 VectorX::SizeAtCompileTime,
455 Vectorizable>
::run(x,incrx,y,incry,size,c,s);
462 #endif // EIGEN_JACOBI_H
internal::packet_traits< Scalar >::type Packet
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
JacobiRotation operator*(const JacobiRotation &other)
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
int RealScalar int RealScalar int RealScalar * pc
static void run(Scalar *x, Index incrx, Scalar *y, Index incry, Index size, OtherScalar c, OtherScalar s)
JacobiRotation(const Scalar &c, const Scalar &s)
void applyOnTheRight(const EigenBase< OtherDerived > &other)
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
static void run(Scalar *x, Index incrx, Scalar *y, Index incry, Index size, OtherScalar c, OtherScalar s)
Namespace containing all symbols from the Eigen library.
Rotation given by a cosine-sine pair.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
bool makeJacobi(const MatrixBase< Derived > &, Index p, Index q)
Base class for all dense matrices, vectors, and arrays.
JacobiRotation transpose() const
const unsigned int PacketAccessBit
int RealScalar int RealScalar int RealScalar RealScalar * ps
static Index first_default_aligned(const DenseBase< Derived > &m)
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
int RealScalar int RealScalar * py
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
RealScalar RealScalar * px
JacobiRotation adjoint() const
EIGEN_DEVICE_FUNC const Scalar & q
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Abs2ReturnType abs2() const
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
NumTraits< Scalar >::Real RealScalar
Expression of a fixed-size or dynamic-size block.
#define EIGEN_PLAIN_ENUM_MIN(a, b)
EIGEN_DEVICE_FUNC Packet psub(const Packet &a, const Packet &b)
void apply_rotation_in_the_plane(DenseBase< VectorX > &xpr_x, DenseBase< VectorY > &xpr_y, const JacobiRotation< OtherScalar > &j)
void run(Expr &expr, Dev &dev)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Base class for all dense matrices, vectors, and expressions.
EIGEN_STRONG_INLINE Scalar pmul(const LhsScalar &x, const RhsScalar &y) const
ScalarWithExceptions conj(const ScalarWithExceptions &x)
void makeGivens(const Scalar &p, const Scalar &q, Scalar *r=0)