Package org.nuiton.math.matrix
Class SubMatrix
java.lang.Object
org.nuiton.math.matrix.AbstractMatrixND
org.nuiton.math.matrix.SubMatrix
- All Implemented Interfaces:
Serializable,Cloneable,MatrixND
public class SubMatrix extends AbstractMatrixND
Pour l'instant une sous matrice a obligatoirement le meme nombre de dimension
que la matrice qu'elle contient. Elle permet juste de reduire le nombre
d'element d'une dimension.
C'est comme une "vue" réduite sur la vraie matrices.
Created: 29 oct. 2004
- Version:
- $Revision$ Mise a jour: $Date$ par : $Author$
- Author:
- Benjamin Poussin <poussin@codelutin.com>
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceSubMatrix.DimensionConverterPermet de faire une conversion de la dimension demandé dans la sous matrice avec la position reel de la matrice sous jacente.protected static classSubMatrix.MappingConverterLa conversion est le mapping d'un element vers un autre element.protected static classSubMatrix.ShiftConverterLa conversion est juste un decalage d'indiceprotected classSubMatrix.SubMatrixExcludeIteratorImplprotected classSubMatrix.SubMatrixIteratorImpl -
Field Summary
Fields Modifier and Type Field Description protected SubMatrix.DimensionConverterconverterprotected MatrixNDmatrixFields inherited from class org.nuiton.math.matrix.AbstractMatrixND
CSV_SEPARATOR, defaultValue, dim, dimHelper, dimNames, factory, name, NUMBER, NUMBER_REGEX, semantics -
Constructor Summary
-
Method Summary
Modifier and Type Method Description intgetNumberOfAssignedValue()return value of inner matrix, this is not realy a good choice, but it's better than 0.doublegetValue(int[] coordinates)Renvoie un element de la matrice demandée en fonction des dimensions passé en paramètre.
Exemple: Si on a un matrice 3D.
getValue(1,1,1) retourne un element de la matrice.MatrixIteratoriterator()Retourne un iterator sur toute la matrice.MatrixIteratoriteratorNotZero()Retourne un iterator pour toutes les valeurs de la matrices differente de 0voidsetValue(int[] coordinates, double d)Modifie un element de la matrice en fonction des dimensions passé en paramètre.
Exemple: Si on a un matrice 3D.
set([1,1,1], m) modifie un element de la matrice.Methods inherited from class org.nuiton.math.matrix.AbstractMatrixND
add, adds, clone, copy, cut, divs, equals, equals, equalsValues, exportCSV, exportCSV2D, exportCSVND, fromList, getDim, getDim, getDimCount, getDimensionName, getDimensionName, getDimensionNames, getFactory, getMaxOccurence, getMaxOccurrence, getName, getNbDim, getSemantic, getSemantics, getSemantics, getSubMatrix, getSubMatrix, getSubMatrix, getSubMatrix, getSubMatrix, getSubMatrix, getSubMatrixOnSemantic, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, importCSV, importCSV, importCSV, importCSVND, init, isSupportedCSV, isValidCoordinates, isValidCoordinates, map, meanAll, meanOverDim, meanOverDim, minus, minuss, mult, mults, paste, paste, pasteSemantics, reduce, reduce, reduce, reduceDims, setDimensionName, setDimensionName, setDimensionNames, setName, setSemantic, setSemantics, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, size, sumAll, sumOverDim, sumOverDim, sumOverDim, toList, toString, transpose
-
Field Details
-
Constructor Details
-
Method Details
-
getNumberOfAssignedValue
public int getNumberOfAssignedValue()return value of inner matrix, this is not realy a good choice, but it's better than 0.- Returns:
-
iterator
Description copied from interface:MatrixNDRetourne un iterator sur toute la matrice.- Returns:
- matrix iterator
-
iteratorNotZero
Description copied from interface:MatrixNDRetourne un iterator pour toutes les valeurs de la matrices differente de 0- Returns:
- matrix iterator
-
getValue
public double getValue(int[] coordinates)Description copied from interface:MatrixNDRenvoie un element de la matrice demandée en fonction des dimensions passé en paramètre.
Exemple: Si on a un matrice 3D.
getValue(1,1,1) retourne un element de la matrice.- Parameters:
coordinates- les différentes dimension à extraire. Le tableau doit contenir toutes les dimensions de la matrice, et seulement des nombres positif- Returns:
- un entier double.
-
setValue
public void setValue(int[] coordinates, double d)Description copied from interface:MatrixNDModifie un element de la matrice en fonction des dimensions passé en paramètre.
Exemple: Si on a un matrice 3D.
set([1,1,1], m) modifie un element de la matrice.- Parameters:
coordinates- dimension indicesd- new double value to set into matrix at specified dimensions
-