de.lmu.ifi.dbs.elki.math.linearalgebra
Class ProjectedCentroid

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.math.linearalgebra.Vector
      extended by de.lmu.ifi.dbs.elki.math.linearalgebra.Centroid
          extended by de.lmu.ifi.dbs.elki.math.linearalgebra.ProjectedCentroid
All Implemented Interfaces:
MatrixLike<Vector>, Serializable, Cloneable

public class ProjectedCentroid
extends Centroid

Centroid only using a subset of dimensions. This class abstracts the mathematics of efficient and numerically stable computation of projected centroids. See DatabaseUtil for easier to use APIs.

See Also:
Serialized Form

Field Summary
private  BitSet dims
          The selected dimensions.
private static long serialVersionUID
          Serial version
 
Fields inherited from class de.lmu.ifi.dbs.elki.math.linearalgebra.Centroid
wsum
 
Fields inherited from class de.lmu.ifi.dbs.elki.math.linearalgebra.Vector
elements
 
Constructor Summary
ProjectedCentroid(BitSet dims, int dim)
          Constructor for updating use.
 
Method Summary
static ProjectedCentroid make(BitSet dims, Relation<? extends NumberVector<?,?>> relation)
          Static Constructor from a relation.
static ProjectedCentroid make(BitSet dims, Relation<? extends NumberVector<?,?>> relation, Iterable<DBID> ids)
          Static Constructor from a relation.
 void put(double[] val)
          Add a single value with weight 1.0
 void put(double[] val, double weight)
          Add data with a given weight.
 void put(NumberVector<?,?> val)
          Add a single value with weight 1.0
 void put(NumberVector<?,?> val, double weight)
          Add data with a given weight.
 
Methods inherited from class de.lmu.ifi.dbs.elki.math.linearalgebra.Centroid
make, make, make, put, put, toVector
 
Methods inherited from class de.lmu.ifi.dbs.elki.math.linearalgebra.Vector
clone, copy, equals, euclideanLength, get, get, getArrayCopy, getArrayRef, getColumnDimensionality, getColumnVector, getDimensionality, getRowDimensionality, hashCode, increment, inverseVector, minus, minusEquals, minusEquals, minusTimes, minusTimesEquals, normalize, normF, plus, plusEquals, plusEquals, plusTimes, plusTimesEquals, projection, randomNormalizedVector, scalarProduct, set, set, setZero, sqrtVector, times, times, timesEquals, timesTranspose, toString, toStringNoWhitespace, transpose, transposeTimes, transposeTimes, unitVector
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial version

See Also:
Constant Field Values

dims

private BitSet dims
The selected dimensions.

Constructor Detail

ProjectedCentroid

public ProjectedCentroid(BitSet dims,
                         int dim)
Constructor for updating use.

Parameters:
dims - Dimensions to use (indexed with 0)
dim - Full dimensionality
Method Detail

put

public void put(double[] val)
Add a single value with weight 1.0

Overrides:
put in class Centroid
Parameters:
val - Value

put

public void put(double[] val,
                double weight)
Add data with a given weight.

Overrides:
put in class Centroid
Parameters:
val - data
weight - weight

put

public void put(NumberVector<?,?> val)
Add a single value with weight 1.0

Overrides:
put in class Centroid
Parameters:
val - Value

put

public void put(NumberVector<?,?> val,
                double weight)
Add data with a given weight.

Overrides:
put in class Centroid
Parameters:
val - data
weight - weight

make

public static ProjectedCentroid make(BitSet dims,
                                     Relation<? extends NumberVector<?,?>> relation)
Static Constructor from a relation.

Parameters:
dims - Dimensions to use (indexed with 0)
relation - Relation to process

make

public static ProjectedCentroid make(BitSet dims,
                                     Relation<? extends NumberVector<?,?>> relation,
                                     Iterable<DBID> ids)
Static Constructor from a relation.

Parameters:
dims - Dimensions to use (indexed with 0)
relation - Relation to process
ids - IDs to process

Release 0.4.0 (2011-09-20_1324)