org.apache.sysml.udf.lib

Class RowClassMeet

  • All Implemented Interfaces:
    Serializable


    public class RowClassMeet
    extends PackageFunction
    Performs following operation: # Computes the intersection ("meet") of equivalence classes for # each row of A and B, excluding 0-valued cells. # INPUT: # A, B = matrices whose rows contain that row's class labels; # for each i, rows A [i, ] and B [i, ] define two # equivalence relations on some of the columns, which # we want to intersect # A [i, j] == A [i, k] != 0 if and only if (j ~ k) as defined # by row A [i, ]; # A [i, j] == 0 means that j is excluded by A [i, ] # B [i, j] is analogous # NOTE 1: Either nrow(A) == nrow(B), or exactly one of A or B # has one row that "applies" to each row of the other matrix. # NOTE 2: If ncol(A) != ncol(B), we pad extra 0-columns up to # max (ncol(A), ncol(B)). # OUTPUT: # Both C and N have the same size as (the max of) A and B. # C = matrix whose rows contain class labels that represent # the intersection (coarsest common refinement) of the # corresponding rows of A and B. # C [i, j] == C [i, k] != 0 if and only if (j ~ k) as defined # by both A [i, ] and B [j, ] # C [i, j] == 0 if and only if A [i, j] == 0 or B [i, j] == 0 # Additionally, we guarantee that non-0 labels in C [i, ] # will be integers from 1 to max (C [i, ]) without gaps. # For A and B the labels can be arbitrary. # N = matrix with class-size information for C-cells # N [i, j] = count of {C [i, k] | C [i, j] == C [i, k] != 0}
    See Also:
    Serialized Form
    • Constructor Detail

      • RowClassMeet

        public RowClassMeet()
    • Method Detail

      • getNumFunctionOutputs

        public int getNumFunctionOutputs()
        Description copied from class: PackageFunction
        Method to get the number of outputs of this package function. This method should be implemented in the user's function.
        Specified by:
        getNumFunctionOutputs in class PackageFunction
        Returns:
        number of outputs
      • getFunctionOutput

        public FunctionParameter getFunctionOutput(int pos)
        Description copied from class: PackageFunction
        Method to get a specific output of this package function. This method should be implemented in the user's function.
        Specified by:
        getFunctionOutput in class PackageFunction
        Parameters:
        pos - function position
        Returns:
        function parameter
      • execute

        public void execute()
        Description copied from class: PackageFunction
        Method that will be executed to perform this function.
        Specified by:
        execute in class PackageFunction

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