|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.data.AbstractDatabaseObject
de.lmu.ifi.dbs.elki.data.NumberVector<BitVector,Bit>
de.lmu.ifi.dbs.elki.data.BitVector
public class BitVector
Provides a BitVector wrapping a BitSet.
Field Summary | |
---|---|
private BitSet |
bits
Storing the bits. |
private int |
dimensionality
Dimensionality of this bit vector. |
Fields inherited from class de.lmu.ifi.dbs.elki.data.NumberVector |
---|
ATTRIBUTE_SEPARATOR |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug |
Constructor Summary | |
---|---|
BitVector(Bit[] bits)
Provides a new BitVector corresponding to the bits in the given array. |
|
BitVector(BitSet bits,
int dimensionality)
Provides a new BitVector corresponding to the specified bits and of the specified dimensionality. |
Method Summary | |
---|---|
boolean |
areSet(int[] indices)
Returns whether the bits at all of the specified indices are set. |
boolean |
contains(BitSet bitset)
Returns whether this BitVector contains all bits that are set to true in the specified BitSet. |
boolean |
equals(Object obj)
This BitVector is equal to a given Object, if the Object is a BitVector of same dimensionality and with identical bits set. |
BitSet |
getBits()
Returns a copy of the bits currently set in this BitVector. |
Vector |
getColumnVector()
Returns a Vector representing in one column and getDimensionality() rows the values of this FeatureVector. |
int |
getDimensionality()
The dimensionality of the vector space whereof this FeatureVector is an element. |
Matrix |
getRowVector()
Returns a Matrix representing in one row and getDimensionality() columns the values of this
FeatureVector. |
Bit |
getValue(int dimension)
Returns the value in the specified dimension. |
boolean |
isSet(int index)
Returns whether the bit at specified index is set. |
BitVector |
multiplicate(double k)
Returns a bit vector equal to this bit vector, if k is not 0, a bit vector with all components equal to zero otherwise. |
BitVector |
negativeVector()
Returns the inverse of the bit vector. |
BitVector |
newInstance(Bit[] values)
Returns a new FeatureVector of T for the given values. |
BitVector |
nullVector()
Returns a bit vector of equal dimensionality but containing 0 only. |
BitVector |
plus(BitVector fv)
Returns a bit vector corresponding to an XOR operation on this and the specified bit vector. |
BitVector |
randomInstance(Bit min,
Bit max,
Random random)
Returns the same as randomInstance(Random) . |
BitVector |
randomInstance(Random random)
Returns a FeatureVector of T with uniformly distributed (0-1) random values. |
int[] |
setBits()
Returns the indices of all set bits. |
String |
toString()
Returns a String representation of this BitVector. |
Methods inherited from class de.lmu.ifi.dbs.elki.data.NumberVector |
---|
getAttributes, getMax, getMin |
Methods inherited from class de.lmu.ifi.dbs.elki.data.AbstractDatabaseObject |
---|
getID, setID |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.data.DatabaseObject |
---|
getID, setID |
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialObject |
---|
getID |
Field Detail |
---|
private BitSet bits
private int dimensionality
Constructor Detail |
---|
public BitVector(BitSet bits, int dimensionality) throws IllegalArgumentException
bits
- the bits to be set in this BitVectordimensionality
- the dimensionality of this BitVector
IllegalArgumentException
- if the specified dimensionality is to small to match the
given BitSetpublic BitVector(Bit[] bits)
bits
- an array of bits specifiying the bits in this bit vectorMethod Detail |
---|
public BitVector newInstance(Bit[] values)
FeatureVector
newInstance
in interface FeatureVector<BitVector,Bit>
newInstance
in class NumberVector<BitVector,Bit>
values
- the values of the featureVector
FeatureVector.newInstance(Number[])
public BitVector randomInstance(Random random)
FeatureVector
random
- a Random instance
FeatureVector.randomInstance(Random)
public BitVector randomInstance(Bit min, Bit max, Random random)
randomInstance(Random)
.
min
- minimum of random valuemax
- maximu of random valuerandom
- a random instance
FeatureVector.randomInstance(Number, Number, Random)
public int getDimensionality()
FeatureVector
FeatureVector.getDimensionality()
public Bit getValue(int dimension)
FeatureVector
dimension
- the desired dimension, where 1 ≤ dimension ≤
this.getDimensionality()
FeatureVector.getValue(int)
public Vector getColumnVector()
FeatureVector
getDimensionality()
rows the values of this FeatureVector.
getDimensionality()
rows the values of this
FeatureVectorFeatureVector.getColumnVector()
public Matrix getRowVector()
FeatureVector
getDimensionality()
columns the values of this
FeatureVector.
getDimensionality()
columns the values of this
FeatureVectorFeatureVector.getRowVector()
public BitVector multiplicate(double k)
k
- a scalar to multiply this FeatureVector with
FeatureVector.multiplicate(double)
public BitVector negativeVector()
FeatureVector.negativeVector()
public BitVector nullVector()
FeatureVector.nullVector()
public BitVector plus(BitVector fv)
fv
- a FeatureVector to be added to this Featurevector
FeatureVector.plus(FeatureVector)
public boolean isSet(int index)
index
- the index of the bit to inspect
index
is set, false
otherwise.public boolean areSet(int[] indices)
indices
- the indices to inspect
public int[] setBits()
public boolean contains(BitSet bitset)
bitset
- the bits to inspect in this BitVector
public BitSet getBits()
public String toString()
BitVectorLabelParser
.
toString
in interface FeatureVector<BitVector,Bit>
toString
in class Object
Object.toString()
public boolean equals(Object obj)
equals
in interface DatabaseObject
equals
in class NumberVector<BitVector,Bit>
obj
- another Object
DatabaseObject.equals(Object)
|
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |