Package edu.upenn.seas.mstparser
Class FeatureVector
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList
-
- de.julielab.gnu.trove.TLinkedList
-
- edu.upenn.seas.mstparser.FeatureVector
-
- All Implemented Interfaces:
Serializable,Iterable,Collection,List
public final class FeatureVector extends de.julielab.gnu.trove.TLinkedListA FeatureVector that can hold up to two FeatureVector instances inside it, which allows for a very quick concatenation operation.Also, in order to avoid copies, the second of these internal FeatureVector instances can be negated, so that it has the effect of subtracting any values rather than adding them.
Created: Sat Nov 10 15:25:10 2001
- Version:
- $Id: FeatureVector.java 90 2007-01-17 07:42:20Z jasonbaldridge $
- Author:
- Jason Baldridge
- See Also:
Feature, Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description FeatureVector()FeatureVector(int[] keys)FeatureVector(FeatureVector fv1)FeatureVector(FeatureVector fv1, FeatureVector fv2)FeatureVector(FeatureVector fv1, FeatureVector fv2, boolean negSecond)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, double value)FeatureVectorcat(FeatureVector fl2)doubledotProduct(FeatureVector fl2)FeatureVectorgetDistVector(FeatureVector fl2)doublegetScore(double[] parameters)int[]keys()StringtoString()voidupdate(double[] parameters, double[] total, double alpha_k, double upd)-
Methods inherited from class de.julielab.gnu.trove.TLinkedList
add, add, addBefore, addFirst, addLast, clear, contains, getFirst, getLast, insert, listIterator, remove, removeFirst, removeLast, size, toArray, toUnlinkedArray
-
Methods inherited from class java.util.AbstractList
equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, removeAll, retainAll, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, containsAll, isEmpty, removeAll, replaceAll, retainAll, sort, spliterator, toArray
-
-
-
-
Constructor Detail
-
FeatureVector
public FeatureVector()
-
FeatureVector
public FeatureVector(FeatureVector fv1)
-
FeatureVector
public FeatureVector(FeatureVector fv1, FeatureVector fv2)
-
FeatureVector
public FeatureVector(FeatureVector fv1, FeatureVector fv2, boolean negSecond)
-
FeatureVector
public FeatureVector(int[] keys)
-
-
Method Detail
-
add
public void add(int index, double value)
-
keys
public int[] keys()
-
cat
public final FeatureVector cat(FeatureVector fl2)
-
getDistVector
public FeatureVector getDistVector(FeatureVector fl2)
-
getScore
public final double getScore(double[] parameters)
-
update
public void update(double[] parameters, double[] total, double alpha_k, double upd)
-
dotProduct
public double dotProduct(FeatureVector fl2)
-
toString
public final String toString()
- Overrides:
toStringin classAbstractCollection
-
-