public class HeapMerger extends Object implements Merger
SparseVector
separately using a PriorityQueue
as a heap.
Relies upon VectorIterator.compareTo(VectorIterator)
.
Constructor and Description |
---|
HeapMerger() |
Modifier and Type | Method and Description |
---|---|
DenseSparseMatrix |
merge(DenseSparseMatrix[] inputs)
Merges an array of DenseSparseMatrix into a single DenseSparseMatrix.
|
static SparseVector |
merge(List<SparseVector> vectors,
int dimension,
int[] indicesBuffer,
double[] valuesBuffer)
Merges a list of sparse vectors into a single sparse vector, summing the values.
|
SparseVector |
merge(SparseVector[] inputs)
Merges an array of SparseVector into a single SparseVector.
|
public DenseSparseMatrix merge(DenseSparseMatrix[] inputs)
Merger
public SparseVector merge(SparseVector[] inputs)
Merger
public static SparseVector merge(List<SparseVector> vectors, int dimension, int[] indicesBuffer, double[] valuesBuffer)
vectors
- The vectors to merge.dimension
- The dimension of the sparse vector.indicesBuffer
- A buffer for the indices.valuesBuffer
- A buffer for the values.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.