org.nuiton.math.matrix
Class MatrixNDImpl

java.lang.Object
  extended by org.nuiton.math.matrix.AbstractMatrixND
      extended by org.nuiton.math.matrix.MatrixNDImpl
All Implemented Interfaces:
Serializable, Cloneable, MatrixND

public class MatrixNDImpl
extends AbstractMatrixND

MatrixNDImpl. Created: 29 oct. 2004

Version:
$Revision: 323 $ Mise a jour: $Date: 2011-01-22 10:32:20 +0100 (sam., 22 janv. 2011) $ par : $Author: tchemit $
Author:
Benjamin Poussin
See Also:
Serialized Form

Field Summary
protected  BasicMatrix matrix
           
 
Fields inherited from class org.nuiton.math.matrix.AbstractMatrixND
CSV_SEPARATOR, defaultValue, dim, dimHelper, dimNames, factory, name, NUMBER, semantics
 
Constructor Summary
protected MatrixNDImpl(MatrixFactory factory, int[] dim)
           
protected MatrixNDImpl(MatrixFactory factory, List<?>[] semantics)
           
protected MatrixNDImpl(MatrixFactory factory, MatrixND matrix)
           
protected MatrixNDImpl(MatrixFactory factory, String name, int[] dim)
           
protected MatrixNDImpl(MatrixFactory factory, String name, int[] dim, String[] dimNames)
           
protected MatrixNDImpl(MatrixFactory factory, String name, List<?>[] semantics)
           
protected MatrixNDImpl(MatrixFactory factory, String name, List<?>[] semantics, String[] dimNames)
           
 
Method Summary
 MatrixND add(MatrixND m)
          Modifie la matrice actuelle en lui ajoutant les valeurs de la matrice passé en parametre.
 double getMaxOccurence()
          Deprecated. 
 double getMaxOccurrence()
          Retourne la valeur la plus courrement rencontrer dans un tableau.
 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.
 MatrixND map(MapFunction f)
          Si le vector utilise par la BasicMatix supporte la method map, on l'utilise pour gagner du temps
 MatrixND minus(MatrixND m)
          Modifie la matrice actuelle en lui soustrayant les valeurs de la matrice passé en parametre.
 MatrixND paste(int[] origin, MatrixND mat)
          Si on peut on utilise le paste du vector de BasicMatix, sinon on utilise la methode de AbstractMatrixND.
 void setValue(int[] coordinates, double d)
          Modifie un element de la matrice en fonction des dimensions passé en paramètre.
 String toString()
           
 
Methods inherited from class org.nuiton.math.matrix.AbstractMatrixND
adds, clone, copy, cut, divs, equals, equals, equalsValues, exportCSV, exportCSV2D, exportCSVND, fromList, getDim, getDim, getDimCount, getDimensionName, getDimensionName, getDimensionNames, getFactory, 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, importCSVNDReadDimension, init, isSupportedCSV, isValidCoordinates, isValidCoordinates, meanAll, meanOverDim, meanOverDim, minuss, mult, mults, 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, transpose
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

matrix

protected BasicMatrix matrix
Constructor Detail

MatrixNDImpl

protected MatrixNDImpl(MatrixFactory factory,
                       int[] dim)

MatrixNDImpl

protected MatrixNDImpl(MatrixFactory factory,
                       List<?>[] semantics)

MatrixNDImpl

protected MatrixNDImpl(MatrixFactory factory,
                       String name,
                       int[] dim)

MatrixNDImpl

protected MatrixNDImpl(MatrixFactory factory,
                       String name,
                       int[] dim,
                       String[] dimNames)

MatrixNDImpl

protected MatrixNDImpl(MatrixFactory factory,
                       String name,
                       List<?>[] semantics)

MatrixNDImpl

protected MatrixNDImpl(MatrixFactory factory,
                       String name,
                       List<?>[] semantics,
                       String[] dimNames)

MatrixNDImpl

protected MatrixNDImpl(MatrixFactory factory,
                       MatrixND matrix)
Method Detail

iterator

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

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.

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.

Parameters:
coordinates - dimension indices
d - new double value to set into matrix at specified dimensions

getMaxOccurence

@Deprecated
public double getMaxOccurence()
Deprecated. 

Description copied from interface: MatrixND
Retourne la valeur la plus couramment rencontree dans un tableau. Si plusieurs valeurs ont le même nombre d'occurrence la plus petite valeur est retourné.

Specified by:
getMaxOccurence in interface MatrixND
Overrides:
getMaxOccurence in class AbstractMatrixND
Returns:
la valeur la plus nombreuse dans le tableau

getMaxOccurrence

public double getMaxOccurrence()
Description copied from interface: MatrixND
Retourne la valeur la plus courrement rencontrer dans un tableau. Si plusieurs valeurs ont le même nombre d'occurrence la plus petite valeur est retourné.

Specified by:
getMaxOccurrence in interface MatrixND
Overrides:
getMaxOccurrence in class AbstractMatrixND
Returns:
la valeur la plus nombreuse dans le tableau

toString

public String toString()
Overrides:
toString in class AbstractMatrixND

map

public MatrixND map(MapFunction f)
Si le vector utilise par la BasicMatix supporte la method map, on l'utilise pour gagner du temps

Specified by:
map in interface MatrixND
Overrides:
map in class AbstractMatrixND
Parameters:
f - function to apply
Returns:
this

paste

public MatrixND paste(int[] origin,
                      MatrixND mat)
Si on peut on utilise le paste du vector de BasicMatix, sinon on utilise la methode de AbstractMatrixND.

Specified by:
paste in interface MatrixND
Overrides:
paste in class AbstractMatrixND
Parameters:
origin - le point d'origine a partir duquel on colle la matrice
mat - une matrice avec le meme nombre de dimension, si la matrice que l'on colle est trop grande, les valeurs qui depasse ne sont pas prises en compte
Returns:
return la matrice courante.

add

public MatrixND add(MatrixND m)
Description copied from class: AbstractMatrixND
Modifie la matrice actuelle en lui ajoutant les valeurs de la matrice passé en parametre. La matrice passé en parametre doit avoir le meme nombre de dimension, et chacune de ses dimensions doit avoir un nombre d'element au moins egal a cette matrice.

Specified by:
add in interface MatrixND
Overrides:
add in class AbstractMatrixND
Parameters:
m - matrix to add
Returns:
new matrix

minus

public MatrixND minus(MatrixND m)
Modifie la matrice actuelle en lui soustrayant les valeurs de la matrice passé en parametre. La matrice passé en parametre doit avoir le meme nombre de dimension, et chacune de ses dimensions doit avoir un nombre d'element au moins egal a cette matrice.

Specified by:
minus in interface MatrixND
Overrides:
minus in class AbstractMatrixND
Parameters:
m - matrix to minus
Returns:
new matrix


Copyright © 2004-2011 CodeLutin. All Rights Reserved.