Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
config_encoding.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//config_encoding.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//config_encoding.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 config_encoding.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
55
56#pragma once
57
58#include <string>
59
64
65namespace bertini {
66namespace records {
67
69constexpr char ConfigEncodingVersion[] = "b2cfgenc/4";
70
77
88
93
104
124
133template <typename ConfigT>
134detail::Digest256 ConfigDigest(ConfigT const& config)
135{
136 return detail::Sha256(std::string(ConfigEncodingVersion) + "\n" + CanonicalEncoding(config));
137}
138
150template <typename... ConfigTs>
151detail::Digest256 SettingsDigest(ConfigTs const&... configs)
152{
153 std::string combined(ConfigEncodingVersion);
154 ((combined += "\n" + CanonicalEncoding(configs)), ...);
155 return detail::Sha256(combined);
156}
157
170std::string ConfigTextAsJson(std::string const& canonical_text, std::string const& digest_hex);
171
172} // namespace records
173} // namespace bertini
Configs and settings for endgames.
AlgoChoice
Definition config.hpp:49
EndgameChoice
Definition config.hpp:37
Digest256 Sha256(std::string_view data)
SHA-256 (FIPS 180-4) of a byte string.
Definition config_encoding.hpp:66
detail::Digest256 SettingsDigest(ConfigTs const &... configs)
One digest for a solver's FULL settings: the versioned concatenation of several configs' canonical en...
Definition config_encoding.hpp:151
std::string CanonicalEncoding(tracking::SteppingConfig const &c)
Canonical encoding of stepping settings.
std::string ConfigTextAsJson(std::string const &canonical_text, std::string const &digest_hex)
Render one or more canonical config encodings as pretty JSON, for archiving in a structured output di...
detail::Digest256 ConfigDigest(ConfigT const &config)
The persistent digest of one configuration: SHA-256 over its versioned canonical encoding.
Definition config_encoding.hpp:134
std::string CanonicalName(tracking::Predictor p)
The fixed canonical name of a predictor choice (never its numeric value).
constexpr char ConfigEncodingVersion[]
The version tag baked into every config digest; bump on any encoding change.
Definition config_encoding.hpp:69
Predictor
The predictor (ODE integration) method used during path tracking.
Definition config.hpp:55
Definition algorithm_builder.hpp:36
Self-contained SHA-256 (FIPS 180-4) and the Digest256 value type.
Configuration for auto-retracking paths flagged as crossed.
Definition config.hpp:90
Top-level meta configuration: which algorithm to run.
Definition config.hpp:252
Configuration for the midpath (path-crossing) check.
Definition config.hpp:80
Configuration for post-processing solutions (reality/finiteness/singularity classification).
Definition config.hpp:140
Configuration for the regeneration cascade.
Definition config.hpp:116
Configuration for sharpening computed solutions.
Definition config.hpp:100
Newton and path-tracking tolerances.
Definition config.hpp:69
Top-level configuration for a zero-dimensional solve (times, precision, threading).
Definition config.hpp:212
Selects which endgame to use (classic input).
Definition config.hpp:44
A 256-bit content digest – the output of Sha256, used as a persistent identity key.
Definition sha256.hpp:53
Cauchy-endgame configuration.
Definition config.hpp:142
Configuration common to all endgames (sampling and final-approximation tolerances).
Definition config.hpp:103
Power-series-endgame configuration.
Definition config.hpp:134
Security (divergence-bailout) configuration for an endgame.
Definition config.hpp:95
Track-back endgame configuration.
Definition config.hpp:167
Holds the program parameters with respect to Adaptive Multiple Precision.
Definition config.hpp:214
Settings for a fixed-precision tracker (carries the single working precision in effect).
Definition config.hpp:157
Settings governing the Newton corrector's iteration bounds.
Definition config.hpp:119
Settings governing step-size adjustment during tracking.
Definition config.hpp:96
The thresholds a tracker judges a path against: close enough, and too big.
Definition config.hpp:142
Configs and settings for tracking.