:github_url: https://github.com/svenevs/exhale-companion .. _program_listing_file_ellip_profitmaxprob_2.cpp: Program Listing for File profitmaxprob_2.cpp ============================================ |exhale_lsh| :ref:`Return to documentation for file ` (``ellip/profitmaxprob_2.cpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #include "profitmaxprob.hpp" #include #include // aaf using ivt = yalaa::details::double_iv_t; using aaf = yalaa::aff_e_d; static const double ui = 0.5; static const double e1 = 0.003, e2 = 0.007; static const double e3 = 0.5, e4 = 0.5, e5 = 0.5, e6 = 0.5; template <> profit_max::profit_max() : gp_base() , p {ivt(20 - ui * e3, 20 + ui * e3)} , alpha {ivt(0.1 - ui * e1, 0.1 + ui * e1)} , beta {ivt(0.4 - ui * e2, 0.4 + ui * e2)} , v1 {ivt(10.0 - ui * e4, 10.0 + ui * e4)} , v2 {ivt(35.0 - ui * e5, 35.0 + ui * e5)} , k {ivt(40 - ui * e6, 40.0 + ui * e5)} , 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, 200.0); STATUS status = ellipsoid_dc(E, P, z, bf, 1000, 1e-6); if (status == FOUND) { std::cout << P.obj(z) << std::endl; } }