<commit_before>package net.finmath.integration;

import java.util.Arrays;
import java.util.List;
import java.util.function.DoubleUnaryOperator;
import java.util.function.Function;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.Validate;

/**
 * A piecewise constant {@link java.util.function.DoubleUnaryOperator} \( f : \mathbb{R} \rightarrow \mathbb{R} \)
 * with exact calculation of the integral \( \int_{a}^{b} f(x) dx \) for given bounds \( a, b \).
 *
 * The summation uses Kahan error correction.
 *
 * For convenience the class can act as {@link java.util.function.DoubleUnaryOperator} specialization
 * and as {@link java.util.function.Function<Double, Double>}.
 *
 * @author <NAME>
 */
public class PiecewiseContantDoubleUnaryOperator implements DoubleUnaryOperator, Function<Double, Double> {

	private final double[] intervalRightPoints;
	private final double[] values;

	/**<commit_msg>Fixed JavaDoc.<commit_after>package net.finmath.integration;

import java.util.Arrays;
import java.util.List;
import java.util.function.DoubleUnaryOperator;
import java.util.function.Function;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.Validate;

/**
 * A piecewise constant {@link java.util.function.DoubleUnaryOperator} \( f : \mathbb{R} \rightarrow \mathbb{R} \)
 * with exact calculation of the integral \( \int_{a}^{b} f(x) dx \) for given bounds \( a, b \).
 *
 * The summation uses Kahan error correction.
 *
 * For convenience the class can act as {@link java.util.function.DoubleUnaryOperator} specialization
 * and as {@link java.util.function.Function}.
 *
 * @author <NAME>
 */
public class PiecewiseContantDoubleUnaryOperator implements DoubleUnaryOperator, Function<Double, Double> {

	private final double[] intervalRightPoints;
	private final double[] values;

	/**
{'fraction_non_alphanumeric': 0.12249322493224932, 'fraction_numerical': 0.002168021680216802, 'mean_word_length': 4.841772151898734, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6205831', 'n_tokens_mistral': 546, 'n_tokens_neox': 537, 'n_words': 150}