//This file is part of Bertini 2. // //python/tracker.hpp is free software: you can redistribute it and/or modify //it under the terms of the GNU General Public License as published by //the Free Software Foundation, either version 3 of the License, or //(at your option) any later version. // //python/tracker.hpp is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //GNU General Public License for more details. // //You should have received a copy of the GNU General Public License //along with python/tracker.hpp. If not, see . // // Copyright(C) 2016-2018 by Bertini2 Development Team // // See for a copy of the license, // as well as COPYING. Bertini2 is provided with permitted // additional terms in the b2/licenses/ directory. // individual authors of this file include: // // silviana amethyst // University of Notre Dame // Summer 2016, Spring 2018 // // James Collins // West Texas A&M University // Summer 2016 // // // // python/tracker.hpp: Header file for exposing trackers to python. #pragma once #include "python_common.hpp" #include "generic_observable.hpp" #include namespace bertini{ namespace python{ using namespace bertini::tracking; /** Abstract Tracker class */ template class TrackerVisitor: public def_visitor > { friend class def_visitor_access; public: template void visit(PyClass& cl) const; private: using CT = typename TrackerTraits::BaseComplexType; using RT = typename TrackerTraits::BaseRealType; // resolve overloads for getting and setting predictor method. void (TrackerT::*set_predictor_)(Predictor)= &TrackerT::SetPredictor; Predictor (TrackerT::*get_predictor_)(void) const = &TrackerT::GetPredictor; static SuccessCode track_path_wrap(TrackerT const& self, Eigen::Ref> result, CT const& start_time, CT const& end_time, Vec const& start_point) { Vec temp_result(self.GetSystem().NumVariables()); auto code = self.TrackPath(temp_result, start_time, end_time, start_point); result = temp_result; return code; } };// TrackerVisitor class /** AMP Tracker class */ template class AMPTrackerVisitor: public def_visitor > { friend class def_visitor_access; public: template void visit(PyClass& cl) const; private: // resolve overloads for refining a point. template using Refine3_ptr = SuccessCode (TrackerT::*)(Vec&, Vec const&, T const&) const; template static Refine3_ptr return_Refine3_ptr() { return &TrackerT::template Refine; }; template using Refine4_ptr = SuccessCode (TrackerT::*)(Vec&, Vec const&, ComplexT const&, double const&, unsigned) const; template static Refine4_ptr return_Refine4_ptr() { return &TrackerT::template Refine; }; };// AMPTrackerVisitor class /** Fixed Double Tracker class */ template class FixedDoubleTrackerVisitor: public def_visitor > { friend class def_visitor_access; public: template void visit(PyClass& cl) const; private: // resolve overloads for refining a point. template using Refine3_ptr = SuccessCode (TrackerT::*)(Vec&, Vec const&, T const&) const; template static Refine3_ptr return_Refine3_ptr() { return &TrackerT::template Refine; }; template using Refine4_ptr = SuccessCode (TrackerT::*)(Vec&, Vec const&, ComplexT const&, double const&, unsigned) const; template static Refine4_ptr return_Refine4_ptr() { return &TrackerT::template Refine; }; };// FixedDoubleTrackerVisitor class /** Fixed Multiple Tracker class */ template class FixedMultipleTrackerVisitor: public def_visitor > { friend class def_visitor_access; public: template void visit(PyClass& cl) const; private: // resolve overloads for refining a point. template using Refine3_ptr = SuccessCode (TrackerT::*)(Vec&, Vec const&, T const&) const; template static Refine3_ptr return_Refine3_ptr() { return &TrackerT::template Refine; }; template using Refine4_ptr = SuccessCode (TrackerT::*)(Vec&, Vec const&, ComplexT const&, double const&, unsigned) const; template static Refine4_ptr return_Refine4_ptr() { return &TrackerT::template Refine; }; };// FixedMultipleTrackerVisitor class /** Stepping struct */ template class SteppingVisitor: public def_visitor > { friend class def_visitor_access; public: template void visit(PyClass& cl) const; };// SteppingVisitor class // template // class TolerancesVisitor: public def_visitor > // { // friend class def_visitor_access; // public: // template // void visit(PyClass& cl) const // { // cl // .def_readwrite("newton_before_endgame", &Tolerances::newton_before_endgame) // .def_readwrite("newton_during_endgame", &Tolerances::newton_during_endgame) // .def_readwrite("final_tolerance", &Tolerances::final_tolerance) // .def_readwrite("final_tolerance_multiplier", &Tolerances::final_tolerance_multiplier) // .def_readwrite("path_truncation_threshold", &Tolerances::path_truncation_threshold) // .def_readwrite("final_tolerance_times_final_tolerance_multiplier", &Tolerances::final_tolerance_times_final_tolerance_multiplier) // ; // } // }; // now prototypes for expose functions defined in the .cpp files for the python bindings. void ExportTrackers(); void ExportAMPTracker(); void ExportFixedTrackers(); void ExportFixedDoubleTracker(); void ExportFixedMultipleTracker(); void ExportConfigSettings(); }}// re: namespaces