public class MatrixFactory extends Object
Created: 11 octobre 2005 20:15:20 CEST
| Modifier and Type | Field and Description |
|---|---|
protected static SemanticMapper |
defaultSemanticMapper |
protected static Class<?> |
defaultSparseVectorClass |
protected static int |
defaultThresholdSparse
if we try to allocate matrix with more that this threshold, sparse matrix is used
|
protected static boolean |
defaultUseLazyVector
If true, createVector return all time LazyVector to prevent memory
allocation when not necessary.
|
protected static Class<?> |
defaultVectorClass
Valeur par defaut si aucun type de Vector n'est donné
|
protected Class<?> |
sparseVectorClass |
protected int |
thresholdSparse |
protected boolean |
useLazyVector |
protected Class<?> |
vectorClass |
| Modifier | Constructor and Description |
|---|---|
protected |
MatrixFactory(Class<?> vectorClass,
Class<?> sparseVectorClass,
int thresholdSparse,
boolean useLazyVector) |
| Modifier and Type | Method and Description |
|---|---|
MatrixND |
create(double[] values,
int[] dim)
Convert a double array into matrix.
|
MatrixND |
create(int[] dim) |
MatrixND |
create(List<?>[] semantics) |
MatrixND |
create(MatrixND matrix)
Create new matrix by copying matrix in argument
|
MatrixND |
create(MatrixND matrix,
Vector data)
Create new matrix by copying matrix in argument, and force backend
to be data.
|
MatrixND |
create(String name,
int[] dim) |
MatrixND |
create(String name,
int[] dim,
String[] dimNames) |
MatrixND |
create(String name,
int[] dim,
String[] dimNames,
Vector data)
Create new matrix and force backend to be data.
|
MatrixND |
create(String name,
List<?>[] semantics) |
MatrixND |
create(String name,
List<?>[] semantics,
String[] dimNames) |
MatrixND |
create(String name,
List<?>[] semantics,
String[] dimNames,
Vector data)
Create new matrix and force backend to be data.
|
MatrixProxy |
createProxy(List<?>[] semantics,
MatrixProvider matrixProvider) |
MatrixProxy |
createProxy(String name,
int[] dim,
MatrixProvider matrixProvider) |
MatrixProxy |
createProxy(String name,
int[] dim,
String[] dimNames,
MatrixProvider matrixProvider) |
MatrixProxy |
createProxy(String name,
List<?>[] semantics,
MatrixProvider matrixProvider) |
MatrixProxy |
createProxy(String name,
List<?>[] semantics,
String[] dimNames,
MatrixProvider matrixProvider) |
protected Vector |
createVector(int length)
cree un nouveau Vector.
|
static Class<?> |
getDefaultVectorClass() |
static MatrixFactory |
getInstance()
Utilise par defaut
defaultVectorClass. |
static MatrixFactory |
getInstance(Class<?> vectorClass)
Retourne une factory utilisant vectorClass comme classe de base a
l'implantation des matrices, aussi bien pour les matrices dense que
les matrices creuse.
|
static MatrixFactory |
getInstance(Class<?> vectorClass,
Class<?> sparseVectorClass,
int thresholdSparse)
Retourne une factory utilisant, par defaut on utilise les LazyVector
|
static MatrixFactory |
getInstance(Class<?> vectorClass,
Class<?> sparseVectorClass,
int thresholdSparse,
boolean useLazyVector)
Retourne une factory utilisant vectorClass comme classe de base a
l'implantation des matrices.
|
static SemanticMapper |
getSemanticMapper() |
Class<?> |
getSparseVectorClass() |
int |
getThresholdSparse() |
Class<?> |
getVectorClass() |
static void |
initMatrixFactoryThreadLocal(Class<?> vectorClass,
Class<?> sparseVectorClass,
int thresholdSparse,
boolean useLazyVector)
Initialise une factory pour le thread courant avec le vectorClass passe
en parametre.
|
boolean |
isUseLazyVector() |
MatrixND |
matrixId(int size)
Crée une nouvelle matrice identité.
|
static void |
removeMatrixFactoryThreadLocal()
Retire la factory pour le thread courant
|
static void |
setDefaultSparseVectorClass(Class<?> defaultSparseVectorClass) |
static void |
setDefaultThresholdSparse(int defaultThresholdSparse) |
static void |
setDefaultUseLazyVector(boolean useLazyVector) |
static void |
setDefaultVectorClass(Class<?> vectorClass) |
static void |
setSemanticMapper(SemanticMapper semanticMapper) |
protected static boolean defaultUseLazyVector
protected static Class<?> defaultVectorClass
protected static Class<?> defaultSparseVectorClass
protected static int defaultThresholdSparse
protected Class<?> vectorClass
protected Class<?> sparseVectorClass
protected int thresholdSparse
protected boolean useLazyVector
protected static SemanticMapper defaultSemanticMapper
public Class<?> getVectorClass()
public Class<?> getSparseVectorClass()
public int getThresholdSparse()
public boolean isUseLazyVector()
public static void setDefaultVectorClass(Class<?> vectorClass)
public static void setDefaultSparseVectorClass(Class<?> defaultSparseVectorClass)
public static void setDefaultThresholdSparse(int defaultThresholdSparse)
public static void setDefaultUseLazyVector(boolean useLazyVector)
public static Class<?> getDefaultVectorClass()
public static void setSemanticMapper(SemanticMapper semanticMapper)
public static SemanticMapper getSemanticMapper()
public static MatrixFactory getInstance(Class<?> vectorClass)
vectorClass - vector class implementationpublic static MatrixFactory getInstance(Class<?> vectorClass, Class<?> sparseVectorClass, int thresholdSparse)
vectorClass - vector class implementation for dense matrixsparseVectorClass - vector class implementation for sparse matrixthresholdSparse - threshold to determine usage of dense or sparse matrixpublic static MatrixFactory getInstance(Class<?> vectorClass, Class<?> sparseVectorClass, int thresholdSparse, boolean useLazyVector)
vectorClass - vector class implementation for dense matrixsparseVectorClass - vector class implementation for sparse matrixthresholdSparse - threshold to determine usage of dense or sparse matrixuseLazyVector - if true use LazyVectorpublic static MatrixFactory getInstance()
defaultVectorClass. Si une factory a ete
initialisee pour le thread local, alors celle-ci sera reutilise, sinon
une nouvelle est cree avec le backend par defautpublic static void initMatrixFactoryThreadLocal(Class<?> vectorClass, Class<?> sparseVectorClass, int thresholdSparse, boolean useLazyVector)
vectorClass - vector class implementation for dense matrixsparseVectorClass - vector class implementation for sparse matrixthresholdSparse - threshold to determine usage of dense or sparse matrixuseLazyVector - if true use LazyVectorpublic static void removeMatrixFactoryThreadLocal()
public MatrixND create(int[] dim)
public MatrixND create(double[] values, int[] dim)
values - The values to fill the matrixdim - An array representing the dimensions of the matrixpublic MatrixND create(String name, int[] dim, String[] dimNames, Vector data)
name - matrix's name (can be null)dim - matrix's dimension (must be provided)dimNames - dimensions' name (can be null)data - backend used to new matrixpublic MatrixND create(String name, List<?>[] semantics, String[] dimNames, Vector data)
name - matrix's name (can be null)semantics - semantiques (must be provided)dimNames - dimensions' name (can be null)data - backend used to new matrixpublic MatrixND create(MatrixND matrix)
matrix - public MatrixND create(MatrixND matrix, Vector data)
matrix - matrix to copieddata - backend used to new matrixpublic MatrixND matrixId(int size)
size - la taille de la matriceprotected Vector createVector(int length)
length - public MatrixProxy createProxy(List<?>[] semantics, MatrixProvider matrixProvider)
public MatrixProxy createProxy(String name, int[] dim, MatrixProvider matrixProvider)
public MatrixProxy createProxy(String name, int[] dim, String[] dimNames, MatrixProvider matrixProvider)
public MatrixProxy createProxy(String name, List<?>[] semantics, MatrixProvider matrixProvider)
public MatrixProxy createProxy(String name, List<?>[] semantics, String[] dimNames, MatrixProvider matrixProvider)
Copyright © 2004–2014 CodeLutin. All rights reserved.