LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
fj_harmonic.h File Reference

Harmonic number H_K = sum_{k=1..K} 1/k. More...

Include dependency graph for fj_harmonic.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::fj

Functions

template<class T>
line::fj::fj_harmonic (unsigned K)
 Harmonic number H_K = sum_{k=1..K} 1/k.

Detailed Description

Harmonic number H_K = sum_{k=1..K} 1/k.

Templated port of matlab/src/api/fj/fj_harmonic.m, cross-checked against jar/src/main/java/jline/api/fj/FJ_harmonic.java (identical).

H_K is the expected maximum of K i.i.d. unit-rate exponentials and so is the single most reused quantity in the fork-join family. It is a sum of unit fractions, hence exactly representable in the field: the exact instantiation returns the true rational H_K, which the double one does not (the summation loses the low bits from about K = 10 onwards and the alternating sums in fj_respt_vm and fj_xmax_erlang amplify that loss).

Definition in file fj_harmonic.h.