- java.lang.Object
-
- org.chocosolver.memory.IStateDoubleVector
-
- Direct Known Subclasses:
StoredDoubleVector
public abstract class IStateDoubleVector extends Object
Describes an search vector with states (describing some history of the data structure).
-
-
Field Summary
Fields Modifier and Type Field Description protected double[]
elementData
Contains the elements of the vector.protected IEnvironment
environment
The current environment.static int
MIN_CAPACITY
Minimal capacity of a vectorprotected IStateInt
size
A backtrackable search with the size of the vector.
-
Constructor Summary
Constructors Modifier Constructor Description protected
IStateDoubleVector(IEnvironment env, double[] entries)
protected
IStateDoubleVector(IEnvironment env, int initialSize, double initialValue)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description double
get(int index)
Returns theindex
th element of the vector.double
quickGet(int index)
return the indexth element of the vector without an bound check.abstract double
quickSet(int index, double val)
Unsafe setter => don't do bound verificationprotected boolean
rangeCheck(int index)
-
-
-
Field Detail
-
MIN_CAPACITY
public static final int MIN_CAPACITY
Minimal capacity of a vector- See Also:
- Constant Field Values
-
elementData
protected double[] elementData
Contains the elements of the vector.
-
size
protected IStateInt size
A backtrackable search with the size of the vector.
-
environment
protected final IEnvironment environment
The current environment.
-
-
Constructor Detail
-
IStateDoubleVector
protected IStateDoubleVector(IEnvironment env, int initialSize, double initialValue)
-
IStateDoubleVector
protected IStateDoubleVector(IEnvironment env, double[] entries)
-
-
Method Detail
-
get
public final double get(int index)
Returns theindex
th element of the vector.
-
quickGet
public final double quickGet(int index)
return the indexth element of the vector without an bound check.- Parameters:
index
- index- Returns:
- the element
-
rangeCheck
protected boolean rangeCheck(int index)
-
quickSet
public abstract double quickSet(int index, double val)
Unsafe setter => don't do bound verification- Parameters:
index
- the index of the replaced valueval
- the new value- Returns:
- the old value
-
-