.. index:: pair: struct; funcmin::RgminNlmlCtx .. _doxid-structfuncmin_1_1_rgmin_nlml_ctx: template struct funcmin::RgminNlmlCtx ===================================== .. toctree:: :hidden: struct_funcmin_RgminNlmlCtx_Sample.rst Overview ~~~~~~~~ Synchronous objective view shared by the SCG and gradient-only adapters. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include template struct RgminNlmlCtx { // structs struct :ref:`Sample`; // fields const :ref:`gpr::EigenMatrix`& :target:`x`; const Eigen::VectorXd& :target:`x_ind`; const Eigen::VectorXd& :target:`y`; ClassName& :target:`holder`; const FuncName :target:`func`; const :ref:`MapObjectiveConfig`& :target:`map_cfg`; const bool :target:`exact_curvature`; bool :target:`trace_evaluations` = false; bool :ref:`hessian_vector_fallback` = false; :ref:`RgminCallbackFailure` :target:`failure`; // construction :target:`RgminNlmlCtx`(const :ref:`gpr::EigenMatrix`& positions, const Eigen::VectorXd& indices, const Eigen::VectorXd& targets, ClassName& model, FuncName objective, const :ref:`MapObjectiveConfig`& configuration, bool use_exact_curvature, bool retain_step_samples = false, std::function stop_requested = {}); // methods rgmin_status_t :target:`captureCallbackError`(const char* callback); void :ref:`pinAt`(const Eigen::VectorXd& w); std::size_t :target:`logicalObjectiveWork`() const; std::size_t :target:`physicalObjectiveWork`() const; const :ref:`Sample`& :target:`evalAt`(const Eigen::VectorXd& w); rgmin_status_t :ref:`restoreHolderAt`(const Eigen::VectorXd& w); }; .. _details-structfuncmin_1_1_rgmin_nlml_ctx: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Synchronous objective view shared by the SCG and gradient-only adapters. Input arrays, the model and the member function remain valid for the whole minimize/step call. Model mutation belongs to the objective; coordinate publication belongs to the optimizer adapter after callback success. Fields ------ .. index:: pair: variable; hessian_vector_fallback .. _doxid-structfuncmin_1_1_rgmin_nlml_ctx_1a987c8b0b27d621c5cfdaef442fa03376: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool hessian_vector_fallback = false Set once the NLML Hessian-vector curvature callback has declined; rgmin then probes the gradient for every later curvature. Methods ------- .. index:: pair: function; pinAt .. _doxid-structfuncmin_1_1_rgmin_nlml_ctx_1a5ca81a191a9edc8885b8a94606d6188f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void pinAt(const Eigen::VectorXd& w) Pin only an evaluated sample; a step boundary never calls the holder. The first successful callback also pins a box-projected opening point. .. index:: pair: function; restoreHolderAt .. _doxid-structfuncmin_1_1_rgmin_nlml_ctx_1aa7dbe13d978ec762d530cc8833e40aa4: .. ref-code-block:: cpp :class: doxyrest-title-code-block rgmin_status_t restoreHolderAt(const Eigen::VectorXd& w) Cached first-order values do not restore mutable posterior state. This physical evaluation is separate from the solver's request budget.