LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::qsys::resdetail Namespace Reference

Functions

double gammaln (double x)
 MATLAB's gammaln.
double gammainc_upper (double x, double a)
 MATLAB's gammainc(x, a, 'upper'), the regularized upper tail Q(a, x).
double gammainc_lower (double x, double a)
 MATLAB's gammainc(x, a, 'lower'), the regularized lower tail P(a, x).
double besseli1_scaled (double x)
 MATLAB's besseli(1, x, 1) = I_1(x) exp(-x), x >= 0.
std::vector< double > geometric (double c, double r, long nmax)
 The 0:nmax power law c*r.
double ccdf_inverse (const std::function< double(double)> &ccdf, double target, double hi)
 The bisection inverse of a complementary CDF shared by the reference's functions (ccdf_inverse / mmck_ccdf_inverse / mmckk_ccdf_inverse): the time at which ccdf falls to target, bracketing upward from hi.
double vsum (const std::vector< double > &x)
 sum(x)
std::vector< double > lognormalize (const std::vector< double > &logp, const std::vector< double > &lognorm)
 exp(logp - logsumexp(lognorm)), the reference's log-space normalization.
std::vector< double > cdf_of (const std::function< double(double)> &ccdf, const std::vector< double > &t)
 Fills out with 1 - ccdf(t) at each t, as 1 - arrayfun(ccdf, t).
std::vector< double > pct_of (const std::function< double(double)> &ccdf, const std::vector< double > &pct, double hi)
 The percentiles by bisection, arrayfun(@(r) ccdf_inverse(ccdf, 1 - r/100, hi), pct).
void require_stable (double rho, const char *fn)
 The reference's LINE:input:Unstable refusal.
void throw_unstable (const char *fn, const char *what, double v)
 A LINE:input:Unstable refusal "fn: unstable system: <what> = %g >= 1".
void throw_unknown_option (const char *fn, const std::string &name, bool argument_id)
 MATLAB's "unknown option 'name'" refusal, as LINE:input:Argument or as a bare LINE:Error.
double nchoosek_r (double n, double k)
 The reference's nchoosek_r: exp(gammaln) rounded to the integer it is while that integer is exactly representable (below 2^52).
void check_percentiles (const std::vector< double > &pct, const char *fn)
 A percentile vector checked against (0, 100), MATLAB's LINE:Error refusal.

Function Documentation

◆ besseli1_scaled()

double line::qsys::resdetail::besseli1_scaled ( double x)
inline

MATLAB's besseli(1, x, 1) = I_1(x) exp(-x), x >= 0.

Past the range where I_1 itself is finite the Hankel asymptotic expansion of the scaled function is used (six terms, relative error far below 1e-15 at x > 600).

Definition at line 132 of file qsys_res.h.

References besseli1_scaled().

Referenced by besseli1_scaled().

◆ ccdf_inverse()

double line::qsys::resdetail::ccdf_inverse ( const std::function< double(double)> & ccdf,
double target,
double hi )
inline

The bisection inverse of a complementary CDF shared by the reference's functions (ccdf_inverse / mmck_ccdf_inverse / mmckk_ccdf_inverse): the time at which ccdf falls to target, bracketing upward from hi.

Definition at line 156 of file qsys_res.h.

References ccdf_inverse().

Referenced by ccdf_inverse(), and pct_of().

◆ cdf_of()

std::vector< double > line::qsys::resdetail::cdf_of ( const std::function< double(double)> & ccdf,
const std::vector< double > & t )
inline

Fills out with 1 - ccdf(t) at each t, as 1 - arrayfun(ccdf, t).

Definition at line 189 of file qsys_res.h.

References cdf_of().

Referenced by cdf_of().

◆ check_percentiles()

void line::qsys::resdetail::check_percentiles ( const std::vector< double > & pct,
const char * fn )
inline

A percentile vector checked against (0, 100), MATLAB's LINE:Error refusal.

Definition at line 236 of file qsys_res.h.

References check_percentiles(), and line::Error::Error().

Referenced by check_percentiles().

◆ gammainc_lower()

double line::qsys::resdetail::gammainc_lower ( double x,
double a )
inline

MATLAB's gammainc(x, a, 'lower'), the regularized lower tail P(a, x).

Definition at line 121 of file qsys_res.h.

References gammainc_lower().

Referenced by gammainc_lower().

◆ gammainc_upper()

double line::qsys::resdetail::gammainc_upper ( double x,
double a )
inline

MATLAB's gammainc(x, a, 'upper'), the regularized upper tail Q(a, x).

Definition at line 114 of file qsys_res.h.

References gammainc_upper().

Referenced by gammainc_upper().

◆ gammaln()

double line::qsys::resdetail::gammaln ( double x)
inline

MATLAB's gammaln.

Definition at line 111 of file qsys_res.h.

References gammaln().

Referenced by line::qsys::engsetdetail::engset_dist(), and gammaln().

◆ geometric()

std::vector< double > line::qsys::resdetail::geometric ( double c,
double r,
long nmax )
inline

The 0:nmax power law c*r.

^(0:nmax).

Definition at line 145 of file qsys_res.h.

References geometric().

Referenced by geometric().

◆ lognormalize()

std::vector< double > line::qsys::resdetail::lognormalize ( const std::vector< double > & logp,
const std::vector< double > & lognorm )
inline

exp(logp - logsumexp(lognorm)), the reference's log-space normalization.

Definition at line 177 of file qsys_res.h.

References lognormalize().

Referenced by lognormalize().

◆ nchoosek_r()

double line::qsys::resdetail::nchoosek_r ( double n,
double k )
inline

The reference's nchoosek_r: exp(gammaln) rounded to the integer it is while that integer is exactly representable (below 2^52).

Definition at line 230 of file qsys_res.h.

References nchoosek_r().

Referenced by nchoosek_r(), and line::qsys::qsys_mg1kk().

◆ pct_of()

std::vector< double > line::qsys::resdetail::pct_of ( const std::function< double(double)> & ccdf,
const std::vector< double > & pct,
double hi )
inline

The percentiles by bisection, arrayfun(@(r) ccdf_inverse(ccdf, 1 - r/100, hi), pct).

Definition at line 196 of file qsys_res.h.

References ccdf_inverse(), and pct_of().

Referenced by pct_of().

◆ require_stable()

void line::qsys::resdetail::require_stable ( double rho,
const char * fn )
inline

The reference's LINE:input:Unstable refusal.

Definition at line 204 of file qsys_res.h.

References line::ErrorKind::ErrorKind(), line::InputError::InputError(), and require_stable().

Referenced by require_stable().

◆ throw_unknown_option()

void line::qsys::resdetail::throw_unknown_option ( const char * fn,
const std::string & name,
bool argument_id )
inline

MATLAB's "unknown option 'name'" refusal, as LINE:input:Argument or as a bare LINE:Error.

Definition at line 220 of file qsys_res.h.

References line::Error::Error(), line::ErrorKind::ErrorKind(), line::InputError::InputError(), and throw_unknown_option().

Referenced by throw_unknown_option().

◆ throw_unstable()

void line::qsys::resdetail::throw_unstable ( const char * fn,
const char * what,
double v )
inline

◆ vsum()

double line::qsys::resdetail::vsum ( const std::vector< double > & x)
inline

sum(x)

Definition at line 170 of file qsys_res.h.

References vsum().

Referenced by vsum().