|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.MatrixMap.MatrixMapElastic<E>
E - public static class MatrixMap.MatrixMapElastic<E>
Implantation particuliere de matrice, qui lorsqu'on lui passe des dimension qui n'existe pas, elle les ajoutes dans les semantiques. Ceci n'est vrai que pour le set avec des semantiques, le set avec des indices ne rend pas la matrice elastique.
Cette classe fonctionne avec une matrice interne que l'on change lorsque l'on a besoin de modifier les dimensions. Le changement de dimension a donc un cout (creation d'une nouvelle matrice, copie des elements)
Si on cree une sous matrice, et que l'on modifie la matrice mere La sous matrice n'est pas impacter, puisqu'elle est base sur l'ancienne represention interne de la matrice elastique, les deux matrices n'ont donc plus de lien.
Les methodes reduce et extend retourne de nouvelle matrice qui ne sont pas elastique. Si on veut qu'elle le soit, il faut les reencapsuler
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.nuiton.util.MatrixMap |
|---|
MatrixMap.AbstractMatrixMap<E>, MatrixMap.Factory, MatrixMap.MapFunction<E>, MatrixMap.Matrix<E>, MatrixMap.MatrixHelper, MatrixMap.MatrixIterator<E>, MatrixMap.MatrixMapElastic<E>, MatrixMap.MatrixMapFixed<E>, MatrixMap.MatrixMapIterator<E>, MatrixMap.MatrixMapIteratorImpl<E>, MatrixMap.SemanticList<T>, MatrixMap.SubMatrix<E>, MatrixMap.Vector<E> |
| Field Summary | |
|---|---|
protected MatrixMap<E> |
internalMatrixMap
|
| Constructor Summary | |
|---|---|
MatrixMap.MatrixMapElastic()
|
|
MatrixMap.MatrixMapElastic(MatrixMap<E> m)
|
|
| Method Summary | |
|---|---|
MatrixMap<E> |
copy()
Copy la matrice pour pouvoir la modifier sans perdre les donnees initiales. |
boolean |
equals(MatrixMap mat)
Verifie que deux matrices sont completement equals (dimension, semantique, nom, valeur, ...) |
boolean |
equals(Object obj)
|
boolean |
equalsValues(MatrixMap<E> mat)
Verifie si les matrices sont egales en ne regardant que les valeurs et pas les semantiques |
MatrixMap<E> |
extend(Object... sems)
Permet de retourner une nouvelle matrice ayant les semantiques passées en parametre. |
int[] |
getDim()
|
int |
getDim(int d)
|
int |
getDimCount()
|
String |
getDimensionName(int dim)
|
String[] |
getDimensionNames()
|
MatrixMap<E> |
getInternalMatrixMap()
|
String |
getName()
|
MatrixMap.SemanticList |
getSemantic(int dim)
|
MatrixMap.SemanticList[] |
getSemantics()
|
MatrixMap<E> |
getSubMatrix(int dim,
Object... elem)
Permet de prendre une sous matrice dans la matrice courante. |
MatrixMap<E> |
getSubMatrix(int dim,
Object start,
int nb)
Permet de prendre une sous matrice dans la matrice courante. |
MatrixMap<E> |
getSubMatrix(Object[]... elems)
Permet de prendre une sous matrice dans la matrice courante. |
E |
getValue(Object... coordinates)
Retourne l'element a une certaine position en utilisant les semantiques |
E |
getValueIndex(int... coordinates)
Retourne l'element a une certaine position en utilisant des indices ex: 2,3,1 |
boolean |
isValidCoordinates(Object[] semantics)
Indique si les semantiques passées en argument sont valable pour la matrice courante |
MatrixMap.MatrixMapIterator<E> |
iterator()
|
MatrixMap<E> |
map(MatrixMap.MapFunction<E> f)
Applique sur chaque element de la matrice la fonction f |
MatrixMap |
paste(MatrixMap<E> mat)
Copie une matrice dans la matrice actuelle. |
MatrixMap<E> |
reduce()
Reduit la matrice de sorte que toutes les dimensions qui n'ont qu'un élement soit supprimée. |
MatrixMap<E> |
reduce(int minNbDim)
Reduit la matrice de sorte que toutes les dimensions qui n'ont qu'un élement soit supprimée. |
MatrixMap<E> |
reduceDims(int... dims)
Reduit le matrice seulement sur les dimensions passées en argument. |
void |
setDimensionName(int dim,
String name)
|
void |
setDimensionNames(String[] names)
|
void |
setInternalMatrixMap(MatrixMap<E> internalMatrixMap)
|
void |
setName(String name)
|
void |
setSemantic(int dim,
List sem)
|
void |
setValue(E value,
Object... coordinates)
Modifie l'element a une certaine position en utilisant les semantiques |
void |
setValueIndex(E value,
int... coordinates)
Modifie l'element a une certaine position en utilisant des indices ex: 2,3,1 |
String |
toString()
|
String |
toStringGeneric()
Representation string de la matrice quelque soit le nombre de dimension |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected MatrixMap<E> internalMatrixMap
| Constructor Detail |
|---|
public MatrixMap.MatrixMapElastic()
public MatrixMap.MatrixMapElastic(MatrixMap<E> m)
| Method Detail |
|---|
public MatrixMap<E> getInternalMatrixMap()
public void setInternalMatrixMap(MatrixMap<E> internalMatrixMap)
public MatrixMap.MatrixMapIterator<E> iterator()
iterator in interface Iterable<E>iterator in interface MatrixMap<E>public MatrixMap<E> copy()
MatrixMap
copy in interface MatrixMap<E>public MatrixMap.SemanticList[] getSemantics()
getSemantics in interface MatrixMap<E>public MatrixMap.SemanticList getSemantic(int dim)
getSemantic in interface MatrixMap<E>
public void setSemantic(int dim,
List sem)
setSemantic in interface MatrixMap<E>public void setName(String name)
setName in interface MatrixMap<E>public String getName()
getName in interface MatrixMap<E>public String[] getDimensionNames()
getDimensionNames in interface MatrixMap<E>public void setDimensionNames(String[] names)
setDimensionNames in interface MatrixMap<E>
public void setDimensionName(int dim,
String name)
setDimensionName in interface MatrixMap<E>public String getDimensionName(int dim)
getDimensionName in interface MatrixMap<E>public int getDimCount()
getDimCount in interface MatrixMap<E>public int[] getDim()
getDim in interface MatrixMap<E>public int getDim(int d)
getDim in interface MatrixMap<E>public MatrixMap<E> map(MatrixMap.MapFunction<E> f)
MatrixMap
map in interface MatrixMap<E>f - la fonction a appliquer
public E getValueIndex(int... coordinates)
MatrixMap
getValueIndex in interface MatrixMap<E>
public void setValueIndex(E value,
int... coordinates)
MatrixMap
setValueIndex in interface MatrixMap<E>value - la nouvelle valeurpublic E getValue(Object... coordinates)
MatrixMap
getValue in interface MatrixMap<E>
public void setValue(E value,
Object... coordinates)
MatrixMap
setValue in interface MatrixMap<E>value - la nouvelle valeurpublic boolean equals(Object obj)
equals in class Objectpublic boolean equals(MatrixMap mat)
MatrixMap
equals in interface MatrixMap<E>public boolean equalsValues(MatrixMap<E> mat)
MatrixMap
equalsValues in interface MatrixMap<E>public String toString()
toString in class Objectpublic String toStringGeneric()
MatrixMap
toStringGeneric in interface MatrixMap<E>public boolean isValidCoordinates(Object[] semantics)
MatrixMap
isValidCoordinates in interface MatrixMap<E>public MatrixMap paste(MatrixMap<E> mat)
MatrixMap
paste in interface MatrixMap<E>mat - la matrice à copier
public MatrixMap<E> getSubMatrix(int dim,
Object start,
int nb)
MatrixMap
getSubMatrix in interface MatrixMap<E>dim - la dimension dans lequel on veut une sous matricestart - la position dans dim d'ou il faut partir pour prendre la
sous matrice. 0 <= start < dim.size si start est négatif alors
la position de départ est calculé par rapport à la fin de la
dimension, pour avoir le dernier élément il faut passer -1nb - le nombre d'élément à prendre dans la dimension si nb est
inférieur ou égal à 0 alors cela indique qu'il faut prendre
tous les éléments jusqu'à la fin de la dimension.
public MatrixMap<E> getSubMatrix(int dim,
Object... elem)
MatrixMap
getSubMatrix in interface MatrixMap<E>dim - la dimension dans lequel on veut une sous matriceelem - les éléments dans la dimension à conserver
public MatrixMap<E> getSubMatrix(Object[]... elems)
MatrixMapMatrixMap.getSubMatrix(int, Object...) suivant
l'implémentation.
getSubMatrix in interface MatrixMap<E>elems - les éléments dans la dimension à conserver
public MatrixMap<E> reduce()
MatrixMap
reduce in interface MatrixMap<E>public MatrixMap<E> reduceDims(int... dims)
MatrixMap
reduceDims in interface MatrixMap<E>dims - les dimensions sur lequel il faut faire la reduction
public MatrixMap<E> reduce(int minNbDim)
MatrixMap
reduce in interface MatrixMap<E>minNbDim - le nombre minimum de dimension que l'on souhaite pour la
matrice résultat
public MatrixMap<E> extend(Object... sems)
MatrixMap
extend in interface MatrixMap<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||