Package org.apache.sysds.runtime.controlprogram.parfor

# Class ResultMerge<T extends CacheableData<?>>

java.lang.Object
org.apache.sysds.runtime.controlprogram.parfor.ResultMerge<T>

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `ResultMergeFrameLocalMemory`, `ResultMergeMatrix`

public abstract class ResultMerge<T extends CacheableData<?>> extends Object implements Serializable

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`ResultMerge(T out, T[] in, String outputFilename, boolean accum)`

## Method Summary

Modifier and Type
Method
Description
`abstract T`
`executeParallelMerge(int par)`
Merge all given input matrices in parallel into the given output matrix.
`abstract T`
`executeSerialMerge()`
Merge all given input matrices sequentially into the given output matrix.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ResultMerge

public ResultMerge(T out, T[] in, String outputFilename, boolean accum)

## Method Details

### executeSerialMerge

public abstract T executeSerialMerge()
Merge all given input matrices sequentially into the given output matrix. The required space in-memory is the size of the output matrix plus the size of one input matrix at a time.

Returns:
  output (merged) matrix

### executeParallelMerge

public abstract T executeParallelMerge(int par)
Merge all given input matrices in parallel into the given output matrix. The required space in-memory is the size of the output matrix plus the size of all input matrices.

Parameters:
  `par` - degree of parallelism
Returns:
  output (merged) matrix