summaryrefslogtreecommitdiff
path: root/src/de/lmu/ifi/dbs/elki/data/type/TypeUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/lmu/ifi/dbs/elki/data/type/TypeUtil.java')
-rw-r--r--src/de/lmu/ifi/dbs/elki/data/type/TypeUtil.java25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/de/lmu/ifi/dbs/elki/data/type/TypeUtil.java b/src/de/lmu/ifi/dbs/elki/data/type/TypeUtil.java
index 7abad242..91257906 100644
--- a/src/de/lmu/ifi/dbs/elki/data/type/TypeUtil.java
+++ b/src/de/lmu/ifi/dbs/elki/data/type/TypeUtil.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.data.type;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2011
+ Copyright (C) 2012
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
@@ -30,10 +30,13 @@ import de.lmu.ifi.dbs.elki.data.ExternalID;
import de.lmu.ifi.dbs.elki.data.LabelList;
import de.lmu.ifi.dbs.elki.data.NumberVector;
import de.lmu.ifi.dbs.elki.data.SparseFloatVector;
+import de.lmu.ifi.dbs.elki.data.model.Model;
import de.lmu.ifi.dbs.elki.data.spatial.PolygonsObject;
import de.lmu.ifi.dbs.elki.database.ids.DBID;
+import de.lmu.ifi.dbs.elki.database.ids.DBIDFactory;
import de.lmu.ifi.dbs.elki.math.linearalgebra.Matrix;
import de.lmu.ifi.dbs.elki.math.linearalgebra.Vector;
+import de.lmu.ifi.dbs.elki.persistent.ByteArrayUtil;
/**
* Utility package containing various common types
@@ -52,12 +55,12 @@ public final class TypeUtil {
/**
* Database IDs
*/
- public static final SimpleTypeInformation<DBID> DBID = new SimpleTypeInformation<DBID>(DBID.class);
+ public static final SimpleTypeInformation<DBID> DBID = new SimpleTypeInformation<DBID>(DBID.class, DBIDFactory.FACTORY.getDBIDSerializer());
/**
* A string
*/
- public static final SimpleTypeInformation<String> STRING = new SimpleTypeInformation<String>(String.class);
+ public static final SimpleTypeInformation<String> STRING = new SimpleTypeInformation<String>(String.class, ByteArrayUtil.STRING_SERIALIZER);
/**
* A class label
@@ -77,6 +80,11 @@ public final class TypeUtil {
public static final TypeInformation GUESSED_LABEL = new AlternativeTypeInformation(LABELLIST, CLASSLABEL, STRING);
/**
+ * Number vectors of <em>variable</em> length.
+ */
+ public static final SimpleTypeInformation<? super NumberVector<?, ?>> NUMBER_VECTOR_VARIABLE_LENGTH = new SimpleTypeInformation<NumberVector<?, ?>>(NumberVector.class);
+
+ /**
* Input type for algorithms that require number vector fields.
*/
public static final VectorFieldTypeInformation<NumberVector<?, ?>> NUMBER_VECTOR_FIELD = new VectorFieldTypeInformation<NumberVector<?, ?>>(NumberVector.class);
@@ -86,7 +94,7 @@ public final class TypeUtil {
*
* If possible, please use {@link #NUMBER_VECTOR_FIELD}!
*/
- public static final VectorFieldTypeInformation<DoubleVector> DOUBLE_VECTOR_FIELD = new VectorFieldTypeInformation<DoubleVector>(DoubleVector.class);
+ public static final VectorFieldTypeInformation<DoubleVector> DOUBLE_VECTOR_FIELD = new VectorFieldTypeInformation<DoubleVector>(DoubleVector.class, DoubleVector.STATIC);
/**
* Input type for algorithms that require number vector fields.
@@ -111,12 +119,12 @@ public final class TypeUtil {
/**
* Double type, outlier scores etc.
*/
- public static final SimpleTypeInformation<Double> DOUBLE = new SimpleTypeInformation<Double>(Double.class);
+ public static final SimpleTypeInformation<Double> DOUBLE = new SimpleTypeInformation<Double>(Double.class, ByteArrayUtil.DOUBLE_SERIALIZER);
/**
* Integer type.
*/
- public static final SimpleTypeInformation<Integer> INTEGER = new SimpleTypeInformation<Integer>(Integer.class);
+ public static final SimpleTypeInformation<Integer> INTEGER = new SimpleTypeInformation<Integer>(Integer.class, ByteArrayUtil.INT_SERIALIZER);
/**
* Vector type.
@@ -129,6 +137,11 @@ public final class TypeUtil {
public static final SimpleTypeInformation<Matrix> MATRIX = new SimpleTypeInformation<Matrix>(Matrix.class);
/**
+ * Cluster model type.
+ */
+ public static final SimpleTypeInformation<Model> MODEL = new SimpleTypeInformation<Model>(Model.class);
+
+ /**
* Make a type array easily.
*
* @param ts Types