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

com.accelad.math.doubledouble.DoubleDoubleCache Maven / Gradle / Ivy

The newest version!
package com.accelad.math.doubledouble;

import java.util.function.Supplier;

class DoubleDoubleCache {

    private final DoubleMap> map = new DoubleMap<>();

    // The function (or bifunction) used to build the supplier should always be the same for a
    // DoubleDoubleCache instance.
    // However, for performance issues (we don't really understand yet), it is faster to provide
    // it at each call.
    public T get(Double hi, Double lo, Supplier supplier) {
        DoubleMap hiMap = map.get(hi, DoubleMap::new);
        return hiMap.get(lo, supplier);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy