aimstil  5.0.5
poly_solver_policies.h
Go to the documentation of this file.
1 #ifndef TIL_POLY_SOLVER_POLICIES_H
2 #define TIL_POLY_SOLVER_POLICIES_H
3 
4 
5 namespace til { namespace math { namespace policy
6 {
7 
8  //---------------------------------------------------------------------------
9 
13  {
14  public: // typedefs
15 
17 
18  public: // constructors & destructor
19  InfinitySolutions_Advertise() : m_hasInfSols(false) {}
20 
21  public: // functions
22 
24  template < typename TPrec >
26  {
27  m_hasInfSols = true;
28  }
29 
31  bool hasInfSols() { return m_hasInfSols; }
32 
33  private: // data
34 
35  bool m_hasInfSols;
36  };
37 
38  //---------------------------------------------------------------------------
39 
42  {
45  template < typename TPrec >
47  {
48  solver.set_nsols(0);
49  }
50  };
51 
52  //---------------------------------------------------------------------------
53 
56  {
57  class InfinityOfSolutions : public std::exception {};
58 
61  template < typename TPrec >
63  {
64  throw InfinityOfSolutions();
65  }
66  };
67 
68  //---------------------------------------------------------------------------
69 
70 }}} // namespace til::math::policy
71 
72 
73 #endif
74 
If the polynomial has an infinity of solutions, throw an exception.
void operator()(PolySolver_real< TPrec, Self > &)
Called by solver.
void operator()(PolySolver_real< TPrec, Self > &solver)
Called by solver.
Belongs to package Box Do not include directly, include til/Box.h instead.
Definition: Accumulator.h:10
If the polynomial has an infinity of solutions, set a flag to true that can be queried.
bool hasInfSols()
Query if equation has an infinity of solutions.
void operator()(PolySolver_real< TPrec, Self > &solver)
Called by solver.
Find real roots of a polynomial.
Definition: poly_solver.h:22
If the polynomial has an infinity of solutions, ignore all of them.