public final class RelationUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RelationUtil.AscendingByDoubleRelation
Sort objects by a double relation
|
static class |
RelationUtil.CollectionFromRelation<O>
Collection view on a database that retrieves the objects when needed.
|
static class |
RelationUtil.DescendingByDoubleRelation
Sort objects by a double relation
|
static class |
RelationUtil.RelationObjectIterator<O>
Iterator class that retrieves the given objects from the database.
|
Modifier | Constructor and Description |
---|---|
private |
RelationUtil()
Fake constructor: do not instantiate.
|
Modifier and Type | Method and Description |
---|---|
static <V extends FeatureVector<?>> |
assumeVectorField(Relation<V> relation)
Get the vector field type information from a relation.
|
static double[][] |
computeMinMax(Relation<? extends NumberVector> relation)
Determines the minimum and maximum values in each dimension of all objects
stored in the given database.
|
static int |
dimensionality(Relation<? extends SpatialComparable> relation)
Get the dimensionality of a database relation.
|
static <V extends SpatialComparable> |
getColumnLabel(Relation<? extends V> rel,
int col)
Get the column name or produce a generic label "Column XY".
|
static <V extends NumberVector> |
getNumberVectorFactory(Relation<V> relation)
Get the number vector factory of a database relation.
|
static double[][] |
relationAsMatrix(Relation<? extends NumberVector> relation,
ArrayDBIDs ids)
Copy a relation into a double matrix.
|
static <V extends NumberVector,T extends NumberVector> |
relationUglyVectorCast(Relation<T> database)
An ugly vector type cast unavoidable in some situations due to Generics.
|
static double[] |
variances(Relation<? extends NumberVector> database,
NumberVector centroid,
DBIDs ids)
Determines the variances in each dimension of the specified objects stored
in the given database.
|
public static <V extends FeatureVector<?>> VectorFieldTypeInformation<V> assumeVectorField(Relation<V> relation)
V
- Vector typerelation
- relationpublic static <V extends NumberVector> NumberVector.Factory<V> getNumberVectorFactory(Relation<V> relation)
V
- Vector typerelation
- relationpublic static int dimensionality(Relation<? extends SpatialComparable> relation)
relation
- relationpublic static double[][] computeMinMax(Relation<? extends NumberVector> relation)
relation
- the database storing the objectspublic static double[] variances(Relation<? extends NumberVector> database, NumberVector centroid, DBIDs ids)
database
- the database storing the objectsids
- the ids of the objectscentroid
- the centroid or reference vector of the idspublic static double[][] relationAsMatrix(Relation<? extends NumberVector> relation, ArrayDBIDs ids)
relation
- Relationids
- IDs, with well-defined order (i.e. array)public static <V extends SpatialComparable> String getColumnLabel(Relation<? extends V> rel, int col)
V
- Vector typerel
- Relationcol
- Columnpublic static <V extends NumberVector,T extends NumberVector> Relation<V> relationUglyVectorCast(Relation<T> database)
V
- Base vector typeT
- Derived vector type (is actually V, too)database
- DatabaseCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.