Golden Section is provided as public static method / constant.
@@ -32,7 +32,7 @@ package net.finmath.optimizer;
public class GoldenSectionSearch {
// This is the golden section ratio
- static final double GOLDEN_SECTION_RATIO = (3.0 - Math.sqrt(5.0)) / 2.0;
+ public static final double GOLDEN_SECTION_RATIO = (3.0 - Math.sqrt(5.0)) / 2.0;
// We store the left and right end point of the interval and a middle point (placed at golden section ratio) together with their values
private final double[] points = new double[3]; // left, middle, right
@@ -227,7 +227,7 @@ public class GoldenSectionSearch {
/**
* @return Returns the golden section of an interval.
*/
- static double getGoldenSection(final double left, final double right) {
+ public static double getGoldenSection(final double left, final double right) {
return GOLDEN_SECTION_RATIO * left + (1.0 - GOLDEN_SECTION_RATIO) * right;
}
