Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
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) 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#pragma once
23
24
30
31
32namespace bertini{ namespace endgame {
33
34
38template <typename TrackerT>
39class EndgamePrecPolicyBase : public virtual Observable
40{
41public:
42
43 using TrackerType = TrackerT;
44
46 explicit
47 EndgamePrecPolicyBase(TrackerT const& new_tracker) : tracker_(std::ref(new_tracker))
48 {}
49
50 virtual ~EndgamePrecPolicyBase() = default;
51
57 inline
58 void SetTracker(TrackerT const& new_tracker)
59 {
60 tracker_ = std::ref(new_tracker); // rebind the reference
61 }
62
63
67 inline
68 const TrackerT& GetTracker() const
69 {
70 return tracker_.get();
71 }
72
76 inline
77 const System& GetSystem() const
78 { return GetTracker().GetSystem();}
79
81 void ChangePrecision(unsigned p)
82 {
83 // .get(): tracker_ is a reference_wrapper (never instantiated pre-ETI)
84 tracker_.get().ChangePrecision(p);
85 }
86
87private:
88
92 std::reference_wrapper<const TrackerT> tracker_;
93
94}; //EndgamePrecPolicyBase
95
96
97
98} } // end namespaces
The fundamental polynomial system class for Bertini2.
Definition system.hpp:106
EndgamePrecPolicyBase(TrackerT const &new_tracker)
Construct the precision policy holding a reference to the given tracker.
Definition prec_base.hpp:47
TrackerT TrackerType
The path-tracker type.
Definition prec_base.hpp:43
void ChangePrecision(unsigned p)
Change the working precision of the underlying tracker.
Definition prec_base.hpp:81
const System & GetSystem() const
Get the system being tracked on, which is referred to by the tracker.
Definition prec_base.hpp:77
void SetTracker(TrackerT const &new_tracker)
Tell the endgame to use the given tracker.
Definition prec_base.hpp:58
const TrackerT & GetTracker() const
Getter for the tracker used inside an instance of the endgame.
Definition prec_base.hpp:68
Definition endgames.hpp:44
Definition algorithm_builder.hpp:36