Class SumOfSquares

    • Method Detail

      • create

        public static SumOfSquares create()
        Creates an instance.

        The initial result is zero.

        Returns:
        SumOfSquares instance.
      • of

        public static SumOfSquares of​(double... values)
        Returns an instance populated using the input values.

        The result is NaN if any of the values is NaN or the product at any point is a NaN.

        When the input is an empty array, the result is zero.

        Parameters:
        values - Values.
        Returns:
        SumOfSquares instance.
      • accept

        public void accept​(double value)
        Updates the state of the statistic to reflect the addition of value.
        Specified by:
        accept in interface DoubleConsumer
        Parameters:
        value - Value.
      • getAsDouble

        public double getAsDouble()
        Gets the sum of squares of all input values.

        When no values have been added, the result is zero.

        Specified by:
        getAsDouble in interface DoubleSupplier
        Returns:
        sum of squares of all values.