Package org.apache.sysds.hops.estim

# Class EstimatorLayeredGraph

java.lang.Object
org.apache.sysds.hops.estim.SparsityEstimator
org.apache.sysds.hops.estim.EstimatorLayeredGraph

public class EstimatorLayeredGraph extends SparsityEstimator
This estimator implements an approach based on a so-called layered graph, introduced in Edith Cohen. Structure prediction and computation of sparse matrix products. J. Comb. Optim., 2(4):307–332, 1998.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`EstimatorLayeredGraph.LayeredGraph`

## Nested classes/interfaces inherited from class org.apache.sysds.hops.estim.SparsityEstimator

`SparsityEstimator.OpCode`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ROUNDS`

### Fields inherited from class org.apache.sysds.hops.estim.SparsityEstimator

`MIN_PAR_THRESHOLD, MULTI_THREADED_BUILD, MULTI_THREADED_ESTIM`

## Constructor Summary

Constructors
Constructor
Description
`EstimatorLayeredGraph()`
`EstimatorLayeredGraph(int rounds)`
`EstimatorLayeredGraph(int rounds, int seed)`

## Method Summary

Modifier and Type
Method
Description
`DataCharacteristics`
`estim(MMNode root)`
Estimates the output sparsity of a DAG of matrix multiplications for the given operator graph of a single root node.
`double`
`estim(MatrixBlock m, SparsityEstimator.OpCode op)`
Estimates the output sparsity for a given unary operation.
`double`
`estim(MatrixBlock m1, MatrixBlock m2)`
Estimates the output sparsity for a single matrix multiplication.
`double`
`estim(MatrixBlock m1, MatrixBlock m2, SparsityEstimator.OpCode op)`
Estimates the output sparsity for a given binary operation.
`EstimatorLayeredGraph.LayeredGraph`
`traverse(MMNode node)`

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

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

## Field Details

### ROUNDS

public static final int ROUNDS

See Also:
  - Constant Field Values

## Constructor Details

### EstimatorLayeredGraph

public EstimatorLayeredGraph()

### EstimatorLayeredGraph

public EstimatorLayeredGraph(int rounds)

### EstimatorLayeredGraph

public EstimatorLayeredGraph(int rounds, int seed)

## Method Details

### estim

public DataCharacteristics estim(MMNode root)
Description copied from class: `SparsityEstimator`
Estimates the output sparsity of a DAG of matrix multiplications for the given operator graph of a single root node.

Specified by:
  `estim` in class `SparsityEstimator`
Parameters:
  `root` - DAG root node
Returns:
  output data characteristics

### traverse

public EstimatorLayeredGraph.LayeredGraph traverse(MMNode node)

### estim

public double estim(MatrixBlock m1, MatrixBlock m2, SparsityEstimator.OpCode op)
Description copied from class: `SparsityEstimator`
Estimates the output sparsity for a given binary operation.

Specified by:
  `estim` in class `SparsityEstimator`
Parameters:
  `m1` - left-hand-side operand
  `m2` - right-hand-side operand
  `op` - operator code
Returns:
  sparsity

### estim

public double estim(MatrixBlock m, SparsityEstimator.OpCode op)
Description copied from class: `SparsityEstimator`
Estimates the output sparsity for a given unary operation.

Specified by:
  `estim` in class `SparsityEstimator`
Parameters:
  `m` - left-hand-side operand
  `op` - operator code
Returns:
  sparsity

### estim

public double estim(MatrixBlock m1, MatrixBlock m2)
Description copied from class: `SparsityEstimator`
Estimates the output sparsity for a single matrix multiplication.

Specified by:
  `estim` in class `SparsityEstimator`
Parameters:
  `m1` - left-hand-side operand
  `m2` - right-hand-side operand
Returns:
  sparsity