Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
jacobian.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//jacobian.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//jacobian.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 jacobian.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// silviana amethyst
30// UWEC
31// Spring 2018
32//
33// Created by Collins, James B. on 6/11/15.
34//
35//
36// jacobian.hpp: Declares the class Jacobian.
37
44
45
46#ifndef BERTINI_JACOBIAN_NODE_HPP
47#define BERTINI_JACOBIAN_NODE_HPP
48
49
53
54
55
56namespace bertini {
57namespace node{
58
64 class Jacobian : public virtual Handle, public virtual EnableSharedFromThisVirtual<Jacobian>
65 {
66 friend detail::FreshEvalSelector<dbl>;
67 friend detail::FreshEvalSelector<mpfr_complex>;
68 public:
69 BERTINI_DEFAULT_VISITABLE()
70
71
72 template<typename... Ts>
73 static
74 std::shared_ptr<Jacobian> Make(Ts&& ...ts){
75 return std::shared_ptr<Jacobian>( new Jacobian(ts...) );
76 }
77
78 private:
81 Jacobian(const std::shared_ptr<Node> & entry);
82
83 public:
84
89 template<typename T>
90 T Eval(std::shared_ptr<Variable> const& diff_variable = nullptr) const = delete;
91
92
93 // Evaluate the node. If flag false, just return value, if flag true
94 // run the specific FreshEval of the node, then set flag to false.
95 template<typename T>
96 T EvalJ(std::shared_ptr<Variable> const& diff_variable) const;
97
98
99 // Evaluate the node. If flag false, just return value, if flag true
100 // run the specific FreshEval of the node, then set flag to false.
101 template<typename T>
102 void EvalJInPlace(T& eval_value, std::shared_ptr<Variable> const& diff_variable) const;
103
104
105
106 virtual ~Jacobian() = default;
107
111 Jacobian() = default;
112
113 private:
114
115 mutable std::shared_ptr<Variable> current_diff_variable_;
116
117
118 friend class boost::serialization::access;
119
120 template <typename Archive>
121 void serialize(Archive& ar, const unsigned version) {
122 ar & boost::serialization::base_object<Handle>(*this);
123 }
124 };
125
126} // re: namespace node
127} // re: namespace bertini
128
129
130
131#endif
T Eval(std::shared_ptr< Variable > const &diff_variable=nullptr) const =delete
Jacobian()=default
Default construction of a Jacobian node is forbidden.
Provides the Function Node type, a NamedSymbol.
Defines the abstract Node base class.
Provides the Variable Node class.