Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
reintern.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//reintern.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//reintern.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 reintern.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
43
44#pragma once
45
46#include <map>
47#include <memory>
48
50
51namespace bertini {
52namespace node {
53
57using ReinternMemo = std::map<Node const*, std::shared_ptr<Node>>;
58
70std::shared_ptr<Node> Reintern(std::shared_ptr<Node> const& root, ReinternMemo& memo);
71
78std::shared_ptr<Node> Reintern(std::shared_ptr<Node> const& root);
79
80} // namespace node
81} // namespace bertini
Definition canonical.hpp:56
std::map< Node const *, std::shared_ptr< Node > > ReinternMemo
Memo for one re-interning pass: loaded node -> its interned replacement.
Definition reintern.hpp:57
std::shared_ptr< Node > Reintern(std::shared_ptr< Node > const &root, ReinternMemo &memo)
Rebuild the DAG rooted at root through the interning factories (memoized, post-order),...
Definition algorithm_builder.hpp:36
Defines the abstract Node base class.