Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/solvers/enumpoly/efgpoly.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ std::list<MixedBehaviorProfile<double>> SolveSupport(const BehaviorSupportProfil

// set up the rectangle of search
Vector<double> bottoms(data.space->GetDimension()), tops(data.space->GetDimension());
bottoms = 0;
tops = 1;
bottoms = 1e-12;
tops = 1 - 1e-12;

PolynomialSystemSolver solver(equations);
std::list<Vector<double>> roots;
Expand Down
4 changes: 2 additions & 2 deletions src/solvers/enumpoly/nfgpoly.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ EnumPolyStrategySupportSolve(const StrategySupportProfile &support, bool &is_sin
const PolynomialSystem<double> equations = ConstructEquations(space, support, strategy_poly);

Vector<double> bottoms(space->GetDimension()), tops(space->GetDimension());
bottoms = 0;
tops = 1;
bottoms = 1e-12;
tops = 1 - 1e-12;
PolynomialSystemSolver solver(equations);
is_singular = false;
std::list<Vector<double>> roots;
Expand Down
6 changes: 5 additions & 1 deletion src/solvers/enumpoly/poly.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ template <class T> class Polynomial {
});
}
[[nodiscard]] const std::vector<Monomial<T>> &GetTerms() const noexcept { return m_terms; }
bool IsZero() const noexcept { return m_terms.empty(); }
bool IsZero() const noexcept
{
return m_terms.empty() || std::all_of(m_terms.begin(), m_terms.end(),
[](const auto &mono) { return mono.IsZero(); });
}
bool IsConstant() const noexcept
{
return m_terms.size() == 1 && m_terms.front().TotalDegree() == 0;
Expand Down
Loading