Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
prec_base.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//prec_base.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//prec_base.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 prec_base.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// Tim Hodges, Colorado State University
25
26
27
28#pragma once
29
30
36
37
38namespace bertini{ namespace endgame {
39
40
44template <typename TrackerT>
45class EndgamePrecPolicyBase : public virtual Observable
46{
47public:
48
49 using TrackerType = TrackerT;
50
51 explicit
52 EndgamePrecPolicyBase(TrackerT const& new_tracker) : tracker_(std::ref(new_tracker))
53 {}
54
55 virtual ~EndgamePrecPolicyBase() = default;
56
62 inline
63 void SetTracker(TrackerT const& new_tracker)
64 {
65 tracker_ = std::ref(new_tracker); // rebind the reference
66 }
67
68
72 inline
73 const TrackerT& GetTracker() const
74 {
75 return tracker_.get();
76 }
77
81 inline
82 const System& GetSystem() const
83 { return GetTracker().GetSystem();}
84
85 void ChangePrecision(unsigned p)
86 {
87 tracker_.ChangePrecision(p);
88 }
89
90private:
91
95 std::reference_wrapper<const TrackerT> tracker_;
96
97}; //EndgamePrecPolicyBase
98
99
100
101} } // end namespaces
102
103
104
An abstract observable type, maintaining a list of observers, who can be notified in case of Events.
Definition observable.hpp:48
The fundamental polynomial system class for Bertini2.
Definition system/system.hpp:99
const System & GetSystem() const
Get the system being tracked on, which is referred to by the tracker.
Definition prec_base.hpp:82
void SetTracker(TrackerT const &new_tracker)
Definition prec_base.hpp:63
const TrackerT & GetTracker() const
Getter for the tracker used inside an instance of the endgame.
Definition prec_base.hpp:73