46 typename SystemType,
typename StartSystemType
47 ,
typename StoredSystemType,
typename StoredStartSystemType>
51 using SystemT = SystemType;
52 using StartSystemT = StartSystemType;
54 using StoredSystemT = StoredSystemType;
55 using StoredStartSystemT = StoredStartSystemType;
59 const D& AsDerived()
const
61 return static_cast<const D&
>(*this);
67 return static_cast<D&
>(*this);
76 return AsDerived().target_system_;
84 return AsDerived().homotopy_;
92 return AsDerived().start_system_;
102 AsDerived().target_system_ = sys;
110 AsDerived().homotopy_ = sys;
118 AsDerived().start_system_ = sys;
132 template<
typename SystemType,
typename StartSystemType>
133 struct CloneGiven :
public SysMgmtPolicy<CloneGiven<SystemType, StartSystemType>, SystemType, StartSystemType, SystemType, StartSystemType>
139 using StoredSystemT =
typename SMP::StoredSystemT;
140 using StoredStartSystemT =
typename SMP::StoredStartSystemT;
146 using SystemT = SystemType;
147 using StartSystemT = StartSystemType;
150 StoredSystemT target_system_;
151 StoredStartSystemT start_system_;
152 StoredSystemT homotopy_;
159 CloneGiven(SystemType
const& target) : target_system_(AtConstruct(target))
164 StoredSystemT AtConstruct(SystemType
const& sys)
192 static void FormStart(StartSystemType & start, SystemType
const& target)
194 start = StartSystemType(target);
198 void FormHomotopy(SystemType & homotopy, SystemType
const& target, StartSystemType
const& start, std::string
const& path_variable_name)
200 auto t = node::Variable::Make(path_variable_name);
203 homotopy.AddPathVariable(t);
234 return target_system_;
250 return start_system_;
262 template<
typename SystemType,
typename StartSystemType>
264 std::reference_wrapper< const SystemType>, std::reference_wrapper< const StartSystemType>>
267 std::reference_wrapper< const SystemType>, std::reference_wrapper< const StartSystemType>>;
270 using StoredSystemT =
typename SMP::StoredSystemT;
271 using StoredStartSystemT =
typename SMP::StoredStartSystemT;
279 StoredSystemT target_system_;
280 StoredStartSystemT start_system_;
281 StoredSystemT homotopy_;
288 RefToGiven(SystemType
const& target, StartSystemType
const& start, SystemType
const& hom)
290 target_system_(std::ref(target)),
291 start_system_(std::ref(start)),
292 homotopy_(std::ref(hom))
302 return std::ref(sys);
312 return std::ref(sys);
315 void SystemSetup(std::string
const& path_variable_name)
const
double D(double const &norm_J, double const &norm_J_inverse, AdaptiveMultiplePrecisionConfig const &_config)
Compute the expression from the AMP papers amp1, amp2.
Definition amp_criteria.hpp:88
static Rational Rand()
Get a random complex rational node. Numerator and denominator will have about 50 digits.
Definition number.hpp:343
static T AtSet(T const &sys)
Definition nag_algorithms/common/policies.hpp:175
void SystemSetup(std::string const &path_variable_name)
Sets up the homotopy for the system to be solved.
Definition nag_algorithms/common/policies.hpp:218
SystemT & TargetSystem()
Definition nag_algorithms/common/policies.hpp:232
StartSystemT & StartSystem()
Definition nag_algorithms/common/policies.hpp:248
static void PrepareTarget(SystemType &target)
Definition nag_algorithms/common/policies.hpp:185
SystemT & Homotopy()
Definition nag_algorithms/common/policies.hpp:240
CloneGiven(SystemType const &target)
Definition nag_algorithms/common/policies.hpp:159
RefToGiven(SystemType const &target, StartSystemType const &start, SystemType const &hom)
Definition nag_algorithms/common/policies.hpp:288
static T AtSet(T const &sys)
Store a reference to the argument system.
Definition nag_algorithms/common/policies.hpp:310
static StoredSystemT AtConstruct(SystemType const &sys)
Store a reference to the argument system.
Definition nag_algorithms/common/policies.hpp:300
A base class for system management for the zero-dim algorithm.
Definition nag_algorithms/common/policies.hpp:49
void StartSystem(StoredStartSystemT const &sys)
Definition nag_algorithms/common/policies.hpp:116
const StartSystemT & StartSystem() const
Definition nag_algorithms/common/policies.hpp:90
const SystemT & TargetSystem() const
Definition nag_algorithms/common/policies.hpp:74
void TargetSystem(StoredSystemT const &sys)
Definition nag_algorithms/common/policies.hpp:100
const SystemT & Homotopy() const
Definition nag_algorithms/common/policies.hpp:82
void Homotopy(StoredSystemT const &sys)
Definition nag_algorithms/common/policies.hpp:108
System Clone(System const &sys)
Do a deep clone of the system. This includes the entire structure, variables, etc....