Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
total_degree.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//total_degree.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//total_degree.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 total_degree.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
30
31#pragma once
32
35
36namespace bertini
37{
38 namespace start_system{
39
40
52 class TotalDegree : public StartSystem
53 {
54 public:
55 TotalDegree() = default;
56 virtual ~TotalDegree() = default;
57
63 TotalDegree(System const& s);
64
65
71 template<typename NumT>
72 NumT RandomValue(size_t index) const
73 {
74 return random_values_[index]->Eval<NumT>();
75 }
76
77
81 std::vector<std::shared_ptr<node::Rational> > const& RandomValues()
82 {
83 return random_values_;
84 }
85
86
90 unsigned long long NumStartPoints() const override;
91
92 TotalDegree& operator*=(Nd const& n);
93
94 TotalDegree& operator+=(System const& sys) = delete;
95
96 void SanityChecks(System const& s);
97
98 private:
99
103 void CopyDegrees(System const& s);
104
108 void SeedRandomValues(int num_functions);
109
113 void GenerateFunctions();
114
115
121 Vec<dbl> GenerateStartPoint(dbl,unsigned long long index) const override;
122
128 Vec<mpfr_complex> GenerateStartPoint(mpfr_complex,unsigned long long index) const override;
129
130 std::vector<std::shared_ptr<node::Rational> > random_values_;
131 std::vector<unsigned long long> degrees_;
132
133
134 friend class boost::serialization::access;
135
136 template <typename Archive>
137 void serialize(Archive& ar, const unsigned version) {
138 ar & boost::serialization::base_object<StartSystem>(*this);
139 ar & random_values_;
140 ar & degrees_;
141 }
142
143 };
144 }
145}
146
147
148
The fundamental polynomial system class for Bertini2.
Definition system/system.hpp:99
System()
The default constructor for a system.
Definition system/system.hpp:111
Abstract base class for other start systems.
Definition start_base.hpp:49
Total degree start system for 1-homogeneous polynomial systems.
Definition total_degree.hpp:53
NumT RandomValue(size_t index) const
Definition total_degree.hpp:72
unsigned long long NumStartPoints() const override
Definition total_degree.cpp:61
std::vector< std::shared_ptr< node::Rational > > const & RandomValues()
Definition total_degree.hpp:81
Defines generic start system type.
utilities for start system code.