11 #ifndef EIGEN_JACOBI_H 12 #define EIGEN_JACOBI_H 34 template<
typename Scalar>
class JacobiRotation
69 template<
typename Derived>
92 template<
typename Scalar>
136 template<
typename Scalar>
137 template<
typename Derived>
160 template<
typename Scalar>
169 template<
typename Scalar>
229 template<
typename Scalar>
281 template<
typename VectorX,
typename VectorY,
typename OtherScalar>
292 template<
typename Derived>
293 template<
typename OtherScalar>
308 template<
typename Derived>
309 template<
typename OtherScalar>
320 template<
typename Scalar,
typename OtherScalar,
321 int SizeAtCompileTime,
int MinAlignment,
bool Vectorizable>
339 template<
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);
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);
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);
451 template<
typename VectorX,
typename VectorY,
typename OtherScalar>
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);
483 #endif // EIGEN_JACOBI_H
EIGEN_DEVICE_FUNC JacobiRotation()
internal::packet_traits< Scalar >::type Packet
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
EIGEN_DEVICE_FUNC Scalar & c()
int RealScalar int RealScalar int RealScalar * pc
EIGEN_DEVICE_FUNC void apply_rotation_in_the_plane(DenseBase< VectorX > &xpr_x, DenseBase< VectorY > &xpr_y, const JacobiRotation< OtherScalar > &j)
static void run(Scalar *x, Index incrx, Scalar *y, Index incry, Index size, OtherScalar c, OtherScalar s)
void applyOnTheRight(const EigenBase< OtherDerived > &other)
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. ...
Base class for all dense matrices, vectors, and arrays.
const unsigned int PacketAccessBit
int RealScalar int RealScalar int RealScalar RealScalar * ps
AnnoyingScalar conj(const AnnoyingScalar &x)
static Index first_default_aligned(const DenseBase< Derived > &m)
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC JacobiRotation(const Scalar &c, const Scalar &s)
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
EIGEN_DEVICE_FUNC JacobiRotation operator*(const JacobiRotation &other)
EIGEN_DEVICE_FUNC void makeGivens(const Scalar &p, const Scalar &q, Scalar *r=0)
int RealScalar int RealScalar * py
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
RealScalar RealScalar * px
EIGEN_DEVICE_FUNC Scalar s() const
EIGEN_DEVICE_FUNC const Scalar & q
EIGEN_DEVICE_FUNC bool makeJacobi(const MatrixBase< Derived > &, Index p, Index q)
EIGEN_DEVICE_FUNC JacobiRotation adjoint() const
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
#define EIGEN_DEVICE_FUNC
EIGEN_DEVICE_FUNC Scalar & s()
NumTraits< Scalar >::Real RealScalar
Expression of a fixed-size or dynamic-size block.
static EIGEN_DEVICE_FUNC void run(Scalar *x, Index incrx, Scalar *y, Index incry, Index size, OtherScalar c, OtherScalar s)
#define EIGEN_PLAIN_ENUM_MIN(a, b)
EIGEN_DEVICE_FUNC JacobiRotation transpose() const
EIGEN_DEVICE_FUNC Packet psub(const Packet &a, const Packet &b)
EIGEN_DEVICE_FUNC Scalar c() const
Jet< T, N > sqrt(const Jet< T, N > &f)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ResultType pmul(const LhsType &x, const RhsType &y) const
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
EIGEN_DEVICE_FUNC bool abs2(bool x)
Base class for all dense matrices, vectors, and expressions.