Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
events.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//events.hpp is free software: you can redistribute it and/or modify
4//it under the terms of the GNU General Public License as published by
5//the Free Software Foundation, either version 3 of the License, or
6//(at your option) any later version.
7//
8//events.hpp is distributed in the hope that it will be useful,
9//but WITHOUT ANY WARRANTY; without even the implied warranty of
10//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11//GNU General Public License for more details.
12//
13//You should have received a copy of the GNU General Public License
14//along with events.hpp. If not, see <http://www.gnu.org/licenses/>.
15//
16// Copyright(C) Bertini2 Development Team
17//
18// See <http://www.gnu.org/licenses/> for a copy of the license,
19// as well as COPYING. Bertini2 is provided with permitted
20// additional terms in the b2/licenses/ directory.
21
27
28#pragma once
29
31
32namespace bertini {
33
34 namespace endgame{
35
36
37
42
47
52
57
61 ADD_BERTINI_EVENT_TYPE(RefiningFailed,EndgameFailure);
62
67
72
76 ADD_BERTINI_EVENT_TYPE(Initializing,EndgameEvent);
77
88 ADD_BERTINI_EVENT_TYPE(SamplesRecomputedAtHigherPrecision,EndgameEvent);
89
90
94 ADD_BERTINI_EVENT_TYPE(TimeAdvanced,EndgameEvent);
95
116 template<class ObservedT>
117 class ComputedSamplePoint : public EndgameEvent<ObservedT>
118 { BOOST_TYPE_INDEX_REGISTER_CLASS
119 public:
120
121 using ComplexT = typename ObservedT::BaseComplexT;
122
130 ComputedSamplePoint(const ObservedT & obs,
131 Vec<ComplexT> const& new_point,
132 ComplexT const& new_time) : EndgameEvent<ObservedT>(obs),
133 new_point_(new_point),
134 new_time_(new_time)
135 {}
136
137 virtual ~ComputedSamplePoint() = default;
139
141 const auto& NewSample() const {return new_point_;}
142
144 const auto& NewTime() const {return new_time_;}
145
146 private:
147 const Vec<ComplexT>& new_point_;
148 const ComplexT& new_time_;
149 };
150
151
155 template<class ObservedT>
156 class CircleAdvanced : public EndgameEvent<ObservedT>
157 { BOOST_TYPE_INDEX_REGISTER_CLASS
158 public:
159
160 using ComplexT = typename ObservedT::BaseComplexT;
168 CircleAdvanced(const ObservedT & obs,
169 Vec<ComplexT> const& new_point,
170 ComplexT const& new_time) : EndgameEvent<ObservedT>(obs),
171 new_point_(new_point),
172 new_time_(new_time)
173 {}
174
175
176 virtual ~CircleAdvanced() = default;
177 CircleAdvanced() = delete;
178
180 const auto& NewSample() const {return new_point_;}
181
183 const auto& NewTime() const {return new_time_;}
184
185 private:
186 const Vec<ComplexT>& new_point_;
187 const ComplexT& new_time_;
188 };
189
190
194 ADD_BERTINI_EVENT_TYPE(ClosedLoop,EndgameEvent);
195
199 ADD_BERTINI_EVENT_TYPE(ApproximatedRoot,EndgameEvent);
200
204 ADD_BERTINI_EVENT_TYPE(Converged,EndgameSuccess);
205
209 ADD_BERTINI_EVENT_TYPE(SampleRefined,EndgameEvent);
210
214 ADD_BERTINI_EVENT_TYPE(InEGOperatingZone,EndgameEvent);
215
216
218 template<class ObservedT>
219 class PrecisionChanged : public EndgameEvent<ObservedT>
220 { BOOST_TYPE_INDEX_REGISTER_CLASS
221 public:
229 PrecisionChanged(const ObservedT & obs,
230 unsigned previous, unsigned next) : EndgameEvent<ObservedT>(obs),
231 prev_(previous),
232 next_(next)
233 {}
234
235
236 virtual ~PrecisionChanged() = default;
238
242 auto Previous() const {return prev_;}
243
247 auto Next() const {return next_;}
248 private:
249 const unsigned prev_, next_;
250 };
251
252
253 }// re: namespace endgames
254}// re: namespace bertini
typename ObservedT::BaseComplexT ComplexT
The complex number type.
Definition events.hpp:160
const auto & NewSample() const
Definition events.hpp:180
const auto & NewTime() const
Definition events.hpp:183
virtual ~CircleAdvanced()=default
CircleAdvanced(const ObservedT &obs, Vec< ComplexT > const &new_point, ComplexT const &new_time)
The constructor for a CircleAdvanced Event.
Definition events.hpp:168
const auto & NewSample() const
Definition events.hpp:141
ComputedSamplePoint(const ObservedT &obs, Vec< ComplexT > const &new_point, ComplexT const &new_time)
The constructor for a ComputedSamplePoint event.
Definition events.hpp:130
const auto & NewTime() const
Definition events.hpp:144
typename ObservedT::BaseComplexT ComplexT
The complex number type.
Definition events.hpp:121
PrecisionChanged(const ObservedT &obs, unsigned previous, unsigned next)
The constructor for a PrecisionChanged Event.
Definition events.hpp:229
auto Previous() const
Get the previous precision.
Definition events.hpp:242
auto Next() const
Get the next precision, what it changed to.
Definition events.hpp:247
Contains the detail/events base types.
#define ADD_BERTINI_EVENT_TYPE(event_name, event_parenttype)
Defines a new event type in a hierarchy.
Definition events.hpp:166
Definition endgames.hpp:44
Definition algorithm_builder.hpp:36
Eigen::Matrix< NumT, Eigen::Dynamic, 1 > Vec
A dynamically-sized column vector of NumT.
Definition eigen_extensions.hpp:296
Event< ObsT, true > ConstEvent
An event holding a const reference to its observable.
Definition events.hpp:154
@ MinTrackTimeReached
Definition config.hpp:64
@ CycleNumTooHigh
Definition config.hpp:66
@ SecurityMaxNormReached
Definition config.hpp:65