LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Toggle main menu visibility
Loading...
Searching...
No Matches
pfqn_is.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2012-2026, QORE Lab, Imperial College London
3
* All rights reserved.
4
*/
5
#ifndef LINE_API_PFQN_IS_H
6
#define LINE_API_PFQN_IS_H
7
8
/**
9
* @file
10
* @ingroup api_pfqn
11
* Importance-sampling estimate of the normalizing constant of a closed
12
* LOAD-INDEPENDENT product-form network.
13
*
14
* Templated port of matlab/src/api/pfqn/pfqn_is.m, which is one line: the
15
* load-independent case mu_i(k) = 1 of pfqn_ld_is. This header keeps the same
16
* shape so that the two entry points stay in step, rather than duplicating the
17
* estimator.
18
*
19
* Arithmetic: INEXACT BY CONSTRUCTION, gated on has_transcendental for the
20
* same reason as pfqn_ld_is (a random output, plus lG = log(G)).
21
*
22
* RNG contract: see pfqn_mc_common.h. Comparable to MATLAB only in
23
* distribution, never stream for stream; reproducible within this port only
24
* when the generator is passed in the same state.
25
*/
26
27
#include <cstddef>
28
#include <vector>
29
30
#include "
line/api/pfqn/pfqn_ca.h
"
31
#include "
line/api/pfqn/pfqn_ld_is.h
"
32
#include "
line/api/pfqn/pfqn_mc_common.h
"
33
#include "
line/num/number.h
"
34
#include "
line/util/matrix.h
"
35
36
namespace
line
{
37
namespace
pfqn
{
38
39
/**
40
* @brief Importance-sampling estimate of the normalizing constant of a closed
41
* LOAD-INDEPENDENT product-form network.
42
*
43
* @param L (M x R) per-class demands at the M single-server queues
44
* @param N (R) closed population vector
45
* @param Z (R) aggregated think times; empty or all zero for no delay
46
* @param samples number of importance samples
47
* @param rng explicit generator, advanced by the call
48
*/
49
template
<
class
T>
50
NcResult<T>
pfqn_is
(
const
Matrix<T>
& L,
const
std::vector<int>& N,
const
std::vector<T>& Z,
51
std::size_t samples,
McRng
&
rng
) {
52
static_assert
(
num_traits<T>::has_transcendental
,
53
"pfqn_is requires transcendental arithmetic: it is a Monte Carlo estimator, "
54
"inexact by construction, and reports the log of its own estimate"
);
55
return
pfqn_ld_is
(L, N, Z,
Matrix<T>
(), samples,
rng
);
56
}
57
58
/** Reference default of 1e4 samples. */
59
template
<
class
T>
60
NcResult<T>
pfqn_is
(
const
Matrix<T>
& L,
const
std::vector<int>& N,
const
std::vector<T>& Z,
61
McRng
&
rng
) {
62
return
pfqn_is
(L, N, Z,
static_cast<
std::size_t
>
(10000),
rng
);
63
}
64
65
}
// namespace pfqn
66
}
// namespace line
67
68
#endif
// LINE_API_PFQN_IS_H
line::Matrix
Definition
matrix.h:56
matrix.h
Dense matrix and non-owning view.
line::pfqn
Definition
cd_peak_scaling.h:43
line::pfqn::pfqn_ld_is
NcResult< T > pfqn_ld_is(const Matrix< T > &L, const std::vector< int > &N, const std::vector< T > &Z, const Matrix< T > &mu, std::size_t samples, McRng &rng)
Importance-sampling estimate of the normalizing constant of a closed LOAD-DEPENDENT product-form netw...
Definition
pfqn_ld_is.h:81
line::pfqn::McRng
std::mt19937_64 McRng
The generator type every Monte Carlo entry point in this tree accepts.
Definition
pfqn_mc_common.h:62
line::pfqn::pfqn_is
NcResult< T > pfqn_is(const Matrix< T > &L, const std::vector< int > &N, const std::vector< T > &Z, std::size_t samples, McRng &rng)
Importance-sampling estimate of the normalizing constant of a closed LOAD-INDEPENDENT product-form ne...
Definition
pfqn_is.h:50
line::rng
Definition
rng_ssj.h:56
line
Definition
aoi_dist2ph.h:52
number.h
Number-type abstraction for the templated API port.
pfqn_ca.h
Convolution algorithm for the exact normalizing constant of a closed product-form network (Buzen 1973...
pfqn_ld_is.h
Importance-sampling estimate of the normalizing constant of a closed LOAD-DEPENDENT product-form netw...
pfqn_mc_common.h
Randomness scaffolding shared by the Monte Carlo normalizing-constant estimators (pfqn_mci,...
line::num_traits
Definition
number.h:111
line::pfqn::NcResult
Return value of the normalizing-constant family, mirroring Ret.pfqnNc.
Definition
pfqn_ca.h:44
include
line
api
pfqn
pfqn_is.h
Generated by
1.18.0