Class StepFunction

    • Constructor Detail

      • StepFunction

        public StepFunction​(double epsilon)
        Construct an empty step function.
        Parameters:
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
      • StepFunction

        public StepFunction​(OrderedPairs f,
                            double epsilon)
        Construct a step function from a collection ordered pairs.
        Parameters:
        f - a collection of ordered pairs
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
      • StepFunction

        public StepFunction​(OrderedPairs f)
        Construct a step function from a collection ordered pairs.
        Parameters:
        f - a collection of ordered pairs
    • Method Detail

      • add

        public void add​(OrderedPairs f)
        Dynamically add points to the step function.
        Parameters:
        f - a collection of ordered pairs
      • x

        public double[] x()
        Description copied from interface: OrderedPairs
        Get the abscissae.
        Specified by:
        x in interface OrderedPairs
        Returns:
        the abscissae
      • y

        public double[] y()
        Description copied from interface: OrderedPairs
        Get the ordinates.
        Specified by:
        y in interface OrderedPairs
        Returns:
        the ordinates
      • minDomain

        public double minDomain()
        Get the smallest abscissae.
        Returns:
        the smallest abscissae
      • maxDomain

        public double maxDomain()
        Get the biggest abscissae.
        Returns:
        the biggest abscissae
      • size

        public int size()
        Description copied from interface: OrderedPairs
        Get the number of points.
        Specified by:
        size in interface OrderedPairs
        Returns:
        the number of points