Class UnpackConditionArgs


  • public class UnpackConditionArgs
    extends Object
    Utility class for unpacking and transforming interval arguments into appropriate formats based on specified conditions. This class processes a given interval and applies it to specific indices of an array, ensuring the resulting structure is compatible with subsequent operations.
    • Constructor Detail

      • UnpackConditionArgs

        public UnpackConditionArgs()
    • Method Detail

      • call

        public static PairOfDoubleOrDArr call​(NumOrTwoSeqOrNdArr interval,
                                              double[] x,
                                              int[] peaks)
        Unpacks the interval arguments into a pair of lower and upper boundaries, applying the interval conditions to a subset of data defined by the peaks.
        Parameters:
        interval - an object representing the interval, which can be:
        • A single scalar value.
        • A pair of scalar values representing a range.
        • A pair of arrays representing element-wise ranges.
        x - the reference array containing the full dataset.
        peaks - an array of indices specifying the peaks to which the interval conditions should apply.
        Returns:
        a PairOfDoubleOrDArr object containing:
        • A lower boundary (`imin`) represented as a scalar or an array.
        • An upper boundary (`imax`) represented as a scalar or an array.
        Throws:
        IllegalArgumentException - if the size of the boundary arrays does not match the size of x.
        RuntimeException - if the interval selector state is unknown.