org.nuiton.math.matrix
Class SubMatrix

java.lang.Object
  extended by org.nuiton.math.matrix.AbstractMatrixND
      extended by 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. Created: 29 oct. 2004

Version:
$Revision: 187 $ Mise a jour: $Date: 2009-10-16 19:17:29 +0200 (ven., 16 oct. 2009) $ par : $Author: tchemit $
Author:
Benjamin Poussin
See Also:
Serialized Form

Nested Class Summary
protected static interface SubMatrix.DimensionConverter
          Permet de faire une conversion de la dimension demandé dans la sous matrice avec la position reel de la matrice sous jacente.
protected  class SubMatrix.MappingConverter
          La conversion est le mapping d'un element vers un autre element
protected  class SubMatrix.ShiftConverter
          La conversion est juste un decalage d'indice
protected  class SubMatrix.SubMatrixIteratorImpl
           
 
Field Summary
protected  SubMatrix.DimensionConverter converter
           
protected  MatrixND matrix
           
 
Fields inherited from class org.nuiton.math.matrix.AbstractMatrixND
CSV_SEPARATOR, defaultValue, dim, dimHelper, dimNames, factory, name, NUMBER, semantics
 
Constructor Summary
SubMatrix(MatrixND matrix, int dim, int[] elem)
           
SubMatrix(MatrixND matrix, int dim, int start, int nb)
           
 
Method Summary
 double getValue(int[] coordinates)
          Renvoie un element de la matrice demandée en fonction des dimensions passé en paramètre.
 MatrixIterator iterator()
          Retourne un iterator sur toute la matrice.
 void setValue(int[] coordinates, double d)
          Modifie un element de la matrice en fonction des dimensions passé en paramètre.
 
Methods inherited from class org.nuiton.math.matrix.AbstractMatrixND
add, adds, clone, copy, cut, divs, equals, equals, equalsValues, exportCSV, fromList, getDim, getDim, getDimCount, getDimensionName, getDimensionName, getDimensionNames, getFactory, getMaxOccurence, getName, getNbDim, getSemantic, getSemantics, getSemantics, getSubMatrix, getSubMatrix, getSubMatrix, getSubMatrix, getSubMatrixOnSemantic, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, importCSV, init, isSupportedCSV, isValidCoordinates, isValidCoordinates, map, 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, sumAll, sumOverDim, sumOverDim, sumOverDim, toList, toString, transpose
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

matrix

protected MatrixND matrix

converter

protected SubMatrix.DimensionConverter converter
Constructor Detail

SubMatrix

public SubMatrix(MatrixND matrix,
                 int dim,
                 int start,
                 int nb)

SubMatrix

public SubMatrix(MatrixND matrix,
                 int dim,
                 int[] elem)
Method Detail

iterator

public MatrixIterator iterator()
Description copied from interface: MatrixND
Retourne un iterator sur toute la matrice.

Specified by:
iterator in interface MatrixND
Specified by:
iterator in class AbstractMatrixND
Returns:
matrix iterator

getValue

public double getValue(int[] coordinates)
Description copied from interface: MatrixND
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.

Specified by:
getValue in interface MatrixND
Specified by:
getValue in class AbstractMatrixND
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: MatrixND
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.

Specified by:
setValue in interface MatrixND
Specified by:
setValue in class AbstractMatrixND
Parameters:
coordinates - les différentes dimension à extraire.
d - l'entier double qui doit remplacer l'entier double spécifié par l'argument dimensions


Copyright © 2004-2010 CodeLutin. All Rights Reserved.