text stringlengths 171 29.4k |
|---|
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public final void translate(CharSequence input, Writer out) throws IOException {
if (out == null) {
throw new IllegalArgumentException("The Writer must no... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public boolean contains(char ch) {
char[] thisBuf = buffer;
for (int i = 0; i < thisBuf.length; i++) {
if (thisBuf[i] == ch) {
ret... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public int indexOf(String str, int startIndex) {
startIndex = (startIndex < 0 ? 0 : startIndex);
if (str == null || startIndex >= size) {
return -... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public String unescape(String str) {
int firstAmp = str.indexOf('&');
if (firstAmp < 0) {
return str;
}
StringBuffer buf = new St... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static String formatPeriod(long startMillis, long endMillis, String format, boolean padWithZeros,
TimeZone timezone) {
long millis = endMillis - star... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public int compareTo(Object other) {
return iValue - ((ValuedEnum) other).iValue;
}
// Test Case
[/INST]
public void testCompareTo_otherEnumType() {
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private static void modify(Calendar val, int field, boolean round) {
if (val.get(Calendar.YEAR) > 280000000) {
throw new ArithmeticException("Calendar val... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static Number createNumber(String str) throws NumberFormatException {
if (str == null) {
return null;
}
if (StringUtils.isBlank(str... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private static StringBuilder escapeRegex(StringBuilder regex, String value, boolean unquote) {
boolean wasWhite= false;
for(int i= 0; i<value.length(); ++i) {... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private void init() {
thisYear= Calendar.getInstance(timeZone, locale).get(Calendar.YEAR);
nameValues= new ConcurrentHashMap<Integer, KeyValue[]>();
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private Fraction(double value, double epsilon, int maxDenominator, int maxIterations)
throws FractionConversionException
{
long overflow = Integer.MAX_VAL... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private BigFraction(final double value, final double epsilon,
final int maxDenominator, int maxIterations)
throws FractionConversionException ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public void atan2(final double[] y, final int yOffset,
final double[] x, final int xOffset,
final double[] result, final int resul... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double[][] getCovariances(EstimationProblem problem)
throws EstimationException {
// set up the jacobian
updateJacobian();
// compute ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Complex parse(String source, ParsePosition pos) {
int initialIndex = pos.getIndex();
// parse whitespace
parseAndIgnoreWhitespace(source, pos)... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double chiSquare(double[] expected, long[] observed)
throws IllegalArgumentException {
if ((expected.length < 2) || (expected.length != observed.length... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double cumulativeProbability(double x) throws MathException {
return 0.5 * (1.0 + Erf.erf((x - mean) /
(standardDeviation * Math.sqrt(2... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
public void testRegularizedGammaPositivePositive() {
testRegularizedGamma(0.632120558828558, 1.0, 1.0);
}
</s> |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double getSumSquaredErrors() {
return sumYY - sumXY * sumXY / sumXX;
}
// Test Case
[/INST]
public void testSSENonNegative() {
double[] y = { ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Fraction parse(String source, ParsePosition pos) {
// try to parse improper fraction
Fraction ret = super.parse(source, pos);
if (ret != null) ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double density(final double[] vals) throws DimensionMismatchException {
final int dim = getDimension();
if (vals.length != dim) {
throw new... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double getSumSquaredErrors() {
return sumYY - sumXY * sumXY / sumXX;
}
// Test Case
[/INST]
public void testSSENonNegative() {
double[] y = { ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private RealMatrix squareRoot(RealMatrix m) {
final EigenDecomposition dec = new EigenDecomposition(m);
return dec.getSquareRoot();
}
// Test Cas... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Weight(double[] weight) {
final int dim = weight.length;
weightMatrix = org.apache.commons.math3.linear.MatrixUtils.createRealMatrix(dim, dim);
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private RealMatrix squareRoot(RealMatrix m) {
final EigenDecomposition dec = new EigenDecomposition(m);
return dec.getSquareRoot();
}
// Test Cas... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test
public void testMath904() {
final double x = -1;
final double y = (5 + 1e-15) * 1e15;
Assert.assertEquals(Math.pow(x... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static double cosh(double x) {
if (x != x) {
return x;
}
// cosh[z] = (exp(z) + exp(-z))/2
// for numbers with magnitude 20 or so,
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
@Test
public void testMath905LargePositive() {
final double start = StrictMath.log(Double.MAX_VALUE);
final double endT = StrictMa... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Dfp multiply(final int x) {
return multiplyFast(x);
}
// Test Case
[/INST]
@Test
public void testMultiply()
{
test(field.newDfp("1... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double[] encode(final double[] x) {
if (boundaries == null) {
return x;
}
double[] res = new double[x.length];
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private void checkParameters() {
final double[] init = getStartPoint();
final double[] lB = getLowerBound();
final double[] uB = getUpperBound();
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double getNumericalMean() {
return (double) (getSampleSize() * getNumberOfSuccesses()) / (double) getPopulationSize();
}
// Test Case
[/INST]
@Test
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double[] repairAndDecode(final double[] x) {
return
decode(x);
}
// Test Case
[/INST]
@Test
public void testMath864() ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public RectangularCholeskyDecomposition(RealMatrix matrix, double small)
throws NonPositiveDefiniteMatrixException {
final int order = matrix.getRowDimension... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public boolean isSupportUpperBoundInclusive() {
return false;
}
// Test Case
[/INST]
@Test
public void testIsSupportLowerBoundInclusive() {
final... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public boolean isSupportLowerBoundInclusive() {
return true;
}
// Test Case
[/INST]
@Test
public void testIsSupportLowerBoundInclusive() {
final ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected UnivariatePointValuePair doOptimize() {
final boolean isMinim = getGoalType() == GoalType.MINIMIZE;
final double lo = getMin();
final double... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected UnivariatePointValuePair doOptimize() {
final boolean isMinim = getGoalType() == GoalType.MINIMIZE;
final double lo = getMin();
final double... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private void guessAOmega() {
// initialize the sums for the linear model between the two integrals
double sx2 = 0;
double sy2 = 0;
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private Fraction(double value, double epsilon, int maxDenominator, int maxIterations)
throws FractionConversionException
{
long overflow = Integer.MAX_VAL... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double percentageValue() {
return multiply(100).doubleValue();
}
// Test Case
[/INST]
@Test
public void testMath835() {
final int numer = ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private Integer getPivotRow(SimplexTableau tableau, final int col) {
// create a list of all the rows that tie for the lowest score in the minimum ratio test
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public OpenMapRealVector ebeDivide(RealVector v) {
checkVectorDimensions(v.getDimension());
OpenMapRealVector res = new OpenMapRealVector(this);... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public OpenMapRealVector ebeMultiply(RealVector v) {
checkVectorDimensions(v.getDimension());
OpenMapRealVector res = new OpenMapRealVector(this... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static double linearCombination(final double[] a, final double[] b)
throws DimensionMismatchException {
final int len = a.length;
if (len != b.... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private double calculateAsymptoticPValue(final double Umin,
final int n1,
final int ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double evaluate(double x, double epsilon, int maxIterations) {
final double small = 1e-50;
double hPrev = getA(0, x);
// use the value of smal... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected void computeGeometricalProperties() {
final Vector2D[][] v = getVertices();
if (v.length == 0) {
final BSPTree<Euclidean2D> tree = get... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected void dropPhase1Objective() {
if (getNumObjectiveFunctions() == 1) {
return;
}
List<Integer> columnsToDrop = new ArrayList<Integ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Iterator<Chromosome> iterator() {
return chromosomes.iterator();
}
// Test Case
[/INST]
@Test(expected = UnsupportedOperationException.class)
publ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public ElitisticListPopulation(final List<Chromosome> chromosomes,
final int populationLimit,
final doub... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public double doubleValue() {
double result = numerator.doubleValue() / denominator.doubleValue();
// Numerator and/or denominator must be o... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Complex tan() {
if (isNaN) {
return NaN;
}
double real2 = 2.0 * real;
double imaginary2 = 2.0 * imaginary;
double ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Complex tanh() {
if (isNaN) {
return NaN;
}
double real2 = 2.0 * real;
double imaginary2 = 2.0 * imaginary;
double ... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private void prelim(double[] lowerBound,
double[] upperBound) {
printMethod(); // XXX
final int n = currentBest.getDimension();
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public void integrate(final ExpandableStatefulODE equations, final double t)
throws MathIllegalStateException, MathIllegalArgumentException {
sanityChecks(equations,... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Vector2D intersection(final SubLine subLine, final boolean includeEndPoints) {
// retrieve the underlying lines
Line line1 = (Line) getHyperplane();
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
X
// Test Case
[/INST]
public void testIntersectionNotIntersecting() throws MathIllegalArgumentException {
SubLine sub1 = new SubLine(new Vector3D(1, 1, 1), new Vect... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected double doSolve() {
// prepare arrays with the first points
final double[] x = new double[maximalOrder + 1];
final double[] y = new double[m... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double evaluate(final double[] values, final double[] weights,
final double mean, final int begin, final int length) {
double var =... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected RealPointValuePair getSolution() {
int negativeVarColumn = columnLabels.indexOf(NEGATIVE_VAR_COLUMN_LABEL);
Integer negativeVarBasicRow = negativeVarCol... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public void addValue(double value) {
sumImpl.increment(value);
sumsqImpl.increment(value);
minImpl.increment(value);
maxImpl.increment(value);... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected double acceptStep(final AbstractStepInterpolator interpolator,
final double[] y, final double[] yDot, final double tEnd)
thr... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public OpenMapRealMatrix(int rowDimension, int columnDimension) {
super(rowDimension, columnDimension);
this.rows = rowDimension;
this.columns = colum... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Complex divide(Complex divisor)
throws NullArgumentException {
MathUtils.checkNotNull(divisor);
if (isNaN || divisor.isNaN) {
retur... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Complex divide(Complex divisor)
throws NullArgumentException {
MathUtils.checkNotNull(divisor);
if (isNaN || divisor.isNaN) {
retur... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected final double doSolve() {
// Get initial solution
double x0 = getMin();
double x1 = getMax();
double f0 = computeObjectiveValue(x0);
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public OpenMapRealVector ebeDivide(RealVector v) {
checkVectorDimensions(v.getDimension());
OpenMapRealVector res = new OpenMapRealVector(this);
Itera... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Complex reciprocal() {
if (isNaN) {
return NaN;
}
if (real == 0.0 && imaginary == 0.0) {
return NaN;
}
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected final double doSolve() {
// Get initial solution
double x0 = getMin();
double x1 = getMax();
double f0 = computeObjectiveValue(x0);
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected final double doSolve() {
// Get initial solution
double x0 = getMin();
double x1 = getMax();
double f0 = computeObjectiveValue(x0);
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Rotation(Vector3D u1, Vector3D u2, Vector3D v1, Vector3D v2) {
// norms computation
double u1u1 = u1.getNormSq();
double u2u2 = u2.getNormSq();
double v1v1 = v1... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public Complex add(Complex rhs)
throws NullArgumentException {
MathUtils.checkNotNull(rhs);
return createComplex(real + rhs.getReal(),
ima... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected Dfp(final DfpField field, double x) {
// initialize as if 0
mant = new int[field.getRadixDigits()];
sign = 1;
exp = 0;
nans... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static Vector3D crossProduct(final Vector3D v1, final Vector3D v2) {
// rescale both vectors without losing precision,
// to ensure their norm are the same... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public int[] getCounts(int index) {
if (index < 0 ||
index >= totalSize) {
throw new OutOfRangeException(index, 0, totalSize);
}
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private static <T extends Clusterable<T>> List<Cluster<T>>
chooseInitialCenters(final Collection<T> points, final int k, final Random random) {
final List<T>... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double[] fit() {
final double[] guess = (new ParameterGuesser(getObservations())).guess();
return fit(new Gaussian.Parametric(), guess);
}
// Test... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static float max(final float a, final float b) {
return (a <= b) ? b : (Float.isNaN(a + b) ? Float.NaN : b);
}
// Test Case
[/INST]
@Test
public v... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected BaseOptimizer(ConvergenceChecker<PAIR> checker) {
this.checker = checker;
evaluations = new Incrementor(0, new MaxEvalCallback());
iteratio... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
public PointVectorValuePair doOptimize() {
checkParameters();
final ConvergenceChecker<PointVectorValuePair> checker
= getConvergen... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
protected PointValuePair doOptimize() {
checkParameters();
// Indirect call to "computeObjectiveValue" in order to update the
// evalua... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
protected PointValuePair doOptimize() {
checkParameters();
final GoalType goal = getGoalType();
final double[] guess = getStartPoint();... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
protected PointValuePair doOptimize() {
final ConvergenceChecker<PointValuePair> checker = getConvergenceChecker();
final double[] point = getSt... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
protected PointVectorValuePair doOptimize() {
checkParameters();
final int nR = getTarget().length; // Number of observed data.
final d... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
@Override
protected PointValuePair doOptimize() {
// -------------------- Initialization --------------------------------
isMinimize = getGoalType().equa... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double cumulativeProbability(double x) throws MathException {
final double dev = x - mean;
try {
return 0.5 * (1.0 + Erf.erf((dev) /
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public PoissonDistributionImpl(double p, double epsilon, int maxIterations) {
if (p <= 0) {
throw MathRuntimeException.createIllegalArgumentException(Loca... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public UnivariateRealPointValuePair optimize(final FUNC f,
final GoalType goal,
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public UnivariateRealPointValuePair optimize(final FUNC f, final GoalType goal,
final double min, final double max,
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public static boolean equals(double x, double y) {
return (Double.isNaN(x) && Double.isNaN(y)) || x == y;
}
// Test Case
[/INST]
public void testArrayEquals(... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected VectorialPointValuePair doOptimize()
throws FunctionEvaluationException, OptimizationException, IllegalArgumentException {
// arrays shared with th... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double getRMS() {
double criterion = 0;
for (int i = 0; i < rows; ++i) {
final double residual = residuals[i];
criterion += res... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public BrentOptimizer() {
setMaxEvaluations(Integer.MAX_VALUE);
setMaximalIterationCount(100);
setAbsoluteAccuracy(1E-10);
setRelativeAccuracy... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected double doOptimize()
throws MaxIterationsExceededException, FunctionEvaluationException {
throw new UnsupportedOperationException();
}
// Test C... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
protected double doOptimize()
throws MaxIterationsExceededException, FunctionEvaluationException {
throw new UnsupportedOperationException();
}
// Test C... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double optimize(final UnivariateRealFunction f, final GoalType goalType, final double min, final double max, final double startValue) throws MaxIterationsExceededExcep... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
private double localMin(boolean isMinim,
UnivariateRealFunction f,
GoalType goalType,
doub... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public double getFunctionValue() {
return optimizer.getFunctionValue();
}
// Test Case
[/INST]
@Test
public void testQuinticMin() throws MathException {
... |
<s>[INST] <<SYS>>
You are a helpful assistant. Generate a test case that triggers the bug for the buggy function.
<</SYS>>
// Buggy Function
public LevenbergMarquardtOptimizer() {
// set up the superclass with a default max cost evaluations setting
setMaxIterations(1000);
// default valu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.