Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
mhom.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//mhom.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//mhom.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 mhom.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// Tim Hodges, Colorado State University
24// silviana amethyst, university of wisconsin eau claire
25
31
32#pragma once
33
36
37namespace bertini
38{
39 namespace start_system
40 {
41
42
48 class MHomogeneous : public StartSystem
49 {
50 public:
51 MHomogeneous() = default;
52 virtual ~MHomogeneous() = default;
53
61 MHomogeneous(System const& s);
62
66 void CreateDegreeMatrix(System const& s);
67
71 void GenerateValidPartitions(System const& s);
72
76 int ChooseColumnInRow(System const& s,Vec<int>& variable_group_counter, int row, int column);
77
81 unsigned long long NumStartPoints() const override;
82
83 unsigned long long NumStartPointsForPartition(Vec<int> partition) const;
84
85 MHomogeneous& operator*=(Nd const& n);
86
87 MHomogeneous& operator+=(System const& sys) = delete;
88
92 Mat<int> degree_matrix_; // stores degrees of all functions in all homogeneous variable groups.
93
97 std::deque< Vec<int> > valid_partitions_;
98
99
100 private:
101
107 Vec<dbl> GenerateStartPoint(dbl,unsigned long long index) const override;
108
114 Vec<mpfr_complex> GenerateStartPoint(mpfr_complex,unsigned long long index) const override;
115
119 template<typename T>
120 void GenerateStartPointT(Vec<T>& start_point, unsigned long long index) const;
121
122
123
124
125 std::vector<unsigned long long> degrees_;
126 std::vector< VariableGroup > var_groups_;
127 Mat<std::shared_ptr<node::LinearProduct>> linprod_matrix_;
128 std::vector< std::vector<size_t> > variable_cols_;
129
130 mutable Vec<mpfr_complex> temp_v_mp_;
131
132 friend class boost::serialization::access;
133
134 template <typename Archive>
135 void serialize(Archive& ar, const unsigned version)
136 {
137 ar & boost::serialization::base_object<StartSystem>(*this);
138 ar & degrees_;
139 }
140
141 };
142 }//end start_system namespace
143}//end bertini namespace
144
145
146
System()
The default constructor for a system.
Definition system/system.hpp:111
std::deque< Vec< int > > valid_partitions_
Partitions used for creating start points in the multi-homogeneous start system.
Definition mhom.hpp:97
unsigned long long NumStartPoints() const override
Function to calculate the total number of start points.
Definition mhom.cpp:122
int ChooseColumnInRow(System const &s, Vec< int > &variable_group_counter, int row, int column)
Helper function that is used to find valid partitions in the degree matrix.
Definition mhom.cpp:297
void GenerateValidPartitions(System const &s)
Creates all valid partitions for multi-homogeneous start system to create start points.
Definition mhom.cpp:220
Mat< int > degree_matrix_
Degree matrix holding degrees for all functions in terms of all variable groups.
Definition mhom.hpp:92
void CreateDegreeMatrix(System const &s)
Creates a degree matrix for constructing the multi-homogeneous start system.
Definition mhom.cpp:148
Abstract base class for other start systems.
Definition start_base.hpp:49
Defines generic start system type.
utilities for start system code.