gnu.trove.TIntArrayList.set()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中gnu.trove.TIntArrayList.set()方法的一些代码示例,展示了TIntArrayList.set()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TIntArrayList.set()方法的具体详情如下:
包路径:gnu.trove.TIntArrayList
类名称:TIntArrayList
方法名:set

TIntArrayList.set介绍

[英]See gnu.trove.list.array.TIntArrayList#set(int,int)
[中]见gnu。宝藏。列表大堆TIntArrayList#集(int,int)

代码示例

代码示例来源:origin: de.julielab/jcore-mallet-0.4

/**
 * Replace the values in the list starting at <tt>offset</tt> with
 * the contents of the <tt>values</tt> array.
 *
 * @param offset the first offset to replace
 * @param values the source of the new values
 */
public void set(int offset, int[] values) {
  set(offset, values, 0, values.length);
}

代码示例来源:origin: terrier-org/terrier-core

public void setLength(int docid, int newLength) {
  docLengths.set(docid, newLength);
}

代码示例来源:origin: org.fuzzydb.attrs/org.fuzzydb.attrs.compact

private void setLength(int sequence, int length) {
  if (sequence >= lengths.size()) {
    padSpace(lengths, sequence);
  }
  lengths.set(sequence, length);
}

代码示例来源:origin: jatecs/jatecs

public boolean isConverging(DocumentCentroid[] centroids) {
  boolean reassigned = false;
  for (int i = 0; i < centroids.length; i++) {
    DocumentCentroid c = centroids[i];
    for (int j = 0; j < c.documents.size(); j++) {
      int docID = c.documents.get(j);
      if (_assignments.get(docID) != i) {
        // At least one document was reassigned.
        reassigned = true;
        _assignments.set(docID, i);
      }
    }
    c.features = Clustering.computeDocumentCentroid(new TIntArrayListIterator(c.documents), _index);
  }
  if (!reassigned)
    // Convergence was reached.
    return true;
  else
    // More iterations needed.
    return false;
}

代码示例来源:origin: org.fuzzydb.attrs/org.fuzzydb.attrs.compact

nextIntsIndex += spaceNeeded;
indicesPlusOne.set(sequence, index + 1);

代码示例来源:origin: org.fuzzydb.attrs/org.fuzzydb.attrs.compact

/**
 * Get/allocate spaceNeeded entries for the designated float-based attribute
 */
private int getFloatSpace(int attrId, int spaceNeeded) {
  int sequence = AttrDefinitionMgr.getAttrIndex(attrId); // this should be unique across all attributes
  if (sequence < indicesPlusOne.size()) {
    int indexPlusOne = indicesPlusOne.getQuick(sequence);
    if (indexPlusOne > 0) {
      Assert.state(getLength(attrId) == spaceNeeded, "getLength = " + getLength(attrId) + ", requested = " + spaceNeeded); // dumbo check to ensure not asking for diff size
      return indexPlusOne - 1;
    }
  } else {
    padSpace(indicesPlusOne, sequence);
  }
  
  // okay, it's not been allocated so ...
  int index = nextFloatsIndex;
  nextFloatsIndex += spaceNeeded;
  
  indicesPlusOne.set(sequence, index + 1);
  // Add to list of attrIds for iterator
  Assert.state( attrIds.contains(attrId) == false);
  attrIds.add(attrId);
  setLength(sequence, spaceNeeded);
  syncToStore(); // we sync here as we've modified
  return index;
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis

public GISAttributeModel createUpperModel(final int _numObject, final TIntIntHashMap _newIdxOldIdx) {
 if (_numObject < getSize()) {
  throw new IllegalArgumentException("bad num objects");
 }
 if (_numObject == getSize()) {
  return this;
 }
 final  TIntArrayList newList = new TIntArrayList(_numObject);
 newList.fill(((Integer) getAttribute().getDefaultValue()).intValue());
 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 GISAttributeModelIntegerList(newList, this);
}

相关文章