org.apache.mahout.math
Class WeightedVector
java.lang.Object
org.apache.mahout.math.DelegatingVector
org.apache.mahout.math.WeightedVector
- All Implemented Interfaces:
- Cloneable, Vector
- Direct Known Subclasses:
- Centroid
public class WeightedVector
- extends DelegatingVector
Decorates a vector with a floating point weight and an index.
Methods inherited from class org.apache.mahout.math.DelegatingVector |
aggregate, aggregate, all, asFormatString, assign, assign, assign, assign, assign, assign, cross, divide, dot, equals, get, getDistanceSquared, getElement, getIteratorAdvanceCost, getLengthSquared, getLookupCost, getNumNondefaultElements, getNumNonZeroElements, getQuick, getVector, hashCode, incrementQuick, invalidateCachedLength, isAddConstantTime, isDense, isSequentialAccess, logNormalize, logNormalize, maxValue, maxValueIndex, mergeUpdates, minus, minValue, minValueIndex, nonZeroes, norm, normalize, normalize, plus, plus, set, setQuick, size, times, times, viewPart, zSum |
WeightedVector
protected WeightedVector(double weight,
int index)
WeightedVector
public WeightedVector(Vector v,
double weight,
int index)
WeightedVector
public WeightedVector(Vector v,
Vector projection,
int index)
project
public static WeightedVector project(Vector v,
Vector projection)
project
public static WeightedVector project(Vector v,
Vector projection,
int index)
getWeight
public double getWeight()
getIndex
public int getIndex()
setWeight
public void setWeight(double newWeight)
setIndex
public void setIndex(int index)
like
public Vector like()
- Description copied from interface:
Vector
- Return an empty vector of the same underlying class as the receiver
- Specified by:
like
in interface Vector
- Overrides:
like
in class DelegatingVector
- Returns:
- a Vector
toString
public String toString()
- Overrides:
toString
in class DelegatingVector
clone
public WeightedVector clone()
- Description copied from interface:
Vector
- Return a copy of the recipient
- Specified by:
clone
in interface Vector
- Overrides:
clone
in class DelegatingVector
- Returns:
- a new Vector
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.