Interface NodalCurve

    • Method Detail

      • withMetadata

        NodalCurve withMetadata​(CurveMetadata metadata)
        Returns a new curve with the specified metadata.

        This allows the metadata of the curve to be changed while retaining all other information. If parameter metadata is present, the size of the list must match the number of parameters of this curve.

        Specified by:
        withMetadata in interface Curve
        Parameters:
        metadata - the new metadata for the curve
        Returns:
        the new curve
      • getParameterMetadata

        default ParameterMetadata getParameterMetadata​(int parameterIndex)
        Gets the metadata of the parameter at the specified index.

        If there is no specific parameter metadata, SimpleCurveParameterMetadata will be created.

        Specified by:
        getParameterMetadata in interface Curve
        Specified by:
        getParameterMetadata in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        Returns:
        the metadata of the parameter
        Throws:
        java.lang.IndexOutOfBoundsException - if the index is invalid
      • getXValues

        DoubleArray getXValues()
        Gets the known x-values of the curve.

        This method returns the fixed x-values used to define the curve. This will be of the same size as the y-values.

        Returns:
        the x-values
      • getYValues

        DoubleArray getYValues()
        Gets the known y-values of the curve.

        This method returns the fixed y-values used to define the curve. This will be of the same size as the x-values.

        Returns:
        the y-values
      • withYValues

        NodalCurve withYValues​(DoubleArray values)
        Returns a new curve with the specified values.

        This allows the y-values of the curve to be changed while retaining the same x-values.

        Parameters:
        values - the new y-values for the curve
        Returns:
        the new curve
      • withValues

        NodalCurve withValues​(DoubleArray xValues,
                              DoubleArray yValues)
        Returns a new curve with the specified x-values and y-values.

        This allows the x values and y-values of the curve to be changed.

        Parameters:
        xValues - the new x-values for the curve
        yValues - the new y-values for the curve
        Returns:
        the new curve
      • withParameter

        NodalCurve withParameter​(int parameterIndex,
                                 double newValue)
        Description copied from interface: ParameterizedData
        Returns a copy of the data with the value at the specified index altered.

        This instance is immutable and unaffected by this method call.

        Specified by:
        withParameter in interface Curve
        Specified by:
        withParameter in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        newValue - the new value for the specified parameter
        Returns:
        a parameterized data instance based on this with the specified parameter altered
      • withPerturbation

        default NodalCurve withPerturbation​(ParameterPerturbation perturbation)
        Description copied from interface: ParameterizedData
        Returns a perturbed copy of the data.

        The perturbation instance will be invoked once for each parameter in this instance, returning the perturbed value for that parameter. The result of this method is a new instance that is based on those perturbed values.

        This instance is immutable and unaffected by this method call.

        Specified by:
        withPerturbation in interface Curve
        Specified by:
        withPerturbation in interface ParameterizedData
        Parameters:
        perturbation - the perturbation to apply
        Returns:
        a parameterized data instance based on this with the specified perturbation applied
      • withNode

        NodalCurve withNode​(double x,
                            double y,
                            ParameterMetadata paramMetadata)
        Returns a new curve with an additional node, specifying the parameter metadata.

        The result will contain the specified node. If the x-value equals an existing x-value, the y-value will be changed. If the x-value does not equal an existing x-value, the node will be added.

        The result will only contain the specified parameter metadata if this curve also has parameter meta-data.

        Parameters:
        x - the new x-value
        y - the new y-value
        paramMetadata - the new parameter metadata
        Returns:
        the updated curve