public class DoubleSparseArrayVector extends Object implements SparseVector
| Modifier and Type | Field and Description |
|---|---|
protected int |
assignedSize
current number of assigned value
|
protected int |
capacity
maximum number of element, maximum pos value
|
protected double |
defaultValue
la valeur par defaut
|
protected int[] |
position
contient la position de l'element, le tableau est trie
|
protected double[] |
values |
| Constructor and Description |
|---|
DoubleSparseArrayVector() |
DoubleSparseArrayVector(int capacity) |
DoubleSparseArrayVector(int capacity,
double defaultValue) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Vector v)
Ajoute les valeurs du vector passé en argument a ce vector.
|
protected void |
addElementAt(int index,
int element,
double value) |
protected void |
checkPos(int pos) |
protected void |
ensureCapacity(int mincap) |
boolean |
equals(Object o) |
protected int |
findIndex(int pos)
retourne la position dans le tableau position de la position lineaire
|
int[] |
getAssignedPosition()
Return an orderer array of position assigned, this array can be longer than
realy assigned value, you must used getNumberOfAssignedValue to know
number of significant position in array
|
double[] |
getAssignedValue()
Return an array in same order that getAssignedPosition.
|
double |
getDefaultValue()
Value to used if not un assigned value
|
String |
getInfo()
return information on this vector.
|
double |
getMaxOccurence()
Deprecated.
|
double |
getMaxOccurrence()
Retourne la valeur la plus utilise dans le vector
|
int |
getNumberOfAssignedValue()
Returne number of assigned value, assigned value is value stored in memory
|
double |
getValue(int pos) |
int |
hashCode() |
void |
init(int capacity)
Init vector, before this method call, vector is in indetermined state.
|
boolean |
isImplementedAdd(Vector v)
Permet de savoir si add est implanté par ce vector.
|
boolean |
isImplementedMap()
Permet de savoir si map est implanté par ce vector.
|
boolean |
isImplementedMinus(Vector v)
Permet de savoir si minus est implanté par ce vector.
|
boolean |
isImplementedPaste(Vector v)
Permet de savoir si paste est implanté par ce vector.
|
VectorIterator |
iterator()
Retourne un objet Inc pret a etre utilisé pour boucler sur tous les
element de la matrice.
|
VectorIterator |
iteratorNotZero()
Retourne un objet Inc pret a etre utilisé pour boucler sur tous les
element different de 0 de la matrice.
|
void |
map(MapFunction f)
on applique sur chaque donnée existante et sur default
|
void |
minus(Vector v)
Soustrait les valeurs du vector passé en argument a ce vector.
|
void |
paste(Vector v)
On recopie tous les attributs pour que le vector ressemble exactement a
celui passé en argument
|
protected void |
removeElementAt(int index) |
void |
setValue(int pos,
double value) |
int |
size() |
protected double defaultValue
protected int capacity
protected int assignedSize
protected int[] position
protected double[] values
public DoubleSparseArrayVector()
public DoubleSparseArrayVector(int capacity)
public DoubleSparseArrayVector(int capacity,
double defaultValue)
public void init(int capacity)
Vectorpublic String getInfo()
Vectorpublic double getDefaultValue()
SparseVectorgetDefaultValue in interface SparseVectorpublic int[] getAssignedPosition()
SparseVectorgetAssignedPosition in interface SparseVectorpublic double[] getAssignedValue()
SparseVectorgetAssignedValue in interface SparseVectorpublic int getNumberOfAssignedValue()
VectorgetNumberOfAssignedValue in interface Vector@Deprecated public double getMaxOccurence()
getMaxOccurence in interface Vectorpublic double getMaxOccurrence()
VectorgetMaxOccurrence in interface Vectorprotected void checkPos(int pos)
protected int findIndex(int pos)
pos - protected void ensureCapacity(int mincap)
protected void addElementAt(int index,
int element,
double value)
protected void removeElementAt(int index)
public boolean isImplementedPaste(Vector v)
VectorisImplementedPaste in interface Vectorv - vector to testpublic boolean isImplementedAdd(Vector v)
VectorisImplementedAdd in interface Vectorv - vector to testpublic boolean isImplementedMinus(Vector v)
VectorisImplementedMinus in interface Vectorv - vector to testpublic boolean isImplementedMap()
VectorisImplementedMap in interface Vectorpublic void paste(Vector v)
public void add(Vector v)
Vectorpublic void minus(Vector v)
Vectorpublic void map(MapFunction f)
public VectorIterator iterator()
Vectorpublic VectorIterator iteratorNotZero()
VectoriteratorNotZero in interface VectorCopyright © 2004–2015 CodeLutin. All rights reserved.