:github_url: https://github.com/svenevs/exhale-companion .. _program_listing_file_ellip_gp_solve.cpp: Program Listing for File gp_solve.cpp ===================================== |exhale_lsh| :ref:`Return to documentation for file ` (``ellip/gp_solve.cpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #include "gp_solve.hpp" using Vec = std::valarray; template <> Info4EM gp_base::operator()(const Vec& x) const { double f; Vec g(x.size()); for (auto i = 1; i != _M.size(); ++i) { g = _M[i].lse_gradient(x, f); if (f > 0) return {false, g, f, x}; } g = _M[0].lse_gradient(x, f); return {true, g, f, x}; }