public final void setValue (int index, double value) { if (indices != null && size-1 != maxSortedIndex) sortIndices(); assert (values != null); if (indices == null) { assert (index < size); values[index] = value; } else { values[location(index)] = value; } }
public final void setValue (int index, double value) { if (indices != null && size-1 != maxSortedIndex) sortIndices(); assert (values != null); if (indices == null) { assert (index < size); values[index] = value; } else { values[location(index)] = value; } }
public final void setValue (int index, double value) { if (indices != null && size-1 != maxSortedIndex) sortIndices(); assert (values != null); if (indices == null) { assert (index < size); values[index] = value; } else { values[location(index)] = value; } }
public final double value (int index) { if (indices == null) return values[index]; if (size-1 != maxSortedIndex) sortIndices(); int loc = location(index); if (loc >= 0) { if (values == null) return 1.0; else return values[loc]; } else return 0; }
public final double value (int index) { if (indices == null) return values[index]; if (size-1 != maxSortedIndex) sortIndices(); int loc = location(index); if (loc >= 0) { if (values == null) return 1.0; else return values[loc]; } else return 0; }
public final double value (int index) { if (indices == null) return values[index]; if (size-1 != maxSortedIndex) sortIndices(); int loc = location(index); if (loc >= 0) { if (values == null) return 1.0; else return values[loc]; } else return 0; }
/** * Adds all indices that are present in some other feature vector * with value 1.0. * Beware that this may have unintended effects if * <tt>fv.dictionary != this.dictionary</tt> */ public void add (FeatureVector fv) { for (int loc = 0; loc < fv.numLocations (); loc++) { int index = fv.indexAtLocation (loc); // mdredze@cs.jhu.edu 3/5/10 // use values, instead of assuming fv is binary double value = fv.valueAtLocation(loc); if (location (index) == -1) { //add (index, 1.0); add(index,value); } } }
/** * Adds all indices that are present in some other feature vector * with value 1.0. * Beware that this may have unintended effects if * <tt>fv.dictionary != this.dictionary</tt> */ public void add (FeatureVector fv) { for (int loc = 0; loc < fv.numLocations (); loc++) { int index = fv.indexAtLocation (loc); // mdredze@cs.jhu.edu 3/5/10 // use values, instead of assuming fv is binary double value = fv.valueAtLocation(loc); if (location (index) == -1) { //add (index, 1.0); add(index,value); } } }
/** * Adds all indices that are present in some other feature vector * with value 1.0. * Beware that this may have unintended effects if * <tt>fv.dictionary != this.dictionary</tt> */ public void add (FeatureVector fv) { for (int loc = 0; loc < fv.numLocations (); loc++) { int index = fv.indexAtLocation (loc); // mdredze@cs.jhu.edu 3/5/10 // use values, instead of assuming fv is binary double value = fv.valueAtLocation(loc); if (location (index) == -1) { //add (index, 1.0); add(index,value); } } }