![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
M3PP(2, m) fitted to counting-process characteristics with an optimized per-class split (matlab/lib/m3a/m3a/m3pp/m3pp2m_fitc_approx.m, matlab/lib/m3a/m3a/m3pp/m3pp2m_fitc_approx_ag.m, matlab/lib/m3a/m3a/m3pp/m3pp2m_fitc_approx_ag_multiclass.m). More...
#include <cstddef>#include <vector>#include "line/api/mam/map_fit_detail.h"#include "line/api/mam/map_moment.h"#include "line/api/mam/map_transform.h"#include "line/api/mam/mmap_lambda.h"#include "line/api/mam/mmpp2_fitc_approx.h"#include "line/num/number.h"#include "line/util/auglag.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::mam::M3pp2mFitcApproxResult< T > |
| Result of the optimization-based M3PP(2, m) fits. More... | |
Namespaces | |
| namespace | line |
| namespace | line::mam |
Functions | |
| template<class T> | |
| Mmap< T > | line::mam::m3pp2m_assemble (const Map< T > &base, const std::vector< T > &q1, const std::vector< T > &q2) |
| Assemble the M3PP from an underlying MAP and the per-phase marking probabilities. | |
| template<class T> | |
| M3pp2mFitcApproxResult< T > | line::mam::m3pp2m_fitc_approx (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const std::vector< T > &ai, const std::vector< T > &dvt3, const T &t3, const std::vector< Bound< T > > &bounds, const AugLagOptions< T > &opt) |
| m3pp2m_fitc_approx: fit the underlying MMPP(2) by optimization, then split the classes on their variance DIFFERENCES at t3. | |
| template<class T> | |
| M3pp2mFitcApproxResult< T > | line::mam::m3pp2m_fitc_approx (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const std::vector< T > &ai, const std::vector< T > &dvt3, const T &t3) |
| m3pp2m_fitc_approx with no box on the free variables and the default tuning. | |
| template<class T> | |
| M3pp2mFitcApproxResult< T > | line::mam::m3pp2m_fitc_approx_ag_multiclass (const Map< T > &mmpp, const std::vector< T > &ai, const std::vector< T > >3, const T &t3, const std::vector< Bound< T > > &bounds, const AugLagOptions< T > &opt) |
| m3pp2m_fitc_approx_ag_multiclass: split a GIVEN MMPP(2) into m classes on their variance-plus-covariance at t3. | |
| template<class T> | |
| M3pp2mFitcApproxResult< T > | line::mam::m3pp2m_fitc_approx_ag_multiclass (const Map< T > &mmpp, const std::vector< T > &ai, const std::vector< T > >3, const T &t3) |
| m3pp2m_fitc_approx_ag_multiclass with no box and the default tuning. | |
| template<class T> | |
| M3pp2mFitcApproxResult< T > | line::mam::m3pp2m_fitc_approx_ag (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const std::vector< T > &ai, const std::vector< T > >3, const T &t3, const std::vector< Bound< T > > &bounds, const AugLagOptions< T > &opt) |
| m3pp2m_fitc_approx_ag: fit the underlying MMPP(2) by optimization, then apply the 'ag' per-class split. | |
| template<class T> | |
| M3pp2mFitcApproxResult< T > | line::mam::m3pp2m_fitc_approx_ag (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const std::vector< T > &ai, const std::vector< T > >3, const T &t3) |
| m3pp2m_fitc_approx_ag with no box and the default tuning. | |
M3PP(2, m) fitted to counting-process characteristics with an optimized per-class split (matlab/lib/m3a/m3a/m3pp/m3pp2m_fitc_approx.m, matlab/lib/m3a/m3a/m3pp/m3pp2m_fitc_approx_ag.m, matlab/lib/m3a/m3a/m3pp/m3pp2m_fitc_approx_ag_multiclass.m).
The underlying MMPP(2) comes from mmpp2_fitc_approx. The per-class split is then a pair of per-phase marking probabilities (q1i, q2i) per class, each an AFFINE function of the class rate ai (matched exactly) and of one free per-class quantity:
min sum_i (x_i / target_i - 1)^2 s.t. q1i(x_i) >= 0, q2i(x_i) >= 0 for every class i sum_i q1i(x_i) = 1, sum_i q2i(x_i) = 1
(the reference writes the objective as 1/2 x'Hx + f'x with H = diag(2/t_i^2) and f_i = -2/t_i, which is the expansion of the sum above minus the constant m; its reported fit_error = fx + m is therefore exactly the sum above, and that is what M3pp2mFitcApproxResult::class_objective holds).
Because the two coefficients q1i_dvi and q2i_dvi do not depend on i, both equality rows constrain only sum_i x_i; they have rank one and, as the algebra of the reference guarantees, a consistent right-hand side, so the program is a single equality plus 2m inequalities.
ACCEPTANCE CONTRACT (see line/util/auglag.h). MATLAB solves the QP with quadprog (interior-point-convex) or the bundled Goldfarb-Idnani QP; the JAR uses OSQP. This port uses the augmented Lagrangian with a Levenberg-Marquardt inner solver on the residual (x_i/target_i - 1). The iterates do not match any of them. What is guaranteed and tested is the specification:
REFERENCE DEFECTS (matlab/lib/m3a/m3a/m3pp/m3pp2m_fitc_approx.m):
DIVERGENCE FROM THE JAR: M3pp2m_fitc_approx.java and M3pp2m_fitc_approx_ag_multiclass.java add 2m further inequality rows (q1i <= 1, q2i <= 1) that neither MATLAB file has, and then project the solution post hoc with max(0, q) followed by a row renormalization. The extra rows can make a program infeasible that MATLAB solves, and the projection silently changes the fitted per-class rates. This port follows MATLAB: 2m rows, no post-hoc projection, and the infeasibility of the result reported through M3pp2mFitcApproxResult::feasible rather than repaired.
Gated on transcendental arithmetic.
Definition in file m3pp2m_fitc_approx.h.