:github_url: https://github.com/svenevs/exhale-companion .. _program_listing_file_ellip_profitmaxprob.cpp: Program Listing for File profitmaxprob.cpp ========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``ellip/profitmaxprob.cpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #include "profitmaxprob.hpp" #include template <> profit_max::profit_max() : gp_base() , p {20.0} , alpha {0.1} , beta {0.4} , v1 {10.0} , v2 {35.0} , k {40} , A {40.0} , cd(3) { gp_setup(); } template <> profit_max::~profit_max() { } int main() { profit_max P; std::valarray z = {0.0, 1.0, 1.0}; z[0] = log(P.obj(z)); double bf; // for output ellipsoid E {z, 150}; STATUS status = ellipsoid_dc(E, P, z, bf, 1000, 1e-8); if (status == FOUND) { std::cout << exp(z[0]) << std::endl; std::cout << P.obj(z) << std::endl; } }