![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Classes | |
| struct | Mamap22RepairCoef |
| The bilinear program's data: (q_a, q_b) = alpha + beta x + gamma q_free, and q_free (d1 x + d0) = n2 x^2 + n1 x + n0 + c s. More... | |
| struct | Mamap22RepairSide |
| The optimum of one side of the repair. More... | |
| struct | Mamap22RepairChoice |
| What the hybrid selector chose: the trivial marking q1 = q2 = q3 = p, or the closed-form inverse evaluated at (x, s). More... | |
Functions | |
| std::vector< double > | real_roots (const std::vector< double > &cin) |
| Real roots of c[0] + c[1] x + c[2] x^2 + c[3] x^3 (degree <= 3; shorter inputs are zero padded). | |
| std::vector< double > | polymul (const std::vector< double > &a, const std::vector< double > &b) |
| Product of two coefficient vectors (lowest degree first). | |
| std::vector< double > | polysub (const std::vector< double > &a, const std::vector< double > &b) |
| Difference of two coefficient vectors (lowest degree first). | |
| bool | repair_evaluate (const Mamap22RepairCoef &k, double X, double St, double wx, double ws, double xlo, double xhi, double xin, double *obj, double *xout, double *sout) |
| Inner problem of the repair at a fixed x; false when x is infeasible. | |
| Mamap22RepairSide | bilinear_repair (const Mamap22RepairCoef &k, double X, double St, double wx, double ws, double xlo, double xhi) |
| Global optimum of the hybrid-space repair on xlo <= x <= xhi (xhi may be +infinity). | |
| Mamap22RepairChoice | hybrid_repair (const Mamap22RepairCoef &k, double X, double St, double wx, double ws, double M1, double p0) |
| The reference's solve_nonlinear('hybrid'): trivial vs left vs right. | |
|
inline |
Global optimum of the hybrid-space repair on xlo <= x <= xhi (xhi may be +infinity).
See the file comment for the program and why the candidate set below contains its minimizer.
Definition at line 211 of file mamap22_repair.h.
References line::mam::mamap22detail::Mamap22RepairCoef::alpha, line::mam::mamap22detail::Mamap22RepairCoef::beta, bilinear_repair(), line::mam::mamap22detail::Mamap22RepairCoef::c, line::mam::mamap22detail::Mamap22RepairCoef::d0, line::mam::mamap22detail::Mamap22RepairCoef::d1, line::mam::mamap22detail::Mamap22RepairSide::feasible, line::mam::mamap22detail::Mamap22RepairCoef::gamma, line::mam::mamap22detail::Mamap22RepairCoef::n0, line::mam::mamap22detail::Mamap22RepairCoef::n1, line::mam::mamap22detail::Mamap22RepairCoef::n2, line::mam::mamap22detail::Mamap22RepairSide::obj, polymul(), polysub(), real_roots(), repair_evaluate(), line::mam::mamap22detail::Mamap22RepairSide::s, and line::mam::mamap22detail::Mamap22RepairSide::x.
Referenced by bilinear_repair(), and hybrid_repair().
|
inline |
The reference's solve_nonlinear('hybrid'): trivial vs left vs right.
The left side keeps the moment in [0, M1 - tol], the right side in [M1 + tol, +inf), and the trivial marking (all p0: moment M1, sigma p0^2) wins ties. An infeasible side scores +infinity, so a feasible side is never preferred over a better trivial marking merely because the other side is infeasible.
Definition at line 298 of file mamap22_repair.h.
References bilinear_repair(), line::mam::mamap22detail::Mamap22RepairSide::feasible, hybrid_repair(), line::mam::mamap22detail::Mamap22RepairSide::obj, line::mam::mamap22detail::Mamap22RepairChoice::s, line::mam::mamap22detail::Mamap22RepairSide::s, line::mam::mamap22detail::Mamap22RepairChoice::trivial, line::mam::mamap22detail::Mamap22RepairChoice::x, and line::mam::mamap22detail::Mamap22RepairSide::x.
Referenced by hybrid_repair(), line::mam::mamap22_fit_bs_multiclass(), and line::mam::mamap22_fit_fs_multiclass().
|
inline |
Product of two coefficient vectors (lowest degree first).
Definition at line 141 of file mamap22_repair.h.
References polymul().
Referenced by bilinear_repair(), and polymul().
|
inline |
Difference of two coefficient vectors (lowest degree first).
Definition at line 149 of file mamap22_repair.h.
References polysub().
Referenced by bilinear_repair(), and polysub().
|
inline |
Real roots of c[0] + c[1] x + c[2] x^2 + c[3] x^3 (degree <= 3; shorter inputs are zero padded).
Leading coefficients negligible against the largest one are dropped; the cubic is solved by Cardano/Viete and every root polished by two Newton steps. Empty for the zero (or constant) polynomial.
Definition at line 85 of file mamap22_repair.h.
References real_roots().
Referenced by bilinear_repair(), and real_roots().
|
inline |
Inner problem of the repair at a fixed x; false when x is infeasible.
Definition at line 158 of file mamap22_repair.h.
References line::mam::mamap22detail::Mamap22RepairCoef::alpha, line::mam::mamap22detail::Mamap22RepairCoef::beta, line::mam::mamap22detail::Mamap22RepairCoef::c, line::mam::mamap22detail::Mamap22RepairCoef::d0, line::mam::mamap22detail::Mamap22RepairCoef::d1, line::mam::mamap22detail::Mamap22RepairCoef::gamma, line::mam::mamap22detail::Mamap22RepairCoef::n0, line::mam::mamap22detail::Mamap22RepairCoef::n1, line::mam::mamap22detail::Mamap22RepairCoef::n2, and repair_evaluate().
Referenced by bilinear_repair(), and repair_evaluate().