diff options
| author | RncLsn <rnc.lsn@gmail.com> | 2015-08-14 19:21:26 +0100 |
|---|---|---|
| committer | RncLsn <rnc.lsn@gmail.com> | 2015-08-14 19:21:26 +0100 |
| commit | ae9a6bad58019ef18657568e58f49459fbadc49c (patch) | |
| tree | 104d92748f150dc74c9a0f6d19f328357903857e /src/uk/ac/ox/cs/pagoda/util/ExponentialInterpolation.java | |
| parent | 1bfe7e876c16adf73a4effdbe80431c1822bbe93 (diff) | |
| download | ACQuA-ae9a6bad58019ef18657568e58f49459fbadc49c.tar.gz ACQuA-ae9a6bad58019ef18657568e58f49459fbadc49c.zip | |
Incremental Skolemised store (not working).
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/util/ExponentialInterpolation.java')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/util/ExponentialInterpolation.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/util/ExponentialInterpolation.java b/src/uk/ac/ox/cs/pagoda/util/ExponentialInterpolation.java new file mode 100644 index 0000000..1d12169 --- /dev/null +++ b/src/uk/ac/ox/cs/pagoda/util/ExponentialInterpolation.java | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.util; | ||
| 2 | |||
| 3 | /*** | ||
| 4 | * Get an exponential function given two points. | ||
| 5 | */ | ||
| 6 | public class ExponentialInterpolation { | ||
| 7 | |||
| 8 | private final double base; | ||
| 9 | private final double multiplicativeFactor; | ||
| 10 | |||
| 11 | /*** | ||
| 12 | * Compute the exponential function passing for the 2 given points. | ||
| 13 | * | ||
| 14 | * @param x1 | ||
| 15 | * @param y1 | ||
| 16 | * @param x2 | ||
| 17 | * @param y2 | ||
| 18 | */ | ||
| 19 | public ExponentialInterpolation(double x1, double y1, double x2, double y2) { | ||
| 20 | base = Math.pow(y2/y1, 1 / (x2 - x1)); | ||
| 21 | multiplicativeFactor = y1 / Math.pow(base, x1); | ||
| 22 | } | ||
| 23 | |||
| 24 | /*** | ||
| 25 | * Compute value of the function in x. | ||
| 26 | * | ||
| 27 | * @param x | ||
| 28 | * @return | ||
| 29 | */ | ||
| 30 | public double computeValue(double x) { | ||
| 31 | return multiplicativeFactor * Math.pow(base, x); | ||
| 32 | } | ||
| 33 | } | ||
