Package org.tribuo.math.util
Class MatrixHeapMerger
java.lang.Object
org.tribuo.math.util.MatrixHeapMerger
- All Implemented Interfaces:
Serializable
,Merger
,ProtoSerializable<org.tribuo.math.protos.MergerProto>
Merges each
DenseSparseMatrix
using a PriorityQueue
as a heap on the MatrixIterator
.
Relies upon MatrixIterator.compareTo(MatrixIterator)
.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Protobuf serialization version.Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MatrixHeapMerger
deserializeFromProto
(int version, String className, com.google.protobuf.Any message) Deserialization factory.boolean
int
hashCode()
merge
(DenseSparseMatrix[] inputs) Merges an array of DenseSparseMatrix into a single DenseSparseMatrix.merge
(SparseVector[] inputs) Merges an array of SparseVector into a single SparseVector.org.tribuo.math.protos.MergerProto
Serializes this object to a protobuf.
-
Field Details
-
CURRENT_VERSION
public static final int CURRENT_VERSIONProtobuf serialization version.- See Also:
-
-
Constructor Details
-
MatrixHeapMerger
public MatrixHeapMerger()Constructs a HeapMerger.
-
-
Method Details
-
deserializeFromProto
public static MatrixHeapMerger deserializeFromProto(int version, String className, com.google.protobuf.Any message) Deserialization factory.- Parameters:
version
- The serialized object version.className
- The class name.message
- The serialized data.- Returns:
- The deserialized object.
-
serialize
public org.tribuo.math.protos.MergerProto serialize()Description copied from interface:ProtoSerializable
Serializes this object to a protobuf.- Specified by:
serialize
in interfaceProtoSerializable<org.tribuo.math.protos.MergerProto>
- Returns:
- The protobuf.
-
merge
Description copied from interface:Merger
Merges an array of DenseSparseMatrix into a single DenseSparseMatrix. -
merge
Description copied from interface:Merger
Merges an array of SparseVector into a single SparseVector. -
equals
-
hashCode
public int hashCode()
-