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

ch.obermuhlner.math.big.internal.PowerIterator Maven / Gradle / Ivy

There is a newer version: 2.3.2
Show newest version
package ch.obermuhlner.math.big.internal;

import java.math.BigDecimal;

/**
 * Iterator over the powers of a value x.
 * 
 * 

This API allows to efficiently calculate the various powers of x in a taylor series by storing intermediate results.

*

For example xn can be calculated using one multiplication by storing the previously calculated xn-1 and x.

* *

{@link #getCurrentPower()} will be called first to retrieve the initial value.

* * For later iterations {@link #calculateNextPower()} will be called before {@link #getCurrentPower()}. */ public interface PowerIterator { /** * Returns the current power. * * @return the current power. */ BigDecimal getCurrentPower(); /** * Calculates the next power. */ void calculateNextPower(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy