All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.broadinstitute.hellbender.utils.Log10FactorialCache Maven / Gradle / Ivy

There is a newer version: 4.6.0.0
Show newest version
package org.broadinstitute.hellbender.utils;

import org.apache.commons.math3.special.Gamma;

/**
 * Wrapper class so that the log10Factorial array is only calculated if it's used
 */
public final class Log10FactorialCache extends IntToDoubleFunctionCache {
    private static final int CACHE_SIZE = 10_000;

    @Override
    protected int maxSize() {
        return CACHE_SIZE;
    }

    @Override
    protected double compute(final int n) {
        return MathUtils.log10Gamma(n + 1);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy