Package org.opt4j.genotype
Class DoubleBounds
- java.lang.Object
-
- org.opt4j.genotype.DoubleBounds
-
public class DoubleBounds extends Object implements Bounds<Double>
TheDoubleBounds
is an implementation of theBounds
for theDoubleGenotype
that accepts arrays as well as lists for as bounds.
-
-
Constructor Summary
Constructors Constructor Description DoubleBounds(double[] lower, double[] upper)
Constructs aDoubleBounds
with arrays.DoubleBounds(List<Double> lower, List<Double> upper)
Constructs aDoubleBounds
with lists.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Double
getLowerBound(int index)
Returns the lower bound for thei
-th element.Double
getUpperBound(int index)
Returns the upper bound for thei
-th element.
-
-
-
Constructor Detail
-
DoubleBounds
public DoubleBounds(double[] lower, double[] upper)
Constructs aDoubleBounds
with arrays.- Parameters:
lower
- the lower boundsupper
- the upper bounds
-
DoubleBounds
public DoubleBounds(List<Double> lower, List<Double> upper)
Constructs aDoubleBounds
with lists.- Parameters:
lower
- the lower boundsupper
- the upper bounds
-
-
Method Detail
-
getLowerBound
public Double getLowerBound(int index)
Description copied from interface:Bounds
Returns the lower bound for thei
-th element.- Specified by:
getLowerBound
in interfaceBounds<Double>
- Parameters:
index
- thei
-th element- Returns:
- the lower bound of the
i
-th element
-
getUpperBound
public Double getUpperBound(int index)
Description copied from interface:Bounds
Returns the upper bound for thei
-th element.- Specified by:
getUpperBound
in interfaceBounds<Double>
- Parameters:
index
- thei
-th element- Returns:
- the upper bound of the
i
-th element
-
-