![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Fit a MAMAP(2,2) matching the BACKWARD moment and the class TRANSITION probability sigma. More...
#include <cmath>#include <cstddef>#include <vector>#include "line/api/mam/amap2_fit_gamma.h"#include "line/api/mam/m3a_fit_from.h"#include "line/api/mam/mamap2m_coefficients.h"#include "line/api/mam/mamap_marked_poisson.h"#include "line/api/mam/map_gamma.h"#include "line/api/mam/map_moment.h"#include "line/api/trace/mtrace_backward_moment.h"#include "line/api/trace/mtrace_pc.h"#include "line/api/trace/mtrace_sigma.h"#include "line/api/trace/trace_gamma.h"#include "line/api/mam/map_transform.h"#include "line/api/mam/maph2m_fit.h"#include "line/api/mam/mmap_compress.h"#include "line/api/mam/mmap_lambda.h"#include "line/api/mam/mmap_stats.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::mam::Mamap22FitResult< T > |
| The fitted MAMAP(2,2), what it achieved, and whether the fit was exact. More... | |
Namespaces | |
| namespace | line |
| namespace | line::mam |
Functions | |
| template<class T> | |
| Mamap22FitResult< T > | line::mam::mamap22_fit_bs_multiclass (const Map< T > &map, const std::vector< T > &p, const std::vector< T > &B, const Matrix< T > &S, const std::vector< T > &classWeights=std::vector< T >(), const std::vector< T > &bsWeights=std::vector< T >(), bool adjust=true) |
| template<class T> | |
| Mmap< T > | line::mam::mamap22_fit_gamma_bs (const T &M1, const T &M2, const T &M3, const T &GAMMA, const std::vector< T > &p, const std::vector< T > &B, const Matrix< T > &S) |
| mamap22_fit_gamma_bs: fit over every AMAP(2) form and keep the closest. | |
| template<class T> | |
| Mmap< T > | line::mam::mamap22_fit_gamma_bs_mmap (const Mmap< T > &mm) |
| mamap22_fit_gamma_bs driven from an MMAP[2] of arbitrary order. | |
| template<class T> | |
| Mmap< T > | line::mam::mamap22_fit_gamma_bs_trace (const std::vector< T > &Tv, const std::vector< int > &A) |
| mamap22_fit_gamma_bs driven from a marked trace. | |
Fit a MAMAP(2,2) matching the BACKWARD moment and the class TRANSITION probability sigma.
Templated port of matlab/lib/m3a/m3a/mamap22/mamap22_fit_bs_multiclass.m.
TWO CLASSES ONLY, by construction: sigma is a class-to-class transition probability, and the closed forms below invert it for the (1,1) entry alone. The reference says so and refuses otherwise, and so does this.
Unlike the F+B fitter, which is affine in the marking and therefore a quadratic program, the B+S relation is a RATIO: q2 (form 1) or q3 (form 2) is a quadratic in the backward moment over a linear denominator, and the other two follow linearly from it. That inverse is closed form – fit_can1 and fit_can2 here – and it is EXACT whenever its answer lands in the unit box. The coefficient tables it reads are mamap2m_coefficients.h.
WHAT IS NOT PORTED, and is refused by name rather than approximated. When the closed form lands outside the box and the caller asked for adjust, the reference repairs it by solving a NONCONVEX program – the marking equality q2 * den(B1) = num(B1, S11) is bilinear in the unknowns – with YALMIP's bmibnb, a spatial branch-and-bound that returns a GLOBAL optimum, over two sides (B1 below and above the mean) and keeps the better. line/util/auglag.h finds a local KKT point, which on a nonconvex feasible set is a different answer, not a slower one; substituting it would report a fit the reference would not have chosen. Every other branch IS ported, including all four degeneracies and the one-variable quadratic repair of the degenerate MMAP form, so the exact path and the degenerate paths are complete.
ARITHMETIC: transcendental, through the fitters it delegates to.
Definition in file mamap22_fit_bs.h.