13#include "../round_robin.hpp"
40 using Vec = std::valarray<double>;
41 using Cut = std::pair<Vec, double>;
47 double _log_Cobb = 0.0;
59 auto _constraint_capacity(
const Vec&
y,
const Vec&,
const double) -> Cut*;
69 auto _constraint_profit(
const Vec&
y,
const Vec&
x,
const double gamma) -> Cut*;
82 : _log_pA{
std::
log(
p * A)}, _log_k{
std::
log(
k)}, _price_out{
v}, _elasticities{
a} {}
140 using Vec = std::valarray<double>;
141 using Cut = std::pair<Vec, double>;
161 : _uie{
e}, _elasticities{
a}, P(
p -
e3, A,
k -
e3,
a,
v + Vec{
e3,
e3}) {}
173 auto a_rb = this->_elasticities;
174 a_rb[0] +=
y[0] > 0.0 ? -this->_uie[0] : this->_uie[0];
175 a_rb[1] +=
y[1] > 0.0 ? -this->_uie[1] : this->_uie[1];
202 using Vec = std::valarray<double>;
203 using Cut = std::pair<Vec, double>;
231 -> std::tuple<Cut, bool, Vec, bool>;
Arr log(const Arr &a)
Element-wise natural logarithm.
Definition arr.hpp:235
Oracle for profit maximization problem (discrete version)
Definition profit_oracle.hpp:201
auto assess_optim_q(const Vec &y, double &gamma, bool retry) -> std::tuple< Cut, bool, Vec, bool >
Make object callable for cutting_plane_optim_q()
ProfitOracleQ(double p, double A, double k, const Vec &a, const Vec &v)
Construct a new profit q oracle object.
Definition profit_oracle.hpp:218
Oracle for a profit maximization problem (robust version)
Definition profit_oracle.hpp:139
auto assess_optim(const Vec &y, double &gamma) -> std::tuple< Cut, bool >
Make object callable for cutting_plane_optim()
Definition profit_oracle.hpp:172
ProfitOracleRb(double p, double A, double k, const Vec &a, const Vec &v, const Vec &e, double e3)
Construct a new profit rb oracle object.
Definition profit_oracle.hpp:159
Oracle for a profit maximization problem.
Definition profit_oracle.hpp:39
ProfitOracle(ProfitOracle &&)=delete
ProfitOracle(const ProfitOracle &)=delete
Construct a new profit oracle object (only explicitly)
auto set_elasticities(const Vec &elasticities)
Definition profit_oracle.hpp:99
ProfitOracle & operator=(ProfitOracle &&)=delete
ProfitOracle & operator=(const ProfitOracle &)=delete
auto assess_optim(const Vec &y, double &gamma) -> std::tuple< Cut, bool >
auto assess_feas(const Vec &y, const double &gamma) -> Cut *
Assess feasibility of a given input quantity.
ProfitOracle(double p, double A, double k, const Vec &a, const Vec &v)
Construct a new profit oracle object.
Definition profit_oracle.hpp:81
Round-robin index generator over a half-open range [lo, hi)
Definition round_robin.hpp:18
auto invalid_value() -> T
Return an invalid/sentinel value for type T.
Definition cutting_plane.hpp:27