本文整理匯總了Java中it.unimi.dsi.fastutil.ints.IntArrayList.get方法的典型用法代碼示例。如果您正苦於以下問題:Java IntArrayList.get方法的具體用法?Java IntArrayList.get怎麽用?Java IntArrayList.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類it.unimi.dsi.fastutil.ints.IntArrayList
的用法示例。
在下文中一共展示了IntArrayList.get方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: removeSampleReads
import it.unimi.dsi.fastutil.ints.IntArrayList; //導入方法依賴的package包/類
private void removeSampleReads(final int sampleIndex, final IntArrayList indexToRemove, final int alleleCount) {
final int removeCount = indexToRemove.size();
if (removeCount == 0)
return;
final GATKSAMRecord[] sampleReads = readsBySampleIndex[sampleIndex];
final int sampleReadCount = sampleReads.length;
final Object2IntMap<GATKSAMRecord> indexByRead = readIndexBySampleIndex[sampleIndex];
if (indexByRead != null)
for (int i = 0; i < removeCount; i++)
indexByRead.remove(sampleReads[indexToRemove.getInt(i)]);
final boolean[] removeIndex = new boolean[sampleReadCount];
int firstDeleted = indexToRemove.get(0);
for (int i = 0; i < removeCount; i++)
removeIndex[indexToRemove.get(i)] = true;
final int newSampleReadCount = sampleReadCount - removeCount;
// Now we skim out the removed reads from the read array.
final GATKSAMRecord[] oldSampleReads = readsBySampleIndex[sampleIndex];
final GATKSAMRecord[] newSampleReads = new GATKSAMRecord[newSampleReadCount];
System.arraycopy(oldSampleReads, 0, newSampleReads, 0, firstDeleted);
Utils.skimArray(oldSampleReads, firstDeleted, newSampleReads, firstDeleted, removeIndex, firstDeleted);
// Then we skim out the likelihoods of the removed reads.
final double[][] oldSampleValues = valuesBySampleIndex[sampleIndex];
final double[][] newSampleValues = new double[alleleCount][newSampleReadCount];
for (int a = 0; a < alleleCount; a++) {
System.arraycopy(oldSampleValues[a], 0, newSampleValues[a], 0, firstDeleted);
Utils.skimArray(oldSampleValues[a], firstDeleted, newSampleValues[a], firstDeleted, removeIndex, firstDeleted);
}
valuesBySampleIndex[sampleIndex] = newSampleValues;
readsBySampleIndex[sampleIndex] = newSampleReads;
readListBySampleIndex[sampleIndex] = null; // reset the unmodifiable list.
}