public class Subspace
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<Subspace> |
DIMENSION_COMPARATOR
A comparator for subspaces based on their involved dimensions.
|
private int |
dimensionality
The dimensionality of this subspace.
|
private long[] |
dimensions
The dimensions building this subspace.
|
Constructor and Description |
---|
Subspace(int dimension)
Creates a new one-dimensional subspace of the original data space.
|
Subspace(long[] dimensions)
Creates a new k-dimensional subspace of the original data space.
|
Modifier and Type | Method and Description |
---|---|
int |
dimensionality()
Returns the dimensionality of this subspace.
|
java.lang.String |
dimensionsToString()
Returns a string representation of the dimensions of this subspace
separated by comma.
|
java.lang.String |
dimensonsToString(java.lang.String sep)
Returns a string representation of the dimensions of this subspace.
|
boolean |
equals(java.lang.Object obj) |
long[] |
getDimensions()
Returns the BitSet representing the dimensions of this subspace.
|
int |
hashCode()
Returns the hash code value of the
dimensions of this subspace. |
boolean |
isSubspace(Subspace subspace)
Returns true if this subspace is a subspace of the specified subspace, i.e.
|
Subspace |
join(Subspace other)
Joins this subspace with the specified subspace.
|
protected long[] |
joinLastDimensions(Subspace other)
Joins the dimensions of this subspace with the dimensions of the specified
subspace.
|
java.lang.String |
toString() |
private final long[] dimensions
private final int dimensionality
public static java.util.Comparator<Subspace> DIMENSION_COMPARATOR
If the two subspaces have different dimensionalities a negative integer or
a positive integer will be returned if the dimensionality of the first
subspace is less than or greater than the dimensionality of the second
subspace. Otherwise the comparison works as follows: Let d1
and
d2
be the first occurrences of pairwise unequal dimensions in the
specified subspaces. Then a negative integer or a positive integer will be
returned if d1
is less than or greater than d2
. Otherwise
the two subspaces have equal dimensions and zero will be returned.
public Subspace(int dimension)
dimension
- the dimension building this subspacepublic Subspace(long[] dimensions)
dimensions
- the dimensions building this subspacepublic final long[] getDimensions()
public final int dimensionality()
public Subspace join(Subspace other)
other
- the subspace to joinjoinLastDimensions(Subspace)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String dimensionsToString()
public java.lang.String dimensonsToString(java.lang.String sep)
sep
- the separator between the dimensionspublic boolean isSubspace(Subspace subspace)
subspace
- the subspace to testprotected long[] joinLastDimensions(Subspace other)
other
- the subspace to joinpublic int hashCode()
dimensions
of this subspace.hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2019 ELKI Development Team. License information.