public abstract class IStateDoubleVector extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected double[] |
elementData
Contains the elements of the vector.
|
protected IEnvironment |
environment
The current environment.
|
static int |
MIN_CAPACITY
Minimal capacity of a vector
|
protected IStateInt |
size
A backtrackable search with the size of the vector.
|
Modifier | Constructor and Description |
---|---|
protected |
IStateDoubleVector(IEnvironment env,
double[] entries) |
protected |
IStateDoubleVector(IEnvironment env,
int initialSize,
double initialValue) |
Modifier and Type | Method and Description |
---|---|
abstract void |
add(double i)
Adds a new search at the end of the vector.
|
double[] |
deepCopy() |
double |
get(int index)
Returns the
index th element of the vector. |
boolean |
isEmpty()
Checks if the vector is empty.
|
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 verification
|
protected boolean |
rangeCheck(int index) |
abstract void |
remove(int i)
Removes an int.
|
abstract void |
removeLast()
removes the search at the end of the vector.
|
abstract double |
set(int index,
double val)
Assigns a new value
val to the element index and returns
the old value |
int |
size()
Returns the current size of the stored search vector.
|
public static final int MIN_CAPACITY
protected double[] elementData
protected IStateInt size
protected final IEnvironment environment
protected IStateDoubleVector(IEnvironment env, int initialSize, double initialValue)
protected IStateDoubleVector(IEnvironment env, double[] entries)
public final int size()
public final boolean isEmpty()
public abstract void add(double i)
i
- The search to add.public abstract void remove(int i)
i
- The search to remove.public abstract void removeLast()
public final double get(int index)
index
th element of the vector.public final double quickGet(int index)
index
- indexprotected boolean rangeCheck(int index)
public abstract double set(int index, double val)
val
to the element index
and returns
the old valuepublic abstract double quickSet(int index, double val)
index
- the index of the replaced valueval
- the new valuepublic double[] deepCopy()
Copyright © 2015. All rights reserved.