Package org.nuiton.math.matrix
Class LegacyDoubleSparseHashVector
java.lang.Object
org.nuiton.math.matrix.LegacyDoubleSparseHashVector
- All Implemented Interfaces:
SparseVector,Vector
This class is a copy of
DoubleSparseHashVector Vector class, as in version 2.8.0.
When calling MatrixND.sumOverDim(int) on a MatrixND object that uses this class as data storage,
the legacy method AbstractMatrixND.sumOverDim(int) will be called instead of the optimized algorithm
implemented in MatrixNDImpl.sumOverDim(int).-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLegacyDoubleSparseHashVector(long capacity) LegacyDoubleSparseHashVector(long capacity, double defaultValue) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckPos(long pos) booleanvoidlong[]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 arraydouble[]Return an array in same order that getAssignedPosition.doubleValue to used if not un assigned valuegetInfo()return information on this vector.doubleDeprecated.doubleRetourne la valeur la plus utilise dans le vectorlongReturne number of assigned value, assigned value is value stored in memorydoublegetValue(long pos) inthashCode()voidinit(long capacity) Init vector, before this method call, vector is in indetermined state.booleanPermet de savoir si map est implanté par ce vector.booleanPermet de savoir si paste est implanté par ce vector.iterator()Retourne un objet Inc pret a etre utilisé pour boucler sur tous les element de la matrice.Retourne un objet Inc pret a etre utilisé pour boucler sur tous les element different de 0 de la matrice.voidmap(MapFunction f) applique a chaque valeur du vector laMapFunction.voidCopie les valeurs du vector passé en argument dans ce vector.voidsetValue(long pos, double value) longsize()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuiton.math.matrix.Vector
add, forEach, isImplementedAdd, isImplementedMinus, minus
-
Field Details
-
defaultValue
protected double defaultValue -
data
-
capacity
protected long capacity
-
-
Constructor Details
-
LegacyDoubleSparseHashVector
public LegacyDoubleSparseHashVector() -
LegacyDoubleSparseHashVector
public LegacyDoubleSparseHashVector(long capacity) -
LegacyDoubleSparseHashVector
public LegacyDoubleSparseHashVector(long capacity, double defaultValue)
-
-
Method Details
-
init
public void init(long capacity) Description copied from interface:VectorInit vector, before this method call, vector is in indetermined state. multiple call to init method must be permit. Only first call must do some work, extra call must do nothing -
getInfo
Description copied from interface:Vectorreturn information on this vector. This information depends on implementation example: - size - max occurence number - ... -
getNumberOfAssignedValue
public long getNumberOfAssignedValue()Description copied from interface:VectorReturne number of assigned value, assigned value is value stored in memory- Specified by:
getNumberOfAssignedValuein interfaceVector
-
size
public long size() -
getMaxOccurence
Deprecated.- Specified by:
getMaxOccurencein interfaceVector
-
getMaxOccurrence
public double getMaxOccurrence()Description copied from interface:VectorRetourne la valeur la plus utilise dans le vector- Specified by:
getMaxOccurrencein interfaceVector- Returns:
-
checkPos
protected void checkPos(long pos) -
getValue
public double getValue(long pos) -
setValue
public void setValue(long pos, double value) -
equals
-
hashCode
public int hashCode() -
isImplementedPaste
Description copied from interface:VectorPermet de savoir si paste est implanté par ce vector.- Specified by:
isImplementedPastein interfaceVector- Parameters:
v- vector to test- Returns:
trueif operation is supported
-
isImplementedMap
public boolean isImplementedMap()Description copied from interface:VectorPermet de savoir si map est implanté par ce vector.- Specified by:
isImplementedMapin interfaceVector- Returns:
trueif operation is supported
-
paste
Description copied from interface:VectorCopie les valeurs du vector passé en argument dans ce vector. -
map
Description copied from interface:Vectorapplique a chaque valeur du vector laMapFunction. ATTENTION cette function ne doit pas converser d'etat interne qui modifierait son comportement a chaque execution, sinon cette methode ne fonctionne pas, car pour les Vector implanter a base de Map la fonction n'est appliqué qu'au defaultValue et au valeur deja existante -
getAssignedPosition
public long[] getAssignedPosition()Description copied from interface:SparseVectorReturn 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- Specified by:
getAssignedPositionin interfaceSparseVector- Returns:
-
getAssignedValue
public double[] getAssignedValue()Description copied from interface:SparseVectorReturn an array in same order that getAssignedPosition. This array contains values. This array can be longer than realy assigned value, you must used getNumberOfAssignedValue to know number of significant position in array- Specified by:
getAssignedValuein interfaceSparseVector- Returns:
-
getDefaultValue
public double getDefaultValue()Description copied from interface:SparseVectorValue to used if not un assigned value- Specified by:
getDefaultValuein interfaceSparseVector- Returns:
-
iterator
Description copied from interface:VectorRetourne un objet Inc pret a etre utilisé pour boucler sur tous les element de la matrice. -
iteratorNotZero
Description copied from interface:VectorRetourne un objet Inc pret a etre utilisé pour boucler sur tous les element different de 0 de la matrice.- Specified by:
iteratorNotZeroin interfaceVector- Returns:
- un objet Inc pret à être utilisé
-
forEachNotZero
- Specified by:
forEachNotZeroin interfaceVector
-