LineData newData = new LineData(i, null); newData.setHits(newData.getHits() + rangeData.hits); linesMap.put(i, newData);
public Transition (int input, int output, double weight, State sourceState, String destinationName) { this.input = input; this.output = output; this.weight = weight; this.nextWithSameInput = (Transition) sourceState.input2transitions.get (input); sourceState.input2transitions.put (input, this); // this.index is set by the caller of this constructor this.destinationName = destinationName; }
public Transition (int input, int output, double weight, State sourceState, String destinationName) { this.input = input; this.output = output; this.weight = weight; this.nextWithSameInput = (Transition) sourceState.input2transitions.get (input); sourceState.input2transitions.put (input, this); // this.index is set by the caller of this constructor this.destinationName = destinationName; }
private void incrementTouches (int idx1) { int nt = getNumTouches (idx1); factorTouched.put (idx1, new Integer (nt + 1)); }
private void putSepset(int id1, int id2, Sepset sepset) { int id = hashIdxIdx(id1, id2); sepsets.put(id, sepset); }
private void putSepset(int id1, int id2, Sepset sepset) { int id = hashIdxIdx(id1, id2); sepsets.put(id, sepset); }
private void putSepset(int id1, int id2, Sepset sepset) { int id = hashIdxIdx(id1, id2); sepsets.put(id, sepset); }
private void incrementTouches (int idx1) { int nt = getNumTouches (idx1); factorTouched.put (idx1, new Integer (nt + 1)); }
/** Add document length and field lengths to document index. */ public void addDocument(int docid, int length, int[] flengths) { addDocument(docid, length); fieldLengths.put(docid, new TIntArrayList(flengths)); }
private int[] cachedLargeIdxToSmall (DiscreteFactor smallPotential) { int hashval = computeSubsetHashValue (smallPotential); Object ints = projectionCache.get (hashval); if (ints != null) { return (int[]) ints; } else { int[] projection = computeLargeIdxToSmall (smallPotential); projectionCache.put (hashval, projection); return projection; } }
@Override public void addConstraint(int fi, double[] ex, double weight) { constraints.put(fi,new MaxEntL2FLPRConstraint(ex,weight)); constraintIndices.put(fi, constraintIndices.size()); }
public void set(final int _idxGlobal, final int _idxSelected) { idxListSelection_.clear(); final CtuluListSelection l = new CtuluListSelection(); l.setSelectionInterval(_idxSelected, _idxSelected); idxListSelection_.put(_idxGlobal, l); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ public Object put(Object key, Object value) { return wrapValue(_map.put(unwrapKey(key), unwrapValue(value))); }
@Override public void addConstraint(int fi, double[] ex, double weight) { assert(Maths.almostEquals(MatrixOps.sum(ex),1)); constraints.put(fi,new MaxEntKLFLGEConstraint(ex,weight)); }
@Override public void addConstraint(int fi, double[] ex, double weight) { assert(Maths.almostEquals(MatrixOps.sum(ex),1)); constraints.put(fi,new MaxEntKLFLGEConstraint(ex,weight)); }
public void addConstraint(int fi, int li, double lower, double upper, double weight) { if (!constraints.containsKey(fi)) { constraints.put(fi,new MaxEntL2IndGEConstraint()); } constraints.get(fi).add(li, lower, upper, weight); }
public void addConstraint(int fi, int li, double lower, double upper, double weight) { if (!constraints.containsKey(fi)) { constraints.put(fi,new OneLabelL2IndGEConstraint()); } constraints.get(fi).add(li, lower, upper, weight); }
public Record (Alphabet fieldAlph, Alphabet valueAlph, String[][] vals) { this(fieldAlph, valueAlph); for (int i = 0; i < vals.length; i++) { AugmentableFeatureVector afv = new AugmentableFeatureVector(valueAlph, false); for (int j = 1; j < vals[i].length; j++) afv.add(valueAlph.lookupIndex(vals[i][j]), 1.0); field2values.put(fieldAlph.lookupIndex(vals[i][0]), afv.toFeatureVector()); } }
protected OneLabelL2PRConstraints(TIntObjectHashMap<OneLabelPRConstraint> constraints, TIntIntHashMap constraintIndices, StateLabelMap map, boolean normalized) { this.constraints = new TIntObjectHashMap<OneLabelPRConstraint>(); for (int key : constraints.keys()) { this.constraints.put(key, constraints.get(key).copy()); } //this.constraints = constraints; this.constraintIndices = constraintIndices; this.map = map; this.cache = new TIntArrayList(); this.normalized = normalized; }
protected OneLabelL2PRConstraints(TIntObjectHashMap<OneLabelPRConstraint> constraints, TIntIntHashMap constraintIndices, StateLabelMap map, boolean normalized) { this.constraints = new TIntObjectHashMap<OneLabelPRConstraint>(); for (int key : constraints.keys()) { this.constraints.put(key, constraints.get(key).copy()); } //this.constraints = constraints; this.constraintIndices = constraintIndices; this.map = map; this.cache = new TIntArrayList(); this.normalized = normalized; }