LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::da::FpiOptions Struct Reference

Options mirroring the fields MATLAB reads off the options struct. More...

#include <line/api/da/da_fpi.h>

Public Attributes

std::size_t iter_max = 10000
double iter_tol = 1e-8
double damping = 1.0
 omega; 1 means no damping
std::size_t miniter = 1
 iterations before the stopping test applies
bool nanstop = false
 stop when the increment norm is NaN (the reference's isnan test)
bool relative_norm = false
 config.da_norm, the increment norm.
double relative_eps = 0.0
std::function< double(const std::vector< double > &)> norm
 config.da_norm as a CALLABLE, the reference's function handle: norm receives the increment xnew - xref (in double) and norm2 the pair (xnew, xref), MATLAB's one- and two-argument handles.
std::function< double(const std::vector< double > &, const std::vector< double > &)> norm2

Detailed Description

Options mirroring the fields MATLAB reads off the options struct.

Definition at line 50 of file da_fpi.h.

Member Data Documentation

◆ damping

double line::da::FpiOptions::damping = 1.0

omega; 1 means no damping

Definition at line 53 of file da_fpi.h.

◆ iter_max

◆ iter_tol

◆ miniter

std::size_t line::da::FpiOptions::miniter = 1

iterations before the stopping test applies

Definition at line 54 of file da_fpi.h.

Referenced by line::mam::solver_mam_basic_mmap_inner(), and line::mam::solver_mam_decmmap().

◆ nanstop

bool line::da::FpiOptions::nanstop = false

stop when the increment norm is NaN (the reference's isnan test)

Definition at line 55 of file da_fpi.h.

Referenced by line::lossn::lossn_erlangfp_options(), line::mam::solver_mna_closed(), line::mam::solver_mna_open(), and line::mva::solver_qna().

◆ norm

std::function<double(const std::vector<double>&)> line::da::FpiOptions::norm

config.da_norm as a CALLABLE, the reference's function handle: norm receives the increment xnew - xref (in double) and norm2 the pair (xnew, xref), MATLAB's one- and two-argument handles.

Either takes precedence over the flags above when set; norm2 over norm. With this a caller can install @(d) norm(d,1) (da_cacheqn, lossn_erlangfp) as [](const std::vector<double>& d) { double s = 0; for (double v : d) s += std::fabs(v); return s; }.

Definition at line 81 of file da_fpi.h.

◆ norm2

std::function<double(const std::vector<double>&, const std::vector<double>&)> line::da::FpiOptions::norm2

Definition at line 82 of file da_fpi.h.

◆ relative_eps

double line::da::FpiOptions::relative_eps = 0.0

Definition at line 72 of file da_fpi.h.

Referenced by line::mam::solver_mam_basic_mmap_inner().

◆ relative_norm

bool line::da::FpiOptions::relative_norm = false

config.da_norm, the increment norm.

MATLAB passes a function handle; the two handles the reference actually installs are both RELATIVE – max(|xn-xr|./xr) in solver_mam.m and max(|xn-xr|./(xr+FineTol)) in solver_mam_basic_mmap_inner.m – so they are expressed here as a flag and the denominator's offset rather than as a std::function, which would have to be templated on T and would change the type of every existing caller's options object.

FALSE keeps the default absolute max-norm. TRUE with relative_eps = 0 reproduces the first handle, including its division by a zero reference (the reference divides by xr unguarded, and an all-zero start therefore yields NaN on the first sweep; miniter is what keeps that from stopping the loop, exactly as in MATLAB).

Definition at line 71 of file da_fpi.h.

Referenced by line::mam::solver_mam_basic_mmap_inner(), and line::mam::solver_mam_decmmap().


The documentation for this struct was generated from the following file: