Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
symbol.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//symbol.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//symbol.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 symbol.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// James Collins
24// West Texas A&M University
25// Spring, Summer 2015
26//
27// silviana amethyst, university of wisconsin-eau claire
28//
29// Created by Collins, James B. on 4/30/15.
30//
31//
32// symbol.hpp: Declares the class Symbol.
33
40
41#ifndef BERTINI_FUNCTION_TREE_SYMBOL_HPP
42#define BERTINI_FUNCTION_TREE_SYMBOL_HPP
43
44
46
47
48
49namespace bertini {
50namespace node {
56 class Symbol : public virtual Node
57 {
58
59 public:
60
61 virtual ~Symbol() = default;
62
63 unsigned EliminateZeros() override;
64 unsigned EliminateOnes() override;
65
66 private:
67 friend class boost::serialization::access;
68
69 template <typename Archive>
70 void serialize(Archive& ar, const unsigned version) {
71 ar & boost::serialization::base_object<Node>(*this);
72 }
73 };
74
75
76
77
78
79
80
81
87 class NamedSymbol : public virtual Symbol
88 {
89
90 public:
91
95 const std::string & name() const;
96
100 void name(const std::string & new_name);
101
102
106 NamedSymbol(const std::string & new_name);
107
108
109 void print(std::ostream& target) const override;
110
111 virtual ~NamedSymbol() = default;
112
113 protected:
114 NamedSymbol() = default;
115
116 std::string name_;
117
118 private:
119
120 friend class boost::serialization::access;
121
122 template <typename Archive>
123 void serialize(Archive& ar, const unsigned version) {
124 ar & boost::serialization::base_object<Symbol>(*this);
125 ar & name_;
126 }
127
128 };
129
130} // re: namespace node
131} // re: namespace bertini
132
133#endif
NamedSymbol(const std::string &new_name)
Definition symbol.cpp:54
const std::string & name() const
Definition symbol.cpp:45
void print(std::ostream &target) const override
Definition symbol.cpp:58
Abstract symbol class.
Definition symbol.hpp:57
unsigned EliminateOnes() override
A transform function, which eliminates nodes from the tree.
Definition symbol.cpp:39
unsigned EliminateZeros() override
A transform function, which eliminates nodes from the tree.
Definition symbol.cpp:35
Defines the abstract Node base class.