public static final class CombinatoricsUtils.FactorialLog extends Object
n
.
It allows to allocate a cache of precomputed values.
In case of cache miss, computation is preformed by a call to
Gamma.logGamma(double)
.Modifier and Type | Method and Description |
---|---|
static CombinatoricsUtils.FactorialLog |
create()
Creates an instance with no precomputed values.
|
double |
value(int n)
Computes
log(n!) . |
CombinatoricsUtils.FactorialLog |
withCache(int cacheSize)
Creates an instance with the specified cache size.
|
public static CombinatoricsUtils.FactorialLog create()
public CombinatoricsUtils.FactorialLog withCache(int cacheSize)
cacheSize
- Number of precomputed values of the function.cacheSize
values have been
precomputed.MathIllegalArgumentException
- if n < 0
.public double value(int n)
log(n!)
.n
- Argument.log(n!)
.MathIllegalArgumentException
- if n < 0
.Copyright © 2016–2020 Hipparchus.org. All rights reserved.