Class OpDependencies


  • public class OpDependencies
    extends Object
    A simple showcase of an Op that uses an OpDependency. Using OpDependencys to break up your code into simple, reusable blocks, Ops become more modular and enable specialization for unseen types.
    Author:
    Gabriel Selzer
    • Constructor Detail

      • OpDependencies

        public OpDependencies()
    • Method Detail

      • size

        public static double size​(double[] inArray)
        An Op that computes the size of a double
        Parameters:
        inArray - the input
        Returns:
        the size of inArray
        Implementation Note:
        op names="stats.size"
      • sum

        public static double sum​(double[] inArray)
        An Op that computes the sum of a double
        Parameters:
        inArray - the input
        Returns:
        the sum of inArray
        Implementation Note:
        op names="stats.sum"
      • mean

        public static double mean​(Function<double[],​Double> sumOp,
                                  Function<double[],​Double> sizeOp,
                                  double[] inArray)
        An Op that computes the mean of a double
        Parameters:
        sumOp - an Op that computes the sum of the a double
        sizeOp - an Op that computes the size of the a double
        inArray - the input
        Returns:
        the mean of inArray
        Implementation Note:
        op names="stats.mean"
      • main

        public static void main​(String... args)