Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
zero_dim_solve.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//bertini2/nag_algorithms/zero_dim_solve.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//bertini2/nag_algorithms/zero_dim_solve.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 bertini2/nag_algorithms/zero_dim_solve.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// silviana amethyst, university of wisconsin-eau claire
24
30
31#pragma once
32
34
36#include "bertini2/tracking.hpp"
39
42
44#include "bertini2/nag_algorithms/common/config.hpp"
46#include <chrono>
47
48
49namespace bertini {
50
51 namespace algorithm {
52
53
57template< typename TrackerType, typename EndgameType,
58 typename SystemType, typename StartSystemType,
59 template<typename,typename> class SystemManagementP = policy::CloneGiven >
60struct ZeroDim;
61
62
63
67template<typename TrackerType, typename EndgameType,
68 typename SystemType, typename StartSystemType,
69 template<typename,typename> class SystemManagementP>
70struct AlgoTraits <ZeroDim<TrackerType, EndgameType, SystemType, StartSystemType, SystemManagementP>>
71{
72 using BaseRealType = typename tracking::TrackerTraits<TrackerType>::BaseRealType;
73 using BaseComplexType = typename tracking::TrackerTraits<TrackerType>::BaseComplexType;
74
75 using NeededConfigs = detail::TypeList<
76 TolerancesConfig,
77 PostProcessingConfig,
78 ZeroDimConfig<BaseComplexType>,
79 AutoRetrackConfig
80 >;
81};
82
83
84struct AnyZeroDim : public virtual AnyAlgorithm
85{
86 virtual ~AnyZeroDim() = default;
87};
88
89
90
91
92using SolnIndT = typename SolnCont<dbl_complex>::size_type;
93
94
96
98{
99
100 SolnIndT number_path_failures = 0;
101 SolnIndT number_path_successes = 0;
102 SolnIndT number_paths_tracked = 0;
103
104 std::chrono::system_clock::time_point start_time;
105 std::chrono::microseconds elapsed_time;
106};
107
108
109template<typename ComplexType>
110struct SolutionMetaData
111{
112 using SolnIndT = typename SolnCont<ComplexType>::size_type;
113
114 // only vaguely metadata. artifacts of randomness or ordering
115 SolnIndT path_index; // path number of the solution
116 SolnIndT solution_index; // solution number
117
119 bool precision_changed = false;
120 ComplexType time_of_first_prec_increase; // time value of the first increase in precision
121 decltype(DefaultPrecision()) max_precision_used = 0;
122
124 SuccessCode pre_endgame_success = SuccessCode::NeverStarted; // success code
125
126
128 NumErrorT condition_number; // the latest estimate on the condition number
129 NumErrorT newton_residual; // the latest newton residual
130 ComplexType final_time_used; // the final value of time tracked to
131 NumErrorT accuracy_estimate; // accuracy estimate between extrapolations
132 NumErrorT accuracy_estimate_user_coords; // accuracy estimate between extrapolations, in natural coordinates
133 unsigned cycle_num; // cycle number used in extrapolations
134 SuccessCode endgame_success = SuccessCode::NeverStarted; // success code
135
136
138 NumErrorT function_residual; // the latest function residual
139
140 int multiplicity = 1; // multiplicity
141 bool is_real; // real flag: 0 - not real, 1 - real
142 bool is_finite; // finite flag: -1 - no finite/infinite distinction, 0 - infinite, 1 - finite
143 bool is_singular; // singular flag: 0 - non-sigular, 1 - singular
144
145 bool operator==(const SolutionMetaData<ComplexType> & other){
146 bool result =
147 this->path_index == other.path_index
148 && this->solution_index == other.solution_index
149 && this->precision_changed == other.precision_changed
150 && this->time_of_first_prec_increase == other.time_of_first_prec_increase
151 && this->max_precision_used == other.max_precision_used
152 && this->pre_endgame_success == other.pre_endgame_success
153 && this->condition_number == other.condition_number
154 && this->newton_residual == other.newton_residual
155 && this->final_time_used == other.final_time_used
156 && this->accuracy_estimate == other.accuracy_estimate
157 && this->accuracy_estimate_user_coords == other.accuracy_estimate_user_coords
158 && this->cycle_num == other.cycle_num
159 && this->endgame_success == other.endgame_success
160 && this->function_residual == other.function_residual
161 && this->multiplicity == other.multiplicity
162 && this->is_real == other.is_real
163 && this->is_finite == other.is_finite
164 && this->is_singular == other.is_singular
165 ;
166
167 return result; }
168};
169
170// this is for interoperability with vectors of these in the Python bindings, for better or for worse.
171template<typename NumT>
172std::ostream& operator<<(std::ostream & out, const SolutionMetaData<NumT> & meta){
173 out << "path_index = " << meta.path_index << std::endl;
174 out << "solution_index = " << meta.solution_index << std::endl;
175
176 out << "precision_changed = " << meta.precision_changed << std::endl;
177 out << "time_of_first_prec_increase = " << meta.time_of_first_prec_increase << std::endl;
178 out << "max_precision_used = " << meta.max_precision_used << std::endl;
179
180 out << "pre_endgame_success = " << meta.pre_endgame_success << std::endl;
181
182 out << "condition_number = " << meta.condition_number << std::endl;
183 out << "newton_residual = " << meta.newton_residual << std::endl;
184 out << "final_time_used = " << meta.final_time_used << std::endl;
185 out << "accuracy_estimate = " << meta.accuracy_estimate << std::endl;
186 out << "accuracy_estimate_user_coords = " << meta.accuracy_estimate_user_coords << std::endl;
187 out << "cycle_num = " << meta.cycle_num << std::endl;
188 out << "endgame_success = " << meta.endgame_success << std::endl;
189
190 out << "function_residual = " << meta.function_residual << std::endl;
191
192 out << "multiplicity = " << meta.multiplicity << std::endl;
193 out << "is_real = " << meta.is_real << std::endl;
194 out << "is_finite = " << meta.is_finite << std::endl;
195 out << "is_singular = " << meta.is_singular << std::endl;
196
197 return out;
198}
199
200
201template<typename ComplexType>
202struct EGBoundaryMetaData
203{
204 using RealType = typename NumTraits<ComplexType>::Real;
205
206 Vec<ComplexType> path_point;
207 SuccessCode success_code = SuccessCode::NeverStarted;
208 RealType last_used_stepsize;
209
210 EGBoundaryMetaData() = default;
211 EGBoundaryMetaData(EGBoundaryMetaData const&) = default;
212 EGBoundaryMetaData(Vec<ComplexType> const& pt, SuccessCode const& code, RealType const& ss) :
213 path_point(pt), success_code(code), last_used_stepsize(ss)
214 {}
215
216 bool operator==(const EGBoundaryMetaData<ComplexType> & other){
217 bool result =
218 this->path_point == other.path_point
219 && this->success_code == other.success_code
220 && this->last_used_stepsize == other.last_used_stepsize
221 ;
222
223 return result;
224 }
225};
226
227// this is for interoperability with vectors of these in the Python bindings, for better or for worse.
228template<typename NumT>
229std::ostream& operator<<(std::ostream & out, const EGBoundaryMetaData<NumT> & meta){
230 out << "path_point = " << meta.path_point << std::endl;
231 out << "success_code = " << meta.success_code << std::endl;
232 out << "last_used_stepsize = " << meta.last_used_stepsize << std::endl;
233 return out;
234}
235
239 template< typename TrackerType, typename EndgameType,
240 typename SystemType, typename StartSystemType,
241 template<typename,typename> class SystemManagementP>
242 struct ZeroDim :
243 public virtual AnyZeroDim,
244 public Observable,
245 public SystemManagementP<SystemType, StartSystemType>,
246 public detail::Configured<
247 typename AlgoTraits< ZeroDim<TrackerType, EndgameType, SystemType, StartSystemType, SystemManagementP>>::NeededConfigs>
248 {
249 // these usings are for getters in python
250 using TrackerT = TrackerType;
251 using EndgameT = EndgameType;
252 using SystemT = SystemType;
253 using StartSystemT = StartSystemType;
254
255
256
257
259 using BaseComplexType = typename tracking::TrackerTraits<TrackerType>::BaseComplexType;
260 using BaseRealType = typename tracking::TrackerTraits<TrackerType>::BaseRealType;
261
262 using PrecisionConfig = typename tracking::TrackerTraits<TrackerType>::PrecisionConfig;
263
264 using SolnIndT = typename SolnCont<BaseComplexType>::size_type;
265
266 using SystemManagementPolicy = SystemManagementP<SystemType, StartSystemType>;
267
268 using StoredSystemT = typename SystemManagementPolicy::StoredSystemT;
269 using StoredStartSystemT = typename SystemManagementPolicy::StoredStartSystemT;
270
271
272 using Config = detail::Configured<
273 typename AlgoTraits<ZeroDim<TrackerType, EndgameType, SystemType, StartSystemType, SystemManagementP>>::NeededConfigs>;
274 using Config::Get;
275
276
277 using Tolerances = TolerancesConfig;
278 using PostProcessing = PostProcessingConfig;
279 using ZeroDimConf = ZeroDimConfig<BaseComplexType>;
280 using AutoRetrack = AutoRetrackConfig;
281
282
283 using EGBoundaryMetaDataT = EGBoundaryMetaData<BaseComplexType>;
284 using SolutionMetaDataT = SolutionMetaData<BaseComplexType>;
285
286
287// a few more using statements
288
289 using MidpathType = MidpathChecker<BaseRealType, BaseComplexType, EGBoundaryMetaData<BaseComplexType>>;
290
291 using SystemManagementPolicy::TargetSystem;
292 using SystemManagementPolicy::StartSystem;
293 using SystemManagementPolicy::Homotopy;
294
295
296
298
306 template<typename ... SysTs>
307 ZeroDim(SysTs const& ...sys) : SystemManagementPolicy(sys...), tracker_(TargetSystem()), endgame_(tracker_)
308 {
310 DefaultSetup();
311 }
312
313
317 void Run() override
318 {}
319
320 virtual ~ZeroDim() = default;
322
323
327 void ConsistencyCheck() const
328 {
329 if (TargetSystem().HavePathVariable())
330 throw std::runtime_error("unable to perform zero dim solve on target system -- has path variable, use user homotopy instead.");
331
332 if (TargetSystem().NumVariables() > TargetSystem().NumTotalFunctions())
333 throw std::runtime_error("unable to perform zero dim solve on target system -- underconstrained, so has no zero dimensional solutions.");
334
335 if (!TargetSystem().IsPolynomial())
336 throw std::runtime_error("unable to perform zero dim solve on target system -- system is non-polynomial, use user homotopy instead.");
337 }
338
339
340
341 void DefaultSetup()
342 {
344 DefaultSystemSetup();
347 }
348
349
350
351
352 void DefaultSystemSetup()
353 {
354 SystemManagementPolicy::SystemSetup(this->template Get<ZeroDimConf>().path_variable_name);
355 num_start_points_ = StartSystem().NumStartPoints(); // populate the internal variable
356 }
357
358
359
364 {
365 // this code can be made generic using Boost.Hana.
366 // see https://stackoverflow.com/questions/28764085/how-to-create-an-element-for-each-type-in-a-typelist-and-add-it-to-a-vector-in-c,
367 // for example
368 //
369 // all that would need to be done is to extract a hana::tuple_t from the
370 // typelist contained in this::Config, and then hana::for_each() over it.
371
372 this->template Set<Tolerances>(Tolerances());
373 this->template Set<PostProcessing>(PostProcessing());
374 this->template Set<ZeroDimConf>(ZeroDimConf());
375 this->template Set<AutoRetrack>(AutoRetrack());
376 }
377
378 void SetMidpathRetrackTol(NumErrorT const& rt)
379 {
380 midpath_retrack_tolerance_ = rt;
381 }
382
383 const auto& MidpathRetrackTol() const
384 {
385 return midpath_retrack_tolerance_;
386 }
387
388
393 {
394 midpath_ = MidpathType(MidPathConfig());
395 }
396
397
398 void SetMidpath(MidPathConfig const& mp)
399 {
400 midpath_.Set(mp);
401 }
402
409 {
410 tracker_.SetSystem(Homotopy());
412 this->template Get<Tolerances>().newton_before_endgame,
413 this->template Get<Tolerances>().path_truncation_threshold,
414 tracking::SteppingConfig(), tracking::NewtonConfig());
415
416 tracker_.PrecisionSetup(PrecisionConfig(Homotopy()));
417 }
418
419
429 void SetTracker(TrackerType const& new_tracker)
430 {
431 tracker_ = new_tracker;
432 endgame_.SetTracker(tracker_);
433 }
434
440 const TrackerType & GetTracker() const
441 {
442 return tracker_;
443 }
444
450 TrackerType & GetTracker()
451 {
452 return tracker_;
453 }
454
455
457
464 void SetEndgame(EndgameType const& new_endgame)
465 {
466 endgame_ = new_endgame;
467 }
468
474 const EndgameType & GetEndgame() const
475 {
476 return endgame_;
477 }
478
484 EndgameType & GetEndgame()
485 {
486 return endgame_;
487 }
488
489
490 template<typename T>
491 const T & GetFromEndgame() const
492 {
493 return endgame_.template Get<T>();
494 }
495
496 template<typename T>
497 void SetToEndgame(T const& t)
498 {
499 endgame_.Set(t);
500 }
501
503
504
505
519 void Solve()
520 {
521 PreSolveChecks();
522
523 PreSolveSetup();
524
525 TrackBeforeEG();
526
527 EGBoundaryAction();
528
529 TrackDuringEG();
530
531 PostEGAction();
532 }
533
534
535
536
540 const auto& FinalSolutions() const
541 {
542 return solutions_post_endgame_;
543 }
544
548 const auto& FinalSolutionMetadata() const
549 {
550 return solution_final_metadata_;
551 }
552
556 const auto& EndgameBoundaryData() const
557 {
558 return solutions_at_endgame_boundary_;
559 }
560
561 private:
562
566 void PreSolveChecks() const
567 {
568 if (num_start_points_ > solutions_at_endgame_boundary_.max_size())
569 throw std::runtime_error("start system has more solutions than container for results. I refuse to continue until this has been addressed.");
570 }
571
572
573 void PreSolveSetup()
574 {
575 auto num_as_size_t = static_cast<SolnIndT>(num_start_points_);
576
577 solution_final_metadata_.resize(num_as_size_t);
578 solutions_at_endgame_boundary_.resize(num_as_size_t);
579 solutions_post_endgame_.resize(num_as_size_t);
580
581 SetMidpathRetrackTol(this->template Get<Tolerances>().newton_before_endgame);
582 }
583
591 void TrackBeforeEG()
592 {
593 DefaultPrecision(this->template Get<ZeroDimConf>().initial_ambient_precision);
594
595 GetTracker().SetTrackingTolerance(this->template Get<Tolerances>().newton_before_endgame);
596
597 auto t_start = this->template Get<ZeroDimConf>().start_time;
598 auto t_endgame_boundary = this->template Get<ZeroDimConf>().endgame_boundary;
599
600 for (decltype(num_start_points_) ii{0}; ii < num_start_points_; ++ii)
601 {
602 TrackSinglePathBeforeEG(static_cast<SolnIndT>(ii));
603 }
604 }
605
606
607
611 void TrackSinglePathBeforeEG(SolnIndT soln_ind)
612 {
613 // if you can think of a way to replace this `if` with something meta, please do so.
614 if (tracking::TrackerTraits<TrackerType>::IsAdaptivePrec)
615 {
616 GetTracker().AddObserver(first_prec_rec_);
617 GetTracker().AddObserver(min_max_prec_);
618 }
619
620 auto& smd = solution_final_metadata_[soln_ind];
621
622 smd.path_index = soln_ind;
623 smd.solution_index = soln_ind;
624
625 DefaultPrecision(this->template Get<ZeroDimConf>().initial_ambient_precision);
626 auto t_start = this->template Get<ZeroDimConf>().start_time;
627 auto t_endgame_boundary = this->template Get<ZeroDimConf>().endgame_boundary;
628 auto start_point = StartSystem().template StartPoint<BaseComplexType>(soln_ind);
629
630 Vec<BaseComplexType> result;
631 auto tracking_success = GetTracker().TrackPath(result, t_start, t_endgame_boundary, start_point);
632
633 solutions_at_endgame_boundary_[soln_ind] = EGBoundaryMetaDataT({ result, tracking_success, GetTracker().CurrentStepsize() });
634
635 smd.pre_endgame_success = tracking_success;
636
637 // if you can think of a way to replace this `if` with something meta, please do so.
638 if (tracking::TrackerTraits<TrackerType>::IsAdaptivePrec)
639 {
640 if (first_prec_rec_.DidPrecisionIncrease())
641 {
642 smd.precision_changed = true;
643 smd.time_of_first_prec_increase = first_prec_rec_.TimeOfIncrease();
644 }
645 else
646 GetTracker().RemoveObserver(first_prec_rec_);
647 GetTracker().RemoveObserver(min_max_prec_);
648 using std::max;
649 smd.max_precision_used =
650 max(smd.max_precision_used, min_max_prec_.MaxPrecision());
651 }
652
653
654 }
655
656 void EGBoundaryAction()
657 {
658 auto midcheckpassed = midpath_.Check(solutions_at_endgame_boundary_, StartSystem());
659
660 unsigned num_resolve_attempts = 0;
661 while (!midcheckpassed && num_resolve_attempts < this->template Get<ZeroDimConf>().max_num_crossed_path_resolve_attempts)
662 {
663 MidpathResolve();
664 midcheckpassed = midpath_.Check(solutions_at_endgame_boundary_, StartSystem());
665 num_resolve_attempts++;
666 }
667 }
668
669
670 void MidpathResolve()
671 {
672 ShrinkMidpathTolerance();
673
674 for(auto const& v : midpath_.GetCrossedPaths())
675 {
676 if(v.rerun())
677 {
678 unsigned long long index = v.index();
679 auto soln_ind = static_cast<SolnIndT>(index);
680 TrackSinglePathBeforeEG(soln_ind);
681 }
682 }
683
684 }
685
686
687 void ShrinkMidpathTolerance()
688 {
689 midpath_retrack_tolerance_ *= this->template Get<AutoRetrack>().midpath_decrease_tolerance_factor;
690 GetTracker().SetTrackingTolerance(midpath_retrack_tolerance_);
691 }
692
693
694
695 void TrackDuringEG()
696 {
697
698 GetTracker().SetTrackingTolerance(this->template Get<Tolerances>().newton_during_endgame);
699
700 for (decltype(num_start_points_) ii{0}; ii < num_start_points_; ++ii)
701 {
702 auto soln_ind = static_cast<SolnIndT>(ii);
703
704 if (solution_final_metadata_[soln_ind].pre_endgame_success != SuccessCode::Success)
705 continue;
706
707 TrackSinglePathDuringEG(soln_ind);
708 }
709 }
710
711
712 void TrackSinglePathDuringEG(SolnIndT soln_ind)
713 {
714
715 auto& smd = solution_final_metadata_[soln_ind];
716 // if you can think of a way to replace this `if` with something meta, please do so.
717 if (tracking::TrackerTraits<TrackerType>::IsAdaptivePrec)
718 {
719 if (!smd.precision_changed)
720 GetTracker().AddObserver(first_prec_rec_);
721 GetTracker().AddObserver(min_max_prec_);
722 }
723
724 const auto& bdry_point = solutions_at_endgame_boundary_[soln_ind].path_point;
725
726
727 GetTracker().SetStepSize(solutions_at_endgame_boundary_[soln_ind].last_used_stepsize);
728 GetTracker().ReinitializeInitialStepSize(false);
729
730 DefaultPrecision(Precision(bdry_point));
731 // we make these fresh so they are in the correct precision to start.
732 BaseComplexType t_end = this->template Get<ZeroDimConf>().target_time;
733 BaseComplexType t_endgame_boundary = this->template Get<ZeroDimConf>().endgame_boundary;
734
735 auto eg_success = GetEndgame().Run(t_endgame_boundary, bdry_point, t_end);
736
737 solutions_post_endgame_[soln_ind] = GetEndgame().template FinalApproximation<BaseComplexType>();
738
739
740 // finally, store the metadata as necessary
741 smd.endgame_success = eg_success;
742 // if you can think of a way to replace this `if` with something meta, please do so.
743 if (tracking::TrackerTraits<TrackerType>::IsAdaptivePrec)
744 {
745 if (!smd.precision_changed)
746 {
747 if (first_prec_rec_.DidPrecisionIncrease())
748 {
749 smd.precision_changed = true;
750 smd.time_of_first_prec_increase = first_prec_rec_.TimeOfIncrease();
751 }
752 }
753 GetTracker().RemoveObserver(first_prec_rec_);
754 GetTracker().RemoveObserver(min_max_prec_);
755 using std::max;
756 smd.max_precision_used =
757 max(smd.max_precision_used, min_max_prec_.MaxPrecision());
758 }
759 if (tracking::TrackerTraits<TrackerType>::IsAdaptivePrec)
760 {
761 assert(Precision(solutions_post_endgame_[soln_ind])==Precision(GetEndgame().template FinalApproximation<BaseComplexType>()));
762 DefaultPrecision(Precision(solutions_post_endgame_[soln_ind]));
763 TargetSystem().precision(Precision(solutions_post_endgame_[soln_ind]));
764 }
765 smd.function_residual = static_cast<NumErrorT>(TargetSystem().Eval(solutions_post_endgame_[soln_ind]).template lpNorm<Eigen::Infinity>());
766 smd.final_time_used = GetEndgame().LatestTime();
767 smd.condition_number = GetTracker().LatestConditionNumber();
768 smd.newton_residual = GetTracker().LatestNormOfStep();
769
770 smd.accuracy_estimate = GetEndgame().ApproximateError();
771 smd.accuracy_estimate_user_coords =
772 static_cast<NumErrorT>( (TargetSystem().DehomogenizePoint(solutions_post_endgame_[soln_ind]) -
773 TargetSystem().DehomogenizePoint(GetEndgame().template PreviousApproximation<BaseComplexType>())).template lpNorm<Eigen::Infinity>() );
774 smd.cycle_num = GetEndgame().CycleNumber();
775 // end metadata gathering
776 }
777
778
779
780 void PostEGAction()
781 {
782 ComputePostTrackMetadata();
783 }
784
785
786
792 void ComputePostTrackMetadata()
793 {
794 ComputeMultiplicities();
795 }
796
797 void ComputeMultiplicities()
798 {
799 std::vector<std::vector<int>> multiplicity_indices(num_start_points_);
800
801 for (decltype(num_start_points_) ii{0}; ii < num_start_points_; ++ii)
802 {
803 if (solution_final_metadata_[ii].endgame_success!=SuccessCode::Success)
804 continue;
805
806 for (decltype(num_start_points_) jj{ii+1}; jj < num_start_points_; ++jj)
807 {
808 if (solution_final_metadata_[jj].endgame_success!=SuccessCode::Success)
809 continue;
810
811 if ( (solutions_post_endgame_[ii] - solutions_post_endgame_[jj]).norm() < this->template Get<PostProcessing>().same_point_tolerance)
812 {
813 multiplicity_indices[ii].push_back(jj);
814 multiplicity_indices[jj].push_back(ii);
815 ++solution_final_metadata_[ii].multiplicity;
816 ++solution_final_metadata_[jj].multiplicity;
817 }
818 }
819 }
820 }
821
822
823
825 // private data members
827
828 unsigned long long num_start_points_;
829 NumErrorT midpath_retrack_tolerance_;
830
831
833 // i feel like these should be factored out into some policy class which prescribes how they are used, so that the actions taken are customizable.
834 tracking::FirstPrecisionRecorder<TrackerType> first_prec_rec_;
835 tracking::MinMaxPrecisionRecorder<TrackerType> min_max_prec_;
836
837
839 TrackerType tracker_;
840 EndgameType endgame_;
841 MidpathType midpath_;
842
843
844
846 SolnCont< EGBoundaryMetaDataT > solutions_at_endgame_boundary_; // the BaseRealType is the last used stepsize
847 SolnCont<Vec<BaseComplexType> > solutions_post_endgame_;
848 SolnCont<SolutionMetaDataT> solution_final_metadata_;
849
850
851 }; // struct ZeroDim
852
853 } // ns algo
854
855} // ns bertini
provides a common base type for algorithms to inherit from, for the abstraction layer above for calli...
Predictor DefaultPredictor()
Get the Bertini2 default predictor.
Definition base_predictor.hpp:58
An abstract observable type, maintaining a list of observers, who can be notified in case of Events.
Definition observable.hpp:48
Contains the detail/configured helper type, for templated getting/setting/storage of config structs.
unsigned Precision(Eigen::MatrixBase< Derived > const &v)
Get the precision of an Eigen object. If the object is empty, it's the precision of a default-constru...
Definition eigen_extensions.hpp:292
Provides the generators for bertini2.
Provides methods for checking for path crossings.
T max(T const &a, T const &b, T const &c)
Three-argument form of max.
Definition mpfr_extensions.hpp:98
Provides some policies for the zero dim algorithm.
Provides an Eigen-like NumTraits struct for querying traits of a number type.
Contains the observable base types.
metadata structs
Definition zero_dim_solve.hpp:98
the basic zero dim algorithm, which solves a system.
Definition zero_dim_solve.hpp:248
void Run() override
Main Run() function provided for calling from the blackbox mode.
Definition zero_dim_solve.hpp:317
EndgameType & GetEndgame()
Gets the endgame.
Definition zero_dim_solve.hpp:484
const TrackerType & GetTracker() const
Gets the tracker.
Definition zero_dim_solve.hpp:440
void Solve()
the main functions
Definition zero_dim_solve.hpp:519
void ConsistencyCheck() const
setup functions
Definition zero_dim_solve.hpp:327
void SetEndgame(EndgameType const &new_endgame)
endgame specific stuff
Definition zero_dim_solve.hpp:464
const EndgameType & GetEndgame() const
Gets the endgame.
Definition zero_dim_solve.hpp:474
void DefaultTrackerSetup()
Takes the default action to set up the zero dim algorithm with the default constructed tracker.
Definition zero_dim_solve.hpp:408
TrackerType & GetTracker()
Gets the tracker.
Definition zero_dim_solve.hpp:450
const auto & FinalSolutions() const
Get the final computed solutions.
Definition zero_dim_solve.hpp:540
void SetTracker(TrackerType const &new_tracker)
Sets the tracker to one you supply to this function.
Definition zero_dim_solve.hpp:429
const auto & FinalSolutionMetadata() const
Get the metadat associated with the final computed solutions.
Definition zero_dim_solve.hpp:548
typename tracking::TrackerTraits< A >::BaseComplexType BaseComplexType
Definition zero_dim_solve.hpp:259
void DefaultMidpathSetup()
Definition zero_dim_solve.hpp:392
ZeroDim(SysTs const &...sys)
constructors
Definition zero_dim_solve.hpp:307
void DefaultSettingsSetup()
Definition zero_dim_solve.hpp:363
const auto & EndgameBoundaryData() const
Get the solutions as computed at the endgame boundary.
Definition zero_dim_solve.hpp:556
Definition configured.hpp:89
A basic typelist, in the style of Modern C++ Design, but using variadic templates.
Definition typelist.hpp:46
Includes all files for tracking in Bertini2.
Contains the visitable base types.