Package org.chocosolver.memory
Class IStateDoubleVector
- 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[]elementDataContains the elements of the vector.protected IEnvironmentenvironmentThe current environment.static intMIN_CAPACITYMinimal capacity of a vectorprotected IStateIntsizeA backtrackable search with the size of the vector.
-
Constructor Summary
Constructors Modifier Constructor Description protectedIStateDoubleVector(IEnvironment env, double[] entries)protectedIStateDoubleVector(IEnvironment env, int initialSize, double initialValue)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description doubleget(int index)Returns theindexth element of the vector.doublequickGet(int index)return the indexth element of the vector without an bound check.abstract doublequickSet(int index, double val)Unsafe setter => don't do bound verificationprotected booleanrangeCheck(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 theindexth 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
-
-