org.apache.sysds.hops.ipa

## Class FunctionCallSizeInfo

- java.lang.Object
- - org.apache.sysds.hops.ipa.FunctionCallSizeInfo

-     public class FunctionCallSizeInfo
      extends Object

  Auxiliary data structure to hold function call summaries in terms of information about number of function calls, consistent dimensions, consistent sparsity, and dimension-preserving functions.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FunctionCallSizeInfo(FunctionCallGraph fgraph)` Constructs the function call summary for all functions reachable from the main program.
    `FunctionCallSizeInfo(FunctionCallGraph fgraph, boolean init)` Constructs the function call summary for all functions reachable from the main program.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDimsPreservingFunction(String fkey)` Adds a function to the set of dimension-preserving functions.
    `boolean` | `equals(Object o)`
    `Set<String>` | `getDimsPreservingFunctions()` Gets the set of dimension-preserving functions, i.e., functions with one matrix input and output of equal dimension sizes.
    `int` | `getFunctionCallCount(String fkey)` Gets the number of function calls to a given function.
    `Set<String>` | `getInvalidFunctions()` Gets the set of functions that are invalid for statistics propagation.
    `Set<String>` | `getValidFunctions()` Gets the set of functions that are valid for statistics propagation.
    `int` | `hashCode()`
    `boolean` | `hasSafeLiterals(String fkey)` Indicates if the given function has at least one input that allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.
    `boolean` | `isDimsPreservingFunction(String fkey)` Indicates if the given function belongs to the set of dimension-preserving functions.
    `boolean` | `isSafeLiteral(String fkey, int pos)` Indicates if the given function input allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.
    `boolean` | `isSafeNnz(String fkey, int pos)` Indicates if the given function input allows for safe nnz propagation, i.e., all function calls have a consistent number of non-zeros.
    `boolean` | `isValidFunction(String fkey)` Indicates if the given function is valid for statistics propagation.
    `String` | `toString()`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### FunctionCallSizeInfo

          public FunctionCallSizeInfo(FunctionCallGraph fgraph)

      Constructs the function call summary for all functions reachable from the main program.
      Parameters:
        `fgraph` - function call graph

    - #### FunctionCallSizeInfo

          public FunctionCallSizeInfo(FunctionCallGraph fgraph,
                                      boolean init)

      Constructs the function call summary for all functions reachable from the main program.
      Parameters:
        `fgraph` - function call graph
        `init` - initialize function candidates

  - ### Method Detail

    - #### getFunctionCallCount

          public int getFunctionCallCount(String fkey)

      Gets the number of function calls to a given function.
      Parameters:
        `fkey` - function key
      Returns:
        number of function calls

    - #### isValidFunction

          public boolean isValidFunction(String fkey)

      Indicates if the given function is valid for statistics propagation.
      Parameters:
        `fkey` - function key
      Returns:
        true if valid

    - #### getValidFunctions

          public Set<String> getValidFunctions()

      Gets the set of functions that are valid for statistics propagation.
      Returns:
        set of function keys

    - #### getInvalidFunctions

          public Set<String> getInvalidFunctions()

      Gets the set of functions that are invalid for statistics propagation. This is literally the set of reachable functions minus the set of valid functions.
      Returns:
        set of function keys.

    - #### addDimsPreservingFunction

          public void addDimsPreservingFunction(String fkey)

      Adds a function to the set of dimension-preserving functions.
      Parameters:
        `fkey` - function key

    - #### getDimsPreservingFunctions

          public Set<String> getDimsPreservingFunctions()

      Gets the set of dimension-preserving functions, i.e., functions with one matrix input and output of equal dimension sizes.
      Returns:
        set of function keys

    - #### isDimsPreservingFunction

          public boolean isDimsPreservingFunction(String fkey)

      Indicates if the given function belongs to the set of dimension-preserving functions.
      Parameters:
        `fkey` - function key
      Returns:
        true if the function is dimension-preserving

    - #### isSafeNnz

          public boolean isSafeNnz(String fkey,
                                   int pos)

      Indicates if the given function input allows for safe nnz propagation, i.e., all function calls have a consistent number of non-zeros.
      Parameters:
        `fkey` - function key
        `pos` - function input position
      Returns:
        true if nnz can safely be propagated

    - #### hasSafeLiterals

          public boolean hasSafeLiterals(String fkey)

      Indicates if the given function has at least one input that allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.
      Parameters:
        `fkey` - function key
      Returns:
        true if a literal can be safely propagated

    - #### isSafeLiteral

          public boolean isSafeLiteral(String fkey,
                                       int pos)

      Indicates if the given function input allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.
      Parameters:
        `fkey` - function key
        `pos` - function input position
      Returns:
        true if literal that can be safely propagated

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2021 The Apache Software Foundation. All rights reserved.