|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sat4j.core.VecInt
public final class VecInt
A vector specific for primitive integers, widely used in the solver. Note that if the vector has a sort method, the operations on the vector DO NOT preserve sorting.
| Field Summary | |
|---|---|
static IVecInt |
EMPTY
|
| Constructor Summary | |
|---|---|
VecInt()
|
|
VecInt(int size)
|
|
VecInt(int[] lits)
Adapter method to translate an array of int into an IVecInt. |
|
VecInt(int size,
int pad)
Build a vector of a given initial size filled with an integer. |
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
contains(int e)
|
int |
containsAt(int e)
returns the index of the first occurrence of e, else -1. |
int |
containsAt(int e,
int from)
returns the index of the first occurence of e occurring after from (excluded), else -1. |
void |
copyTo(int[] is)
Copy the content of this vector into an array of integer. |
void |
copyTo(IVecInt copy)
Copy the content of this vector into another one. |
int |
delete(int i)
Delete the ith element of the vector. |
void |
ensure(int nsize)
|
boolean |
equals(Object obj)
Two vectors are equals iff they have the very same elements in the order. |
int |
get(int i)
|
void |
growTo(int newsize,
int pad)
|
int |
hashCode()
|
int |
indexOf(int e)
|
void |
insertFirst(int elem)
Insert an element at the very begining of the vector. |
boolean |
isEmpty()
To know if a vector is empty |
boolean |
isSubsetOf(VecInt vec)
to detect that the vector is a subset of another one. |
IteratorInt |
iterator()
|
int |
last()
|
void |
moveTo(int[] dest)
|
void |
moveTo(int dest,
int source)
Move elements inside the vector. |
void |
moveTo(int sourceStartingIndex,
int[] dest)
|
void |
moveTo(IVecInt dest)
|
void |
moveTo2(IVecInt dest)
|
IVecInt |
pop()
depile le dernier element du vecteur. |
IVecInt |
push(int elem)
|
void |
pushAll(IVecInt vec)
|
void |
remove(int elem)
Enleve un element qui se trouve dans le vecteur!!! |
void |
set(int i,
int o)
|
void |
shrink(int nofelems)
Remove the latest nofelems elements from the vector |
void |
shrinkTo(int newsize)
|
int |
size()
|
void |
sort()
sort the vector using a custom quicksort. |
void |
sortUnique()
|
IVecInt[] |
subset(int cardinal)
Compute all subsets of cardinal k of the vector. |
int[] |
toArray()
Allow to access the internal representation of the vector as an array. |
String |
toString()
|
int |
unsafeGet(int i)
|
void |
unsafePush(int elem)
Push the element in the Vector without verifying if there is room for it. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final IVecInt EMPTY
| Constructor Detail |
|---|
public VecInt()
public VecInt(int size)
public VecInt(int[] lits)
lits - a filled array of int.
public VecInt(int size,
int pad)
size - the initial size of the vectorpad - the integer to fill the vector with| Method Detail |
|---|
public int size()
size in interface IVecIntpublic void shrink(int nofelems)
shrink in interface IVecIntnofelems - public void shrinkTo(int newsize)
shrinkTo in interface IVecIntpublic IVecInt pop()
pop in interface IVecInt
public void growTo(int newsize,
int pad)
growTo in interface IVecIntpublic void ensure(int nsize)
ensure in interface IVecIntpublic IVecInt push(int elem)
push in interface IVecIntpublic void unsafePush(int elem)
IVecInt
unsafePush in interface IVecIntpublic void clear()
clear in interface IVecIntpublic int last()
last in interface IVecIntpublic int get(int i)
get in interface IVecIntpublic int unsafeGet(int i)
unsafeGet in interface IVecInt
public void set(int i,
int o)
set in interface IVecIntpublic boolean contains(int e)
contains in interface IVecIntpublic int indexOf(int e)
indexOf in interface IVecIntpublic int containsAt(int e)
IVecInt
containsAt in interface IVecInte - an integer
public int containsAt(int e,
int from)
IVecInt
containsAt in interface IVecInte - an integerfrom - the index to start from (excluded).
public void copyTo(IVecInt copy)
copyTo in interface IVecIntcopy - public void copyTo(int[] is)
copyTo in interface IVecIntis - public void moveTo(IVecInt dest)
moveTo in interface IVecIntpublic void moveTo2(IVecInt dest)
moveTo2 in interface IVecInt
public void moveTo(int dest,
int source)
IVecIntvec[dest] = vec[source]
moveTo in interface IVecIntdest - the index of the destinationsource - the index of the sourcepublic void moveTo(int[] dest)
moveTo in interface IVecInt
public void moveTo(int sourceStartingIndex,
int[] dest)
moveTo in interface IVecIntpublic void insertFirst(int elem)
insertFirst in interface IVecIntelem - the element to put first in the vector.public void remove(int elem)
remove in interface IVecIntelem - un element du vecteurpublic int delete(int i)
delete in interface IVecInti - the indexer of the element in the vector
public String toString()
toString in class Objectpublic void sort()
sort in interface IVecIntpublic void sortUnique()
sortUnique in interface IVecIntpublic boolean equals(Object obj)
equals in class Objectobj - an object
Object.equals(java.lang.Object)public int hashCode()
hashCode in class Objectpublic void pushAll(IVecInt vec)
public boolean isSubsetOf(VecInt vec)
vec - a vector
public IteratorInt iterator()
iterator in interface IVecIntpublic boolean isEmpty()
IVecInt
isEmpty in interface IVecIntpublic int[] toArray()
IVecInt
toArray in interface IVecIntpublic IVecInt[] subset(int cardinal)
IVecInt
subset in interface IVecIntcardinal - a cardinal (k<= vec.size())
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||