Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
endgames/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) 2015 - 2021 by 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
22// individual authors of this file include:
23// silviana amethyst, university of wisconsin eau claire
24
25
31
32#pragma once
33
35
36namespace bertini {
37
38 namespace endgame{
39
40
41
45 ADD_BERTINI_EVENT_TYPE(EndgameEvent,ConstEvent);
46
50 ADD_BERTINI_EVENT_TYPE(EndgameFailure,ConstEvent);
51
55 ADD_BERTINI_EVENT_TYPE(EndgameSuccess,ConstEvent);
56
60 ADD_BERTINI_EVENT_TYPE(MinTrackTimeReached,EndgameFailure);
61
65 ADD_BERTINI_EVENT_TYPE(RefiningFailed,EndgameFailure);
66
70 ADD_BERTINI_EVENT_TYPE(CycleNumTooHigh,EndgameFailure);
71
75 ADD_BERTINI_EVENT_TYPE(SecurityMaxNormReached,EndgameFailure);
76
80 ADD_BERTINI_EVENT_TYPE(Initializing,EndgameEvent);
81
82
86 ADD_BERTINI_EVENT_TYPE(TimeAdvanced,EndgameEvent);
87
91 template<class ObservedT>
92 class CircleAdvanced : public EndgameEvent<ObservedT>
93 { BOOST_TYPE_INDEX_REGISTER_CLASS
94 public:
95
96 using CT = typename ObservedT::BaseComplexType;
104 CircleAdvanced(const ObservedT & obs,
105 Vec<CT> const& new_point,
106 CT const& new_time) : EndgameEvent<ObservedT>(obs),
107 new_point_(new_point),
108 new_time_(new_time)
109 {}
110
111
112 virtual ~CircleAdvanced() = default;
113 CircleAdvanced() = delete;
114
115 const auto& NewSample() const {return new_point_;}
116
117 const auto& NewTime() const {return new_time_;}
118
119 private:
120 const Vec<CT>& new_point_;
121 const CT& new_time_;
122 };
123
124
128 ADD_BERTINI_EVENT_TYPE(ClosedLoop,EndgameEvent);
129
133 ADD_BERTINI_EVENT_TYPE(ApproximatedRoot,EndgameEvent);
134
138 ADD_BERTINI_EVENT_TYPE(Converged,EndgameSuccess);
139
143 ADD_BERTINI_EVENT_TYPE(SampleRefined,EndgameEvent);
144
148 ADD_BERTINI_EVENT_TYPE(InEGOperatingZone,EndgameEvent);
149
150
151 template<class ObservedT>
152 class PrecisionChanged : public EndgameEvent<ObservedT>
153 { BOOST_TYPE_INDEX_REGISTER_CLASS
154 public:
162 PrecisionChanged(const ObservedT & obs,
163 unsigned previous, unsigned next) : EndgameEvent<ObservedT>(obs),
164 prev_(previous),
165 next_(next)
166 {}
167
168
169 virtual ~PrecisionChanged() = default;
170 PrecisionChanged() = delete;
171
175 auto Previous() const {return prev_;}
176
180 auto Next() const {return next_;}
181 private:
182 const unsigned prev_, next_;
183 };
184
185
186 }// re: namespace endgames
187}// re: namespace bertini
188
Advanced around the circle around target time.
Definition endgames/events.hpp:93
CircleAdvanced(const ObservedT &obs, Vec< CT > const &new_point, CT const &new_time)
The constructor for a CircleAdvanced Event.
Definition endgames/events.hpp:104
Contains the detail/events base types.
#define ADD_BERTINI_EVENT_TYPE(event_name, event_parenttype)
Defines a new event type in a hierarchy.
Definition detail/events.hpp:154