@Override /** {@inheritDoc} */ public int getNumberOfDocuments() { return docids2lengths.size(); }
/** * Returns the number of entries in the map. * @return the map's size. */ public int size() { return this._map.size(); }
public int size() { return _map.size(); } public boolean isEmpty() {
public int size() { return _map1.size(); }
/** * Returns the values of the map. * * @return a <code>Collection</code> value */ public int[] getValues() { int[] vals = new int[size()]; int[] v = _values; byte[] states = _states; for (int i = v.length, j = 0; i-- > 0;) { if (states[i] == FULL) { vals[j++] = v[i]; } } return vals; }
/** * returns the keys of the map. * * @return a <code>Set</code> value */ public int[] keys() { int[] keys = new int[size()]; int[] k = _set; byte[] states = _states; for (int i = k.length, j = 0; i-- > 0;) { if (states[i] == FULL) { keys[j++] = k[i]; } } return keys; }
public DocumentMapIterator2(){ docids = new ArrayList<Integer>(docids2lengths.size()); for (int docid : docids2lengths.keys()) { docids.add(docid); } Collections.sort(docids); Collections.reverse(docids); }
public DocumentMapIterator() { docids = new ArrayList<Integer>(docids2lengths.size()); for (int docid : docids2lengths.keys()) { docids.add(docid); } Collections.sort(docids); Collections.reverse(docids); }
/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ public boolean equals(Object other) { if (! (other instanceof TIntIntHashMap)) { return false; } TIntIntHashMap that = (TIntIntHashMap)other; if (that.size() != this.size()) { return false; } return forEachEntry(new EqProcedure(that)); }
private void state() { logger.debug("***REALTIME*** Geometric merge state"); logger.debug("Number of columns: " + parts.size()); TIntIntIterator it = parts.iterator(); while (it.hasNext()) { it.advance(); logger.debug("Column: " + it.key()); logger.debug("Column prefixID: " + it.value()); logger.debug("Column merges: " + sizes.get(it.key())); logger.debug("Column merges (max): " + Math.pow(g, it.key())); } } }
@Override public void addConstraint(int fi, double[] ex, double weight) { constraints.put(fi,new MaxEntL2FLPRConstraint(ex,weight)); constraintIndices.put(fi, constraintIndices.size()); }
@Override public void addConstraint(int fi, double[] ex, double weight) { constraints.put(fi,new MaxEntL2FLPRConstraint(ex,weight)); constraintIndices.put(fi, constraintIndices.size()); }
@Override public void addConstraint(int fi, double[] ex, double weight) { constraints.put(fi,new MaxEntL2FLPRConstraint(ex,weight)); constraintIndices.put(fi, constraintIndices.size()); }
public void addConstraint(int fi, double[] target, double weight) { constraints.put(fi,new OneLabelPRConstraint(target,weight)); constraintIndices.put(fi, constraintIndices.size()); }
public void addConstraint(int fi, double[] target, double weight) { constraints.put(fi,new OneLabelPRConstraint(target,weight)); constraintIndices.put(fi, constraintIndices.size()); }
public void addConstraint(int fi, double[] target, double weight) { constraints.put(fi,new OneLabelPRConstraint(target,weight)); constraintIndices.put(fi, constraintIndices.size()); }
public GISAttributeModel createUpperModel(final int _numObject, final TIntIntHashMap _newIdxOldIdx) { if (_numObject < getSize()) { throw new IllegalArgumentException("bad num objects"); } if (_numObject == getSize()) { return this; } final ArrayList newList = new ArrayList(_numObject); Collections.fill(newList, getAttribute().getDefaultValue()); if (_newIdxOldIdx != null) { final TIntIntIterator it = _newIdxOldIdx.iterator(); for (int i = _newIdxOldIdx.size(); i-- > 0;) { it.advance(); final int newIdx = it.key(); newList.set(newIdx, list_.get(it.value())); } } return new GISAttributeModelBooleanList(newList, this); }
public GISAttributeModel createUpperModel(final int _numObject,final TIntIntHashMap _newIdxOldIdx){ if (_numObject < getSize()) { throw new IllegalArgumentException("bad num objects"); } if (_numObject == getSize()) { return this; } final boolean[] newList = new boolean[_numObject]; Arrays.fill(newList, ((Boolean) getAttribute().getDefaultValue()).booleanValue()); if (_newIdxOldIdx != null) { final TIntIntIterator it = _newIdxOldIdx.iterator(); for (int i = _newIdxOldIdx.size(); i-- > 0;) { it.advance(); final int newIdx = it.key(); newList[newIdx] = list_[it.value()]; } } return new GISAttributeModelBooleanArray(newList, this); }
public GISAttributeModel createUpperModel(final int _numObject,final TIntIntHashMap _newIdxOldIdx){ if (_numObject < getSize()) { throw new IllegalArgumentException("bad num objects"); } if (_numObject == getSize()) { return this; } final double[] newList = new double[_numObject]; Arrays.fill(newList, ((Double) getAttribute().getDefaultValue()).doubleValue()); if (_newIdxOldIdx != null) { final TIntIntIterator it = _newIdxOldIdx.iterator(); for (int i = _newIdxOldIdx.size(); i-- > 0;) { it.advance(); final int newIdx = it.key(); newList[newIdx] = list_[it.value()]; } } return new GISAttributeModelDoubleArray(newList, this); }