task_type
stringclasses
4 values
code_task
stringclasses
15 values
start_line
int64
4
1.79k
end_line
int64
4
1.8k
before
stringlengths
79
76.1k
between
stringlengths
17
806
after
stringlengths
2
72.6k
reason_categories_output
stringlengths
2
2.24k
horizon_categories_output
stringlengths
83
3.99k
reason_freq_analysis
stringclasses
150 values
horizon_freq_analysis
stringlengths
23
185
completion_java
RNGTester
392
394
['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r...
[' gammas.add(new Gamma(getPRNG(), new GammaParam(d, 1.0, ', ' params.getLeftmostStep(),', ' params.getNumSteps())));']
[' }', ' } catch (OutOfBoundsException e) {', ' System.err.format("Dirichlet constructor Error: out of bounds access (%d) to shapes\\n", i);', ' params = null;', ' gammas = null;', ' return;', ' }', ' }', '', ' /**', ' * Generate another random object', ' */', ' public IDoubleVecto...
[{'reason_category': 'Loop Body', 'usage_line': 392}, {'reason_category': 'Loop Body', 'usage_line': 393}, {'reason_category': 'Loop Body', 'usage_line': 394}]
Global_Variable 'gammas' used at line 392 is defined at line 382 and has a Short-Range dependency. Class 'Gamma' used at line 392 is defined at line 276 and has a Long-Range dependency. Function 'getPRNG' used at line 392 is defined at line 508 and has a Long-Range dependency. Class 'GammaParam' used at line 392 is def...
{'Loop Body': 3}
{'Global_Variable Short-Range': 1, 'Class Long-Range': 2, 'Function Long-Range': 1, 'Variable Short-Range': 1, 'Global_Variable Medium-Range': 2}
completion_java
RNGTester
414
416
['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r...
[' for (Gamma g : gammas) {', ' v.setItem(i++, g.getNext());', ' }']
[' } catch (OutOfBoundsException e) {', ' System.err.format("Dirichlet getNext Error: out of bounds access (%d) to result vector\\n", i);', ' return null;', ' }', '', ' v.normalize();', '', ' return v;', ' }', '', '}', '', '/**', ' * Wrap the Java random number generator.', ' */', '', 'class Chri...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 414}, {'reason_category': 'Loop Body', 'usage_line': 415}, {'reason_category': 'Loop Body', 'usage_line': 416}]
Global_Variable 'gammas' used at line 414 is defined at line 382 and has a Long-Range dependency. Variable 'v' used at line 415 is defined at line 409 and has a Short-Range dependency. Variable 'i' used at line 415 is defined at line 411 and has a Short-Range dependency. Variable 'g' used at line 415 is defined at line...
{'Define Stop Criteria': 1, 'Loop Body': 2}
{'Global_Variable Long-Range': 1, 'Variable Short-Range': 3}
completion_java
RNGTester
457
458
['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r...
[' X = X.multiply (a).add (c).mod (m);', ' return X.shiftRight (32).intValue () / max + 0.5;']
[' }', ' ', ' /**', ' * Reset the PRNG to the original seed', ' */', ' public void startOver() {', ' X = new BigInteger (seedValue + "");', ' }', '}', '', 'class Main {', '', ' public static void main (String [] args) {', ' IPRNG foo = new ChrisPRNG (0);', ' for (int i = 0; i < 10; i++) {',...
[]
Global_Variable 'X' used at line 457 is defined at line 442 and has a Medium-Range dependency. Global_Variable 'a' used at line 457 is defined at line 439 and has a Medium-Range dependency. Global_Variable 'c' used at line 457 is defined at line 440 and has a Medium-Range dependency. Global_Variable 'm' used at line 45...
{}
{'Global_Variable Medium-Range': 5, 'Global_Variable Short-Range': 1}
completion_java
RNGTester
562
562
['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r...
[' return genUniform(params.getLow(), params.getHigh());']
[' }', ' ', '}', '', '/**', ' * This holds a parameterization for the uniform distribution', ' */', 'class UniformParam {', ' ', ' double low, high;', ' ', ' public UniformParam (double lowIn, double highIn) {', ' low = lowIn;', ' high = highIn;', ' }', ' ', ' public double getLow () {', ' return low;'...
[]
Function 'genUniform' used at line 562 is defined at line 531 and has a Long-Range dependency. Global_Variable 'params' used at line 562 is defined at line 546 and has a Medium-Range dependency.
{}
{'Function Long-Range': 1, 'Global_Variable Medium-Range': 1}
completion_java
RNGTester
575
576
['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r...
[' low = lowIn;', ' high = highIn;']
[' }', ' ', ' public double getLow () {', ' return low;', ' }', ' ', ' public double getHigh () {', ' return high;', ' }', '}', '', 'class UnitGamma extends ARandomGenerationAlgorithm <Double> {', '', ' /**', ' * Parameters', ' */', ' private GammaParam params;', '', ' private class RejectionSampler...
[]
Variable 'lowIn' used at line 575 is defined at line 574 and has a Short-Range dependency. Global_Variable 'low' used at line 575 is defined at line 572 and has a Short-Range dependency. Variable 'highIn' used at line 576 is defined at line 574 and has a Short-Range dependency. Global_Variable 'high' used at line 576 i...
{}
{'Variable Short-Range': 2, 'Global_Variable Short-Range': 2}
completion_java
RNGTester
602
604
['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r...
[' xRegion = new UniformParam(xmin, xmax);', ' yRegion = new UniformParam(ymin, ymax);', ' area = (xmax - xmin) * (ymax - ymin);']
[' }', '', ' protected Double tryNext() {', ' Double x = genUniform (xRegion.getLow (), xRegion.getHigh ());', ' Double y = genUniform (yRegion.getLow (), yRegion.getHigh ());', ' ', ' if (y <= fofx(x)) {', ' return x;', ' } else {', ' return null;', ' }', ' }', ...
[]
Class 'UniformParam' used at line 602 is defined at line 570 and has a Long-Range dependency. Variable 'xmin' used at line 602 is defined at line 600 and has a Short-Range dependency. Variable 'xmax' used at line 602 is defined at line 600 and has a Short-Range dependency. Global_Variable 'xRegion' used at line 602 is ...
{}
{'Class Long-Range': 2, 'Variable Short-Range': 8, 'Global_Variable Short-Range': 3}
completion_java
RNGTester
608
609
['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r...
[' Double x = genUniform (xRegion.getLow (), xRegion.getHigh ());', ' Double y = genUniform (yRegion.getLow (), yRegion.getHigh ());']
[' ', ' if (y <= fofx(x)) {', ' return x;', ' } else {', ' return null;', ' }', ' }', '', ' protected double getArea() {', ' return area;', ' }', ' }', ' ', ' /**', ' * Uniform generators', ' */', ' // Samplers for each step', ' private ArrayList<RejectionSam...
[]
Function 'genUniform' used at line 608 is defined at line 531 and has a Long-Range dependency. Global_Variable 'xRegion' used at line 608 is defined at line 596 and has a Medium-Range dependency. Function 'genUniform' used at line 609 is defined at line 531 and has a Long-Range dependency. Global_Variable 'yRegion' use...
{}
{'Function Long-Range': 2, 'Global_Variable Medium-Range': 2}
completion_java
RNGTester
652
652
['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r...
[' totalArea += (left*2.0 - left) * fx;']
[' }', ' }', ' ', ' public UnitGamma(IPRNG prng, GammaParam myParams) {', ' super(prng);', ' params = myParams;', ' setup ();', ' } ', ' ', ' public UnitGamma(long mySeed, GammaParam myParams) {', ' super(mySeed);', ' params = myParams;', ' setup ();', ' }', '', ' /**', ' * Generate anothe...
[{'reason_category': 'Loop Body', 'usage_line': 652}]
Variable 'left' used at line 652 is defined at line 649 and has a Short-Range dependency. Variable 'fx' used at line 652 is defined at line 650 and has a Short-Range dependency. Global_Variable 'totalArea' used at line 652 is defined at line 645 and has a Short-Range dependency.
{'Loop Body': 1}
{'Variable Short-Range': 2, 'Global_Variable Short-Range': 1}
completion_java
RNGTester
663
665
['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r...
[' super(mySeed);', ' params = myParams;', ' setup ();']
[' }', '', ' /**', ' * Generate another random object', ' */', ' public Double getNext () {', ' while (true) {', ' double step = genUniform(0.0, totalArea);', ' double area = 0.0;', ' for (RejectionSampler s : samplers) {', ' area += s.getArea();', ' if (area >= step) {', ' ...
[]
Variable 'mySeed' used at line 663 is defined at line 662 and has a Short-Range dependency. Variable 'myParams' used at line 664 is defined at line 662 and has a Short-Range dependency. Global_Variable 'params' used at line 664 is defined at line 593 and has a Long-Range dependency. Function 'setup' used at line 665 is...
{}
{'Variable Short-Range': 2, 'Global_Variable Long-Range': 1, 'Function Medium-Range': 1}
completion_java
RNGTester
676
676
['import junit.framework.TestCase;', 'import java.math.BigInteger;', 'import java.util.ArrayList;', 'import java.util.Arrays;', 'import java.util.Random;', 'import java.util.ArrayList;', '', '/**', ' * Interface to a pseudo random number generator that generates', ' * numbers between 0.0 and 1.0 and can start over to r...
[' area += s.getArea();']
[' if (area >= step) {', ' // Found the right sampler', ' Double x = s.tryNext();', ' if (x != null) {', ' return x;', ' }', ' break;', ' }', ' }', ' }', ' }', '}', '', '', '/**', ' * A JUnit test case class.', ' * Every method starting with...
[{'reason_category': 'Loop Body', 'usage_line': 676}]
Variable 's' used at line 676 is defined at line 675 and has a Short-Range dependency. Variable 'area' used at line 676 is defined at line 674 and has a Short-Range dependency.
{'Loop Body': 1}
{'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
241
241
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' if (j >= numRows || j < 0)']
[' throw new OutOfBoundsException ("row out of bounds in getRowABS");', ' ', ' IDoubleVector returnVal = myData.get (j);', ' if (returnVal == null) {', ' returnVal = new SparseDoubleVector (numCols, backValue); ', ' }', ' return returnVal;', ' }', ' ', ' protected IDoubleVector getColumnABS...
[{'reason_category': 'If Condition', 'usage_line': 241}]
Variable 'j' used at line 241 is defined at line 240 and has a Short-Range dependency. Global_Variable 'numRows' used at line 241 is defined at line 228 and has a Medium-Range dependency.
{'If Condition': 1}
{'Variable Short-Range': 1, 'Global_Variable Medium-Range': 1}
completion_java
DoubleMatrixTester
252
252
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' if (i >= numCols || i < 0)']
[' throw new OutOfBoundsException ("col out of bounds in getColABS");', ' ', ' IDoubleVector returnVal = new SparseDoubleVector (numRows, backValue);', ' ', ' for (int row = 0; row < numRows; row++) {', ' IDoubleVector myRow = myData.get (row);', ' if (myRow != null) {', ' returnVal.se...
[{'reason_category': 'If Condition', 'usage_line': 252}]
Variable 'i' used at line 252 is defined at line 251 and has a Short-Range dependency. Global_Variable 'numCols' used at line 252 is defined at line 227 and has a Medium-Range dependency.
{'If Condition': 1}
{'Variable Short-Range': 1, 'Global_Variable Medium-Range': 1}
completion_java
DoubleMatrixTester
260
260
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' returnVal.setItem (row, myRow.getItem (i));']
[' }', ' }', ' return returnVal;', ' }', ' ', ' protected void setRowABS (int j, IDoubleVector setToMe) throws OutOfBoundsException {', ' if (j >= numRows || j < 0 || setToMe.getLength () != numCols)', ' throw new OutOfBoundsException ("row out of bounds in setRowABS");', ' myData.put (j, setTo...
[{'reason_category': 'If Body', 'usage_line': 260}, {'reason_category': 'Loop Body', 'usage_line': 260}]
Variable 'returnVal' used at line 260 is defined at line 255 and has a Short-Range dependency. Variable 'row' used at line 260 is defined at line 257 and has a Short-Range dependency. Variable 'myRow' used at line 260 is defined at line 258 and has a Short-Range dependency. Variable 'i' used at line 260 is defined at l...
{'If Body': 1, 'Loop Body': 1}
{'Variable Short-Range': 4}
completion_java
DoubleMatrixTester
267
267
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' if (j >= numRows || j < 0 || setToMe.getLength () != numCols)']
[' throw new OutOfBoundsException ("row out of bounds in setRowABS");', ' myData.put (j, setToMe);', ' }', ' ', ' protected void setColumnABS (int i, IDoubleVector setToMe) throws OutOfBoundsException {', ' if (i >= numCols || i < 0 || setToMe.getLength () != numRows)', ' throw new OutOfBoundsExcepti...
[{'reason_category': 'If Condition', 'usage_line': 267}]
Variable 'j' used at line 267 is defined at line 266 and has a Short-Range dependency. Global_Variable 'numRows' used at line 267 is defined at line 228 and has a Long-Range dependency. Variable 'setToMe' used at line 267 is defined at line 266 and has a Short-Range dependency. Global_Variable 'numCols' used at line 26...
{'If Condition': 1}
{'Variable Short-Range': 2, 'Global_Variable Long-Range': 2}
completion_java
DoubleMatrixTester
258
261
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleVector myRow = myData.get (row);', ' if (myRow != null) {', ' returnVal.setItem (row, myRow.getItem (i));', ' }']
[' }', ' return returnVal;', ' }', ' ', ' protected void setRowABS (int j, IDoubleVector setToMe) throws OutOfBoundsException {', ' if (j >= numRows || j < 0 || setToMe.getLength () != numCols)', ' throw new OutOfBoundsException ("row out of bounds in setRowABS");', ' myData.put (j, setToMe);', ' }...
[{'reason_category': 'Loop Body', 'usage_line': 258}, {'reason_category': 'If Condition', 'usage_line': 259}, {'reason_category': 'Loop Body', 'usage_line': 259}, {'reason_category': 'If Body', 'usage_line': 260}, {'reason_category': 'Loop Body', 'usage_line': 260}, {'reason_category': 'If Body', 'usage_line': 261}, {'...
Global_Variable 'myData' used at line 258 is defined at line 226 and has a Long-Range dependency. Variable 'row' used at line 258 is defined at line 257 and has a Short-Range dependency. Variable 'myRow' used at line 259 is defined at line 258 and has a Short-Range dependency. Variable 'returnVal' used at line 260 is d...
{'Loop Body': 4, 'If Condition': 1, 'If Body': 2}
{'Global_Variable Long-Range': 1, 'Variable Short-Range': 6}
completion_java
DoubleMatrixTester
273
274
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' if (i >= numCols || i < 0 || setToMe.getLength () != numRows)', ' throw new OutOfBoundsException ("col out of bounds in setColumnABS");']
[' ', ' for (int row = 0; row < numRows; row++) {', ' IDoubleVector myRow = myData.get (row);', ' if (myRow == null) {', ' myRow = new SparseDoubleVector (numCols, backValue);', ' myData.put (row, myRow);', ' }', ' myRow.setItem (i, setToMe.getItem (row));', ' } ', ' }', ' '...
[{'reason_category': 'If Condition', 'usage_line': 273}, {'reason_category': 'If Body', 'usage_line': 274}]
Variable 'i' used at line 273 is defined at line 272 and has a Short-Range dependency. Global_Variable 'numCols' used at line 273 is defined at line 227 and has a Long-Range dependency. Variable 'setToMe' used at line 273 is defined at line 272 and has a Short-Range dependency. Global_Variable 'numRows' used at line 27...
{'If Condition': 1, 'If Body': 1}
{'Variable Short-Range': 2, 'Global_Variable Long-Range': 2}
completion_java
DoubleMatrixTester
277
277
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleVector myRow = myData.get (row);']
[' if (myRow == null) {', ' myRow = new SparseDoubleVector (numCols, backValue);', ' myData.put (row, myRow);', ' }', ' myRow.setItem (i, setToMe.getItem (row));', ' } ', ' }', ' ', ' protected double getEntryABS (int j, int i) throws OutOfBoundsException {', ' if (j >= numRows || ...
[{'reason_category': 'Loop Body', 'usage_line': 277}]
Global_Variable 'myData' used at line 277 is defined at line 226 and has a Long-Range dependency. Variable 'row' used at line 277 is defined at line 276 and has a Short-Range dependency.
{'Loop Body': 1}
{'Global_Variable Long-Range': 1, 'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
278
278
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' if (myRow == null) {']
[' myRow = new SparseDoubleVector (numCols, backValue);', ' myData.put (row, myRow);', ' }', ' myRow.setItem (i, setToMe.getItem (row));', ' } ', ' }', ' ', ' protected double getEntryABS (int j, int i) throws OutOfBoundsException {', ' if (j >= numRows || j < 0)', ' throw new OutO...
[{'reason_category': 'Loop Body', 'usage_line': 278}, {'reason_category': 'If Condition', 'usage_line': 278}]
Variable 'myRow' used at line 278 is defined at line 277 and has a Short-Range dependency.
{'Loop Body': 1, 'If Condition': 1}
{'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
287
287
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' if (j >= numRows || j < 0)']
[' throw new OutOfBoundsException ("row out of bounds in getEntryABS");', ' if (i >= numCols || i < 0)', ' throw new OutOfBoundsException ("col out of bounds in getEntryABS");', ' IDoubleVector myRow = myData.get (j);', ' if (myRow == null) {', ' return backValue; ', ' }', ' return myRow....
[{'reason_category': 'If Condition', 'usage_line': 287}]
Variable 'j' used at line 287 is defined at line 286 and has a Short-Range dependency. Global_Variable 'numRows' used at line 287 is defined at line 228 and has a Long-Range dependency.
{'If Condition': 1}
{'Variable Short-Range': 1, 'Global_Variable Long-Range': 1}
completion_java
DoubleMatrixTester
289
289
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' if (i >= numCols || i < 0)']
[' throw new OutOfBoundsException ("col out of bounds in getEntryABS");', ' IDoubleVector myRow = myData.get (j);', ' if (myRow == null) {', ' return backValue; ', ' }', ' return myRow.getItem (i);', ' }', ' ', ' public IDoubleVector sumRows () {', ' IDoubleVector sum = new DenseDoubleVecto...
[{'reason_category': 'If Condition', 'usage_line': 289}]
Variable 'i' used at line 289 is defined at line 286 and has a Short-Range dependency. Global_Variable 'numCols' used at line 289 is defined at line 227 and has a Long-Range dependency.
{'If Condition': 1}
{'Variable Short-Range': 1, 'Global_Variable Long-Range': 1}
completion_java
DoubleMatrixTester
302
303
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleVector curRow = getRow (i);', ' curRow.addMyselfToHim (sum);']
[' } catch (OutOfBoundsException e) {throw new RuntimeException (e);}', ' }', ' return sum;', ' }', ' ', ' public IDoubleVector sumColumns () {', ' IDoubleVector sum = new DenseDoubleVector (getNumRows (), 0.0);', ' for (int i = 0; i < getNumColumns (); i++) {', ' try {', ' IDoubleVector...
[{'reason_category': 'Loop Body', 'usage_line': 302}, {'reason_category': 'Loop Body', 'usage_line': 303}]
Function 'getRow' used at line 302 is defined at line 64 and has a Long-Range dependency. Variable 'i' used at line 302 is defined at line 300 and has a Short-Range dependency. Variable 'curRow' used at line 303 is defined at line 302 and has a Short-Range dependency. Variable 'sum' used at line 303 is defined at line ...
{'Loop Body': 2}
{'Function Long-Range': 1, 'Variable Short-Range': 3}
completion_java
DoubleMatrixTester
313
314
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleVector curCol = getColumn (i);', ' curCol.addMyselfToHim (sum);']
[' } catch (OutOfBoundsException e) {throw new RuntimeException (e);}', ' }', ' return sum;', ' }', ' ', ' protected void setEntryABS (int j, int i, double setToMe) throws OutOfBoundsException {', ' if (j >= numRows || j < 0)', ' throw new OutOfBoundsException ("row out of bounds in setEntryABS");...
[{'reason_category': 'Loop Body', 'usage_line': 313}, {'reason_category': 'Loop Body', 'usage_line': 314}]
Function 'getColumn' used at line 313 is defined at line 71 and has a Long-Range dependency. Variable 'i' used at line 313 is defined at line 311 and has a Short-Range dependency. Variable 'curCol' used at line 314 is defined at line 313 and has a Short-Range dependency. Variable 'sum' used at line 314 is defined at li...
{'Loop Body': 2}
{'Function Long-Range': 1, 'Variable Short-Range': 3}
completion_java
DoubleMatrixTester
321
324
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' if (j >= numRows || j < 0)', ' throw new OutOfBoundsException ("row out of bounds in setEntryABS");', ' if (i >= numCols || i < 0)', ' throw new OutOfBoundsException ("col out of bounds in setEntryABS");']
[' IDoubleVector myRow = myData.get (j);', ' if (myRow == null) {', ' myRow = new SparseDoubleVector (numCols, backValue);', ' myData.put (j, myRow);', ' }', ' myRow.setItem (i, setToMe);', ' }', ' ', ' protected int getNumRowsABS () {', ' return numRows;', ' }', ' ', ' protected int getN...
[{'reason_category': 'If Condition', 'usage_line': 321}, {'reason_category': 'If Body', 'usage_line': 322}, {'reason_category': 'If Condition', 'usage_line': 323}, {'reason_category': 'If Body', 'usage_line': 324}]
Variable 'j' used at line 321 is defined at line 320 and has a Short-Range dependency. Global_Variable 'numRows' used at line 321 is defined at line 228 and has a Long-Range dependency. Variable 'i' used at line 323 is defined at line 320 and has a Short-Range dependency. Global_Variable 'numCols' used at line 323 is d...
{'If Condition': 2, 'If Body': 2}
{'Variable Short-Range': 2, 'Global_Variable Long-Range': 2}
completion_java
DoubleMatrixTester
327
328
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' myRow = new SparseDoubleVector (numCols, backValue);', ' myData.put (j, myRow);']
[' }', ' myRow.setItem (i, setToMe);', ' }', ' ', ' protected int getNumRowsABS () {', ' return numRows;', ' }', ' ', ' protected int getNumColumnsABS () {', ' return numCols;', ' }', ' ', ' /**', ' * Theare are the various operations that will be implemented in the concrete classes', ' */', ' ...
[{'reason_category': 'If Body', 'usage_line': 327}, {'reason_category': 'If Body', 'usage_line': 328}]
Global_Variable 'numCols' used at line 327 is defined at line 227 and has a Long-Range dependency. Global_Variable 'backValue' used at line 327 is defined at line 229 and has a Long-Range dependency. Variable 'myRow' used at line 327 is defined at line 325 and has a Short-Range dependency. Global_Variable 'myData' used...
{'If Body': 2}
{'Global_Variable Long-Range': 3, 'Variable Short-Range': 3}
completion_java
DoubleMatrixTester
358
358
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' super (numCols, numRows, defaultVal); ']
[' }', ' ', ' public IDoubleVector getRow (int j) throws OutOfBoundsException {', ' return getColumnABS (j); ', ' }', ' ', ' public IDoubleVector getColumn (int i) throws OutOfBoundsException {', ' return getRowABS (i); ', ' }', ' ', ' public void setRow (int j, IDoubleVector setToMe) throws OutOfBound...
[]
Variable 'numCols' used at line 358 is defined at line 357 and has a Short-Range dependency. Variable 'numRows' used at line 358 is defined at line 357 and has a Short-Range dependency. Variable 'defaultVal' used at line 358 is defined at line 357 and has a Short-Range dependency.
{}
{'Variable Short-Range': 3}
completion_java
DoubleMatrixTester
362
362
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' return getColumnABS (j); ']
[' }', ' ', ' public IDoubleVector getColumn (int i) throws OutOfBoundsException {', ' return getRowABS (i); ', ' }', ' ', ' public void setRow (int j, IDoubleVector setToMe) throws OutOfBoundsException {', ' setColumnABS (j, setToMe); ', ' }', ' ', ' public void addMyselfToHim (IDoubleMatrix toMe) thr...
[]
Function 'getColumnABS' used at line 362 is defined at line 251 and has a Long-Range dependency. Variable 'j' used at line 362 is defined at line 361 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
366
366
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' return getRowABS (i); ']
[' }', ' ', ' public void setRow (int j, IDoubleVector setToMe) throws OutOfBoundsException {', ' setColumnABS (j, setToMe); ', ' }', ' ', ' public void addMyselfToHim (IDoubleMatrix toMe) throws OutOfBoundsException {', ' int numCols = getNumColumns ();', ' for (int i = 0; i < numCols; i++) {', ' ...
[]
Function 'getRowABS' used at line 366 is defined at line 240 and has a Long-Range dependency. Variable 'i' used at line 366 is defined at line 365 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
370
370
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' setColumnABS (j, setToMe); ']
[' }', ' ', ' public void addMyselfToHim (IDoubleMatrix toMe) throws OutOfBoundsException {', ' int numCols = getNumColumns ();', ' for (int i = 0; i < numCols; i++) {', ' IDoubleVector curCol = getColumn (i);', ' IDoubleVector hisCol = toMe.getColumn (i);', ' curCol.addMyselfToHim (hisCol);', '...
[]
Function 'setColumnABS' used at line 370 is defined at line 272 and has a Long-Range dependency. Variable 'j' used at line 370 is defined at line 369 and has a Short-Range dependency. Variable 'setToMe' used at line 370 is defined at line 369 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
376
379
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleVector curCol = getColumn (i);', ' IDoubleVector hisCol = toMe.getColumn (i);', ' curCol.addMyselfToHim (hisCol);', ' toMe.setColumn (i, hisCol);']
[' }', ' }', ' ', ' public void setColumn (int i, IDoubleVector setToMe) throws OutOfBoundsException {', ' setRowABS (i, setToMe); ', ' }', ' ', ' public double getEntry (int i, int j) throws OutOfBoundsException {', ' return getEntryABS (j, i); ', ' }', ' ', ' public void setEntry (int i, int j, ...
[{'reason_category': 'Loop Body', 'usage_line': 376}, {'reason_category': 'Loop Body', 'usage_line': 377}, {'reason_category': 'Loop Body', 'usage_line': 378}, {'reason_category': 'Loop Body', 'usage_line': 379}]
Function 'getColumn' used at line 376 is defined at line 365 and has a Medium-Range dependency. Variable 'i' used at line 376 is defined at line 375 and has a Short-Range dependency. Variable 'toMe' used at line 377 is defined at line 373 and has a Short-Range dependency. Variable 'i' used at line 377 is defined at lin...
{'Loop Body': 4}
{'Function Medium-Range': 1, 'Variable Short-Range': 8}
completion_java
DoubleMatrixTester
384
384
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' setRowABS (i, setToMe); ']
[' }', ' ', ' public double getEntry (int i, int j) throws OutOfBoundsException {', ' return getEntryABS (j, i); ', ' }', ' ', ' public void setEntry (int i, int j, double setToMe) throws OutOfBoundsException {', ' setEntryABS (j, i, setToMe);', ' }', ' ', ' public int getNumRows () {', ' return getN...
[]
Function 'setRowABS' used at line 384 is defined at line 266 and has a Long-Range dependency. Variable 'i' used at line 384 is defined at line 383 and has a Short-Range dependency. Variable 'setToMe' used at line 384 is defined at line 383 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
388
388
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' return getEntryABS (j, i); ']
[' }', ' ', ' public void setEntry (int i, int j, double setToMe) throws OutOfBoundsException {', ' setEntryABS (j, i, setToMe);', ' }', ' ', ' public int getNumRows () {', ' return getNumColumnsABS (); ', ' }', ' ', ' public int getNumColumns () {', ' return getNumRowsABS ();', ' }', '}', '', '', '...
[]
Function 'getEntryABS' used at line 388 is defined at line 286 and has a Long-Range dependency. Variable 'j' used at line 388 is defined at line 387 and has a Short-Range dependency. Variable 'i' used at line 388 is defined at line 387 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
392
392
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' setEntryABS (j, i, setToMe);']
[' }', ' ', ' public int getNumRows () {', ' return getNumColumnsABS (); ', ' }', ' ', ' public int getNumColumns () {', ' return getNumRowsABS ();', ' }', '}', '', '', 'class RowMajorDoubleMatrix extends ADoubleMatrix {', ' ', ' public RowMajorDoubleMatrix (int numRows, int numCols, double defaultVal) ...
[]
Function 'setEntryABS' used at line 392 is defined at line 320 and has a Long-Range dependency. Variable 'j' used at line 392 is defined at line 391 and has a Short-Range dependency. Variable 'i' used at line 392 is defined at line 391 and has a Short-Range dependency. Variable 'setToMe' used at line 392 is defined at ...
{}
{'Function Long-Range': 1, 'Variable Short-Range': 3}
completion_java
DoubleMatrixTester
396
396
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' return getNumColumnsABS (); ']
[' }', ' ', ' public int getNumColumns () {', ' return getNumRowsABS ();', ' }', '}', '', '', 'class RowMajorDoubleMatrix extends ADoubleMatrix {', ' ', ' public RowMajorDoubleMatrix (int numRows, int numCols, double defaultVal) {', ' super (numRows, numCols, defaultVal); ', ' }', ' ', ' public IDoubl...
[]
Function 'getNumColumnsABS' used at line 396 is defined at line 337 and has a Long-Range dependency.
{}
{'Function Long-Range': 1}
completion_java
DoubleMatrixTester
400
400
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' return getNumRowsABS ();']
[' }', '}', '', '', 'class RowMajorDoubleMatrix extends ADoubleMatrix {', ' ', ' public RowMajorDoubleMatrix (int numRows, int numCols, double defaultVal) {', ' super (numRows, numCols, defaultVal); ', ' }', ' ', ' public IDoubleVector getRow (int j) throws OutOfBoundsException {', ' return getRowABS (j)...
[]
Function 'getNumRowsABS' used at line 400 is defined at line 333 and has a Long-Range dependency.
{}
{'Function Long-Range': 1}
completion_java
DoubleMatrixTester
408
408
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' super (numRows, numCols, defaultVal); ']
[' }', ' ', ' public IDoubleVector getRow (int j) throws OutOfBoundsException {', ' return getRowABS (j); ', ' }', ' ', ' public IDoubleVector getColumn (int i) throws OutOfBoundsException {', ' return getColumnABS (i); ', ' }', ' ', ' public void setRow (int j, IDoubleVector setToMe) throws OutOfBou...
[]
Variable 'numRows' used at line 408 is defined at line 407 and has a Short-Range dependency. Variable 'numCols' used at line 408 is defined at line 407 and has a Short-Range dependency. Variable 'defaultVal' used at line 408 is defined at line 407 and has a Short-Range dependency.
{}
{'Variable Short-Range': 3}
completion_java
DoubleMatrixTester
412
412
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' return getRowABS (j); ']
[' }', ' ', ' public IDoubleVector getColumn (int i) throws OutOfBoundsException {', ' return getColumnABS (i); ', ' }', ' ', ' public void setRow (int j, IDoubleVector setToMe) throws OutOfBoundsException {', ' setRowABS (j, setToMe); ', ' }', ' ', ' public void addMyselfToHim (IDoubleMatrix toMe) thr...
[]
Function 'getRowABS' used at line 412 is defined at line 240 and has a Long-Range dependency. Variable 'j' used at line 412 is defined at line 411 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
416
416
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' return getColumnABS (i); ']
[' }', ' ', ' public void setRow (int j, IDoubleVector setToMe) throws OutOfBoundsException {', ' setRowABS (j, setToMe); ', ' }', ' ', ' public void addMyselfToHim (IDoubleMatrix toMe) throws OutOfBoundsException {', ' int numRows = getNumRows ();', ' for (int i = 0; i < numRows; i++) {', ' IDoubl...
[]
Function 'getColumnABS' used at line 416 is defined at line 251 and has a Long-Range dependency. Variable 'i' used at line 416 is defined at line 415 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
420
420
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' setRowABS (j, setToMe); ']
[' }', ' ', ' public void addMyselfToHim (IDoubleMatrix toMe) throws OutOfBoundsException {', ' int numRows = getNumRows ();', ' for (int i = 0; i < numRows; i++) {', ' IDoubleVector curRow = getRow (i);', ' IDoubleVector hisRow = toMe.getRow (i);', ' curRow.addMyselfToHim (hisRow);', ' toM...
[]
Function 'setRowABS' used at line 420 is defined at line 266 and has a Long-Range dependency. Variable 'j' used at line 420 is defined at line 419 and has a Short-Range dependency. Variable 'setToMe' used at line 420 is defined at line 419 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
425
430
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' for (int i = 0; i < numRows; i++) {', ' IDoubleVector curRow = getRow (i);', ' IDoubleVector hisRow = toMe.getRow (i);', ' curRow.addMyselfToHim (hisRow);', ' toMe.setRow (i, hisRow);', ' }']
[' }', ' ', ' public void setColumn (int i, IDoubleVector setToMe) throws OutOfBoundsException {', ' setColumnABS (i, setToMe); ', ' }', ' ', ' public double getEntry (int i, int j) throws OutOfBoundsException {', ' return getEntryABS (i, j); ', ' }', ' ', ' public void setEntry (int i, int j, double...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 425}, {'reason_category': 'Loop Body', 'usage_line': 426}, {'reason_category': 'Loop Body', 'usage_line': 427}, {'reason_category': 'Loop Body', 'usage_line': 428}, {'reason_category': 'Loop Body', 'usage_line': 429}, {'reason_category': 'Loop Body', 'usage_lin...
Variable 'i' used at line 425 is defined at line 425 and has a Short-Range dependency. Variable 'numRows' used at line 425 is defined at line 424 and has a Short-Range dependency. Function 'getRow' used at line 426 is defined at line 411 and has a Medium-Range dependency. Variable 'i' used at line 426 is defined at lin...
{'Define Stop Criteria': 1, 'Loop Body': 5}
{'Variable Short-Range': 10, 'Function Medium-Range': 1}
completion_java
DoubleMatrixTester
434
434
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' setColumnABS (i, setToMe); ']
[' }', ' ', ' public double getEntry (int i, int j) throws OutOfBoundsException {', ' return getEntryABS (i, j); ', ' }', ' ', ' public void setEntry (int i, int j, double setToMe) throws OutOfBoundsException {', ' setEntryABS (i, j, setToMe);', ' }', ' ', ' public int getNumRows () {', ' return getN...
[]
Function 'setColumnABS' used at line 434 is defined at line 272 and has a Long-Range dependency. Variable 'i' used at line 434 is defined at line 433 and has a Short-Range dependency. Variable 'setToMe' used at line 434 is defined at line 433 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
438
438
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' return getEntryABS (i, j); ']
[' }', ' ', ' public void setEntry (int i, int j, double setToMe) throws OutOfBoundsException {', ' setEntryABS (i, j, setToMe);', ' }', ' ', ' public int getNumRows () {', ' return getNumRowsABS (); ', ' }', ' ', ' public int getNumColumns () {', ' return getNumColumnsABS ();', ' }', '}', '/**', ' ...
[]
Function 'getEntryABS' used at line 438 is defined at line 286 and has a Long-Range dependency. Variable 'i' used at line 438 is defined at line 437 and has a Short-Range dependency. Variable 'j' used at line 438 is defined at line 437 and has a Short-Range dependency.
{}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
442
442
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' setEntryABS (i, j, setToMe);']
[' }', ' ', ' public int getNumRows () {', ' return getNumRowsABS (); ', ' }', ' ', ' public int getNumColumns () {', ' return getNumColumnsABS ();', ' }', '}', '/**', ' * A JUnit test case class for testing an implementation of an IDoubleMatrix. Every method starting with the word "test" will be called w...
[]
Function 'setEntryABS' used at line 442 is defined at line 320 and has a Long-Range dependency. Variable 'i' used at line 442 is defined at line 441 and has a Short-Range dependency. Variable 'j' used at line 442 is defined at line 441 and has a Short-Range dependency. Variable 'setToMe' used at line 442 is defined at ...
{}
{'Function Long-Range': 1, 'Variable Short-Range': 3}
completion_java
DoubleMatrixTester
446
446
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' return getNumRowsABS (); ']
[' }', ' ', ' public int getNumColumns () {', ' return getNumColumnsABS ();', ' }', '}', '/**', ' * A JUnit test case class for testing an implementation of an IDoubleMatrix. Every method starting with the word "test" will be called when running the test with JUnit.', ' */', 'public class DoubleMatrixTester exte...
[]
Function 'getNumRowsABS' used at line 446 is defined at line 333 and has a Long-Range dependency.
{}
{'Function Long-Range': 1}
completion_java
DoubleMatrixTester
450
450
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' return getNumColumnsABS ();']
[' }', '}', '/**', ' * A JUnit test case class for testing an implementation of an IDoubleMatrix. Every method starting with the word "test" will be called when running the test with JUnit.', ' */', 'public class DoubleMatrixTester extends TestCase {', '// Constants to contain the boundary values we will test for.', '...
[]
Function 'getNumColumnsABS' used at line 450 is defined at line 337 and has a Long-Range dependency.
{}
{'Function Long-Range': 1}
completion_java
DoubleMatrixTester
488
488
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' observed < goal + 0.000001)) {']
[' fail("Got " + observed + ", expected " + goal);', ' }', ' }', ' ', ' /**', " * Tests that the matrix's size (number of columns, number of rows) is set properly.", ' */', ' public void testMatrixSize() {', ' ', ' for (int i = 0; i < 100; i += 10) {', ' IDoubleMatrix rMatrix = new RowMajorDoubleMatrix(i*2, i,...
[]
Variable 'observed' used at line 488 is defined at line 486 and has a Short-Range dependency. Variable 'goal' used at line 488 is defined at line 486 and has a Short-Range dependency.
{}
{'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
503
505
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleMatrix cMatrix = new ColumnMajorDoubleMatrix(i*2, i, 5.0);', ' assertEquals("Column major matrix size (col) failed to match", i, cMatrix.getNumColumns());', ' assertEquals("Column major matrix size (rows) failed to match", i*2, cMatrix.getNumRows());']
[' }', ' ', ' throwsCorrectExceptionWithInitialization(-1, 5);', ' throwsCorrectExceptionWithInitialization(5, -1);', ' throwsCorrectExceptionWithInitialization(-3, -3);', ' }', ' ', ' /**', " * Tests if the matrix's constructor does its job properly with guaranteeing valid inputs for ", ' * the number of column...
[{'reason_category': 'Loop Body', 'usage_line': 503}, {'reason_category': 'Loop Body', 'usage_line': 504}, {'reason_category': 'Loop Body', 'usage_line': 505}]
Class 'ColumnMajorDoubleMatrix' used at line 503 is defined at line 355 and has a Long-Range dependency. Variable 'i' used at line 503 is defined at line 498 and has a Short-Range dependency. Variable 'i' used at line 504 is defined at line 498 and has a Short-Range dependency. Function 'ColumnMajorDoubleMatrix.getNumC...
{'Loop Body': 3}
{'Class Long-Range': 1, 'Variable Short-Range': 3, 'Function Long-Range': 2}
completion_java
DoubleMatrixTester
527
527
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleMatrix cMatrix = new ColumnMajorDoubleMatrix(numRows, numCols, 0.0);']
[' } catch (Exception e) {', ' errorNotThrown = false;', ' }', '', ' if (errorNotThrown) {', ' fail("Was expecting an OutOfBounds or IllegalArgument exception to be thrown.");', ' }', ' }', ' ', ' /**', ' * Test that every element of a newly initialized matrix has the same initial value.', ' */', ' public voi...
[]
Class 'ColumnMajorDoubleMatrix' used at line 527 is defined at line 355 and has a Long-Range dependency. Variable 'numRows' used at line 527 is defined at line 521 and has a Short-Range dependency. Variable 'numCols' used at line 527 is defined at line 521 and has a Short-Range dependency.
{}
{'Class Long-Range': 1, 'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
542
542
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleMatrix cMatrix = new ColumnMajorDoubleMatrix(4, 3, 5.0);']
[' ', ' checkAllMatrixElementsEqualTo(rMatrix, 3, 4, 5.0);', ' checkAllMatrixElementsEqualTo(cMatrix, 3, 4, 5.0);', ' }', ' ', ' /**', ' * Checks that all elements of a matrix are equal to the same value.', ' * @param matrix - matrix to be checked', ' * @param numCols - number of columns of the matrix', ' * @pa...
[]
Class 'ColumnMajorDoubleMatrix' used at line 542 is defined at line 355 and has a Long-Range dependency.
{}
{'Class Long-Range': 1}
completion_java
DoubleMatrixTester
545
545
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' checkAllMatrixElementsEqualTo(cMatrix, 3, 4, 5.0);']
[' }', ' ', ' /**', ' * Checks that all elements of a matrix are equal to the same value.', ' * @param matrix - matrix to be checked', ' * @param numCols - number of columns of the matrix', ' * @param numRows - number of rows of the matrix', ' * @param sameValue - value that all elements of the matrix should be e...
[]
Function 'checkAllMatrixElementsEqualTo' used at line 545 is defined at line 555 and has a Short-Range dependency. Variable 'cMatrix' used at line 545 is defined at line 542 and has a Short-Range dependency.
{}
{'Function Short-Range': 1, 'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
578
578
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' checkCloseEnough(actual.getItem(i), expected[i]);']
[' } catch (OutOfBoundsException e) {', ' fail("Encountered an out of bounds exception when doing a valid get operation.");', ' }', ' }', ' }', ' ', ' /**', ' * Tests a simple setting and getting n a matrix.', ' */', ' public void testSimpleSetAndGet() {', ' IDoubleMatrix rMatrix = new RowMajorDoubleMatrix(1...
[{'reason_category': 'Loop Body', 'usage_line': 578}]
Function 'checkCloseEnough' used at line 578 is defined at line 486 and has a Long-Range dependency. Variable 'actual' used at line 578 is defined at line 575 and has a Short-Range dependency. Variable 'i' used at line 578 is defined at line 576 and has a Short-Range dependency. Variable 'expected' used at line 578 is ...
{'Loop Body': 1}
{'Function Long-Range': 1, 'Variable Short-Range': 3}
completion_java
DoubleMatrixTester
590
590
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleMatrix cMatrix = new ColumnMajorDoubleMatrix(10, 10, 1.0);']
['', ' trySimpleSetAndGetOnMatrix(rMatrix);', ' trySimpleSetAndGetOnMatrix(cMatrix);', ' }', '', ' /**', ' * Used to test a simple setting and getting of an element in a matrix.', ' * Checks for out-of-bounds access as well.', ' * @param matrix matrix to be tested', ' */', ' public void trySimpleSetAndGetOnMatrix...
[]
Class 'ColumnMajorDoubleMatrix' used at line 590 is defined at line 355 and has a Long-Range dependency.
{}
{'Class Long-Range': 1}
completion_java
DoubleMatrixTester
593
593
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' trySimpleSetAndGetOnMatrix(cMatrix);']
[' }', '', ' /**', ' * Used to test a simple setting and getting of an element in a matrix.', ' * Checks for out-of-bounds access as well.', ' * @param matrix matrix to be tested', ' */', ' public void trySimpleSetAndGetOnMatrix(IDoubleMatrix matrix) {', ' try {', ' // is a valid entry index (colNum, rowNum) - t...
[]
Function 'trySimpleSetAndGetOnMatrix' used at line 593 is defined at line 601 and has a Short-Range dependency. Variable 'cMatrix' used at line 593 is defined at line 590 and has a Short-Range dependency.
{}
{'Function Short-Range': 1, 'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
719
720
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' for (int i = 0; i < 4; i++) {', ' for (int j = 0; j < 3; j++) {']
[' try {', ' // initialize matrix row-by-row, then column-by-column', ' matrix.setEntry(j, i, counter);', ' // increment counter so that matrix elements are different, but predictable', ' counter++;', ' } catch (OutOfBoundsException e) {', ' fail("Caught an unexpected OutOfBounds error when do...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 719}, {'reason_category': 'Define Stop Criteria', 'usage_line': 720}, {'reason_category': 'Loop Body', 'usage_line': 720}]
Variable 'i' used at line 719 is defined at line 719 and has a Short-Range dependency. Variable 'j' used at line 720 is defined at line 720 and has a Short-Range dependency.
{'Define Stop Criteria': 2, 'Loop Body': 1}
{'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
723
723
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' matrix.setEntry(j, i, counter);']
[' // increment counter so that matrix elements are different, but predictable', ' counter++;', ' } catch (OutOfBoundsException e) {', ' fail("Caught an unexpected OutOfBounds error when doing a valid setEntry.");', ' }', ' }', ' }', ' }', ' ', ' /**', ' * Initializes a matrix to a set of simple v...
[{'reason_category': 'Loop Body', 'usage_line': 723}]
Variable 'matrix' used at line 723 is defined at line 718 and has a Short-Range dependency. Variable 'j' used at line 723 is defined at line 720 and has a Short-Range dependency. Variable 'i' used at line 723 is defined at line 719 and has a Short-Range dependency. Variable 'counter' used at line 723 is defined at line...
{'Loop Body': 1}
{'Variable Short-Range': 4}
completion_java
DoubleMatrixTester
725
725
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' counter++;']
[' } catch (OutOfBoundsException e) {', ' fail("Caught an unexpected OutOfBounds error when doing a valid setEntry.");', ' }', ' }', ' }', ' }', ' ', ' /**', ' * Initializes a matrix to a set of simple values. Note that this only', ' * initializes the top left-hand 4 columns and 3 rows; all other element...
[{'reason_category': 'Loop Body', 'usage_line': 725}]
Variable 'counter' used at line 725 is defined at line 718 and has a Short-Range dependency.
{'Loop Body': 1}
{'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
719
725
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' for (int i = 0; i < 4; i++) {', ' for (int j = 0; j < 3; j++) {', ' try {', ' // initialize matrix row-by-row, then column-by-column', ' matrix.setEntry(j, i, counter);', ' // increment counter so that matrix elements are different, but predictable', ' counter++;']
[' } catch (OutOfBoundsException e) {', ' fail("Caught an unexpected OutOfBounds error when doing a valid setEntry.");', ' }', ' }', ' }', ' }', ' ', ' /**', ' * Initializes a matrix to a set of simple values. Note that this only', ' * initializes the top left-hand 4 columns and 3 rows; all other element...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 719}, {'reason_category': 'Define Stop Criteria', 'usage_line': 720}, {'reason_category': 'Loop Body', 'usage_line': 720}, {'reason_category': 'Loop Body', 'usage_line': 721}, {'reason_category': 'Loop Body', 'usage_line': 722}, {'reason_category': 'Loop Body',...
Variable 'i' used at line 719 is defined at line 719 and has a Short-Range dependency. Variable 'j' used at line 720 is defined at line 720 and has a Short-Range dependency. Variable 'matrix' used at line 723 is defined at line 718 and has a Short-Range dependency. Variable 'j' used at line 723 is defined at line 720 a...
{'Define Stop Criteria': 2, 'Loop Body': 6}
{'Variable Short-Range': 7}
completion_java
DoubleMatrixTester
761
761
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' int numRows = actualMatrix[0].length;']
[' ', ' // iterate through elements of 2-d array and matrix', ' for (int rowIndex = 0; rowIndex < numRows; rowIndex++) {', ' for (int colIndex = 0; colIndex < numCols; colIndex++) {', '', ' try {', ' double expected = actualMatrix[colIndex][rowIndex];', ' double actual = checkThisMatrix.getEntry(rowInde...
[]
Variable 'actualMatrix' used at line 761 is defined at line 758 and has a Short-Range dependency.
{}
{'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
764
765
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' for (int rowIndex = 0; rowIndex < numRows; rowIndex++) {', ' for (int colIndex = 0; colIndex < numCols; colIndex++) {']
['', ' try {', ' double expected = actualMatrix[colIndex][rowIndex];', ' double actual = checkThisMatrix.getEntry(rowIndex, colIndex);', ' ', ' // compare corresponding elements from the 2-d array and the IDoubleMatrix', ' checkCloseEnough(actual, expected);', ' } catch (OutOfBoundsException e...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 764}, {'reason_category': 'Define Stop Criteria', 'usage_line': 765}, {'reason_category': 'Loop Body', 'usage_line': 765}]
Variable 'rowIndex' used at line 764 is defined at line 764 and has a Short-Range dependency. Variable 'numRows' used at line 764 is defined at line 761 and has a Short-Range dependency. Variable 'colIndex' used at line 765 is defined at line 765 and has a Short-Range dependency. Variable 'numCols' used at line 765 is ...
{'Define Stop Criteria': 2, 'Loop Body': 1}
{'Variable Short-Range': 4}
completion_java
DoubleMatrixTester
767
772
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' try {', ' double expected = actualMatrix[colIndex][rowIndex];', ' double actual = checkThisMatrix.getEntry(rowIndex, colIndex);', ' ', ' // compare corresponding elements from the 2-d array and the IDoubleMatrix', ' checkCloseEnough(actual, expected);']
[' } catch (OutOfBoundsException e) {', ' fail("Encountered an out of bounds exception when doing a valid get operation.");', ' }', ' }', ' }', ' }', ' ', ' /**', ' * Tests if the getRow() function works correctly, also checks for out of bounds access errors.', ' */', ' public void testSimpleGetRow() {',...
[{'reason_category': 'Loop Body', 'usage_line': 767}, {'reason_category': 'Loop Body', 'usage_line': 768}, {'reason_category': 'Loop Body', 'usage_line': 769}, {'reason_category': 'Loop Body', 'usage_line': 770}, {'reason_category': 'Loop Body', 'usage_line': 771}, {'reason_category': 'Loop Body', 'usage_line': 772}]
Variable 'actualMatrix' used at line 768 is defined at line 758 and has a Short-Range dependency. Variable 'colIndex' used at line 768 is defined at line 765 and has a Short-Range dependency. Variable 'rowIndex' used at line 768 is defined at line 764 and has a Short-Range dependency. Variable 'checkThisMatrix' used at...
{'Loop Body': 6}
{'Variable Short-Range': 7, 'Variable Medium-Range': 1, 'Function Long-Range': 1}
completion_java
DoubleMatrixTester
772
772
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' checkCloseEnough(actual, expected);']
[' } catch (OutOfBoundsException e) {', ' fail("Encountered an out of bounds exception when doing a valid get operation.");', ' }', ' }', ' }', ' }', ' ', ' /**', ' * Tests if the getRow() function works correctly, also checks for out of bounds access errors.', ' */', ' public void testSimpleGetRow() {',...
[{'reason_category': 'Loop Body', 'usage_line': 772}]
Function 'checkCloseEnough' used at line 772 is defined at line 486 and has a Long-Range dependency. Variable 'actual' used at line 772 is defined at line 769 and has a Short-Range dependency. Variable 'expected' used at line 772 is defined at line 768 and has a Short-Range dependency.
{'Loop Body': 1}
{'Function Long-Range': 1, 'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
885
889
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' try {', ' matrix.getColumn(colIndex);', ' } catch (OutOfBoundsException e) {', ' errorNotThrown = false;', ' }']
['', ' // if no error was detected, then fail the test', ' if (errorNotThrown) {', ' fail("Was expecting an OutOfBounds exception to be thrown.");', ' }', ' }', ' ', ' /**', ' * Tests if the setColumn() function works correctly, also checks for out of bounds access ', ' * or illegal argument errors which should ...
[]
Variable 'matrix' used at line 886 is defined at line 882 and has a Short-Range dependency. Variable 'colIndex' used at line 886 is defined at line 882 and has a Short-Range dependency. Variable 'errorNotThrown' used at line 888 is defined at line 883 and has a Short-Range dependency.
{}
{'Variable Short-Range': 3}
completion_java
DoubleMatrixTester
961
967
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' try {', ' matrix.setColumn(columnIndex, column);', ' } catch (OutOfBoundsException e) {', ' errorNotThrown = false;', ' } catch (IllegalArgumentException e) {', ' errorNotThrown = false;', ' }']
['', ' if (errorNotThrown) {', ' fail("Was expecting an OutOfBounds or IllegalArgument exception to be thrown.");', ' }', ' }', '', ' /**', ' * Tests if the setRow() function works correctly, also checks for out of bounds access ', ' * or illegal argument errors which should be thrown under certain conditions.', ...
[]
Variable 'matrix' used at line 962 is defined at line 957 and has a Short-Range dependency. Variable 'columnIndex' used at line 962 is defined at line 957 and has a Short-Range dependency. Variable 'column' used at line 962 is defined at line 957 and has a Short-Range dependency. Variable 'errorNotThrown' used at line ...
{}
{'Variable Short-Range': 5}
completion_java
DoubleMatrixTester
1,037
1,041
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' matrix.setRow(rowIndex, row);', ' } catch (OutOfBoundsException e) {', ' errorNotThrown = false;', ' } catch (IllegalArgumentException e) {', ' errorNotThrown = false;']
[' }', '', ' if (errorNotThrown) {', ' fail("Was expecting an OutOfBounds or IllegalArgument exception to be thrown.");', ' }', ' }', ' ', ' /**', ' * Tests a more complex scenario of getting and setting columns and rows.', ' */', ' public void testMoreComplexGetAndSet() {', ' IDoubleMatrix cMatrix = new Column...
[]
Variable 'matrix' used at line 1037 is defined at line 1032 and has a Short-Range dependency. Variable 'rowIndex' used at line 1037 is defined at line 1032 and has a Short-Range dependency. Variable 'row' used at line 1037 is defined at line 1032 and has a Short-Range dependency. Variable 'errorNotThrown' used at line ...
{}
{'Variable Short-Range': 5}
completion_java
DoubleMatrixTester
1,098
1,100
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleMatrix rMatrixSizeOneColumn = new RowMajorDoubleMatrix(0, 1, 0.0); ', ' IDoubleMatrix rMatrixSizeOneRow = new RowMajorDoubleMatrix(1, 0, 0.0);', ' IDoubleMatrix rMatrixSizeOne = new RowMajorDoubleMatrix(1, 1, 0.0);']
[' ', ' // test that any accesses with get entry will produce an OutOfBoundsException', ' throwsCorrectExceptionWithGet(rMatrixSizeZero, 0, 0);', ' throwsCorrectExceptionWithGet(rMatrixSizeOneColumn, 0, 0);', ' throwsCorrectExceptionWithGet(rMatrixSizeOneRow, 0, 0);', ' throwsCorrectExceptionWithGet(rMatrixSizeOn...
[]
Class 'RowMajorDoubleMatrix' used at line 1098 is defined at line 405 and has a Long-Range dependency. Class 'RowMajorDoubleMatrix' used at line 1099 is defined at line 405 and has a Long-Range dependency. Class 'RowMajorDoubleMatrix' used at line 1100 is defined at line 405 and has a Long-Range dependency.
{}
{'Class Long-Range': 3}
completion_java
DoubleMatrixTester
1,109
1,112
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleMatrix cMatrixSizeZero = new ColumnMajorDoubleMatrix(0, 0, 0.0);', ' IDoubleMatrix cMatrixSizeOneColumn = new ColumnMajorDoubleMatrix(0, 1, 0.0);', ' IDoubleMatrix cMatrixSizeOneRow = new ColumnMajorDoubleMatrix(1, 0, 0.0);', ' IDoubleMatrix cMatrixSizeOne = new ColumnMajorDoubleMatrix(1, 1, 0.0);']
[' ', ' // test that any accesses with get entry will produce an OutOfBoundsException', ' throwsCorrectExceptionWithGet(cMatrixSizeZero, 0, 0);', ' throwsCorrectExceptionWithGet(cMatrixSizeOneColumn, 0, 0);', ' throwsCorrectExceptionWithGet(cMatrixSizeOneRow, 0, 0);', ' throwsCorrectExceptionWithGet(cMatrixSizeOn...
[]
Class 'ColumnMajorDoubleMatrix' used at line 1109 is defined at line 355 and has a Long-Range dependency. Class 'ColumnMajorDoubleMatrix' used at line 1110 is defined at line 355 and has a Long-Range dependency. Class 'ColumnMajorDoubleMatrix' used at line 1111 is defined at line 355 and has a Long-Range dependency. Cl...
{}
{'Class Long-Range': 4}
completion_java
DoubleMatrixTester
1,135
1,136
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' double entry = (j+1)*10+(i+1);', ' checkMe.setEntry(j,i,entry);']
[' } catch (OutOfBoundsException e) {', ' fail("Was unable to set the entry column: " + i + " row: " + j);', ' }', ' }', ' }', '', ' // Get individual entries', ' for (int i = 0; i < numColumns; i+=100) {', ' for (int j = 0; j < numRows; j+=100) {', ' try {', ' ...
[{'reason_category': 'Loop Body', 'usage_line': 1135}, {'reason_category': 'Loop Body', 'usage_line': 1136}]
Variable 'j' used at line 1135 is defined at line 1133 and has a Short-Range dependency. Variable 'i' used at line 1135 is defined at line 1132 and has a Short-Range dependency. Variable 'checkMe' used at line 1136 is defined at line 1126 and has a Short-Range dependency. Variable 'j' used at line 1136 is defined at li...
{'Loop Body': 2}
{'Variable Short-Range': 6}
completion_java
DoubleMatrixTester
1,147
1,148
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' double entry = (j+1)*10+(i+1);', ' assertEquals(entry, checkMe.getEntry(j,i));']
[' } catch (OutOfBoundsException e) {', ' fail("Was unable to get the entry column: " + i + " row: " + j);', ' }', ' }', ' }', ' }', ' ', ' /**', ' * Tests the matrix by writing around 1% of the matrix in a sparse manner for a RowMajorDoubleMatrix', ' */', ' public void testSparse...
[{'reason_category': 'Loop Body', 'usage_line': 1147}, {'reason_category': 'Loop Body', 'usage_line': 1148}]
Variable 'j' used at line 1147 is defined at line 1145 and has a Short-Range dependency. Variable 'i' used at line 1147 is defined at line 1144 and has a Short-Range dependency. Variable 'entry' used at line 1148 is defined at line 1147 and has a Short-Range dependency. Variable 'checkMe' used at line 1148 is defined a...
{'Loop Body': 2}
{'Variable Short-Range': 5, 'Variable Medium-Range': 1}
completion_java
DoubleMatrixTester
1,170
1,171
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' IDoubleMatrix cMatrix = new ColumnMajorDoubleMatrix (1000,1000,-1.0);', ' sparseMatrixLargeTester(cMatrix);']
[' }', ' ', ' ', ' /**', ' * This test runs a test on the following combinations on a wide variety of matrix sizes and indices. ', ' * Here, we test ', ' * setting an entry, then setting a row.', ' * setting an entry, then setting a column.', ' * setting a row, then setting an entry.', ' * sett...
[]
Class 'ColumnMajorDoubleMatrix' used at line 1170 is defined at line 355 and has a Long-Range dependency. Function 'sparseMatrixLargeTester' used at line 1171 is defined at line 1126 and has a Long-Range dependency. Variable 'cMatrix' used at line 1171 is defined at line 1170 and has a Short-Range dependency.
{}
{'Class Long-Range': 1, 'Function Long-Range': 1, 'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
1,205
1,205
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' changeRows[2] = numRows - 1;']
[' ', ' // We test a middle column index (middle case)', ' changeCols[1] = numCols / 2;', ' // We also test the last column index (boundary case)', ' changeCols[2] = numCols - 1;', ' ', ' // We use values from setValues due to the reason we mention at the t...
[{'reason_category': 'Loop Body', 'usage_line': 1205}]
Variable 'numRows' used at line 1205 is defined at line 1199 and has a Short-Range dependency. Variable 'changeRows' used at line 1205 is defined at line 1203 and has a Short-Range dependency.
{'Loop Body': 1}
{'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
1,210
1,210
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' changeCols[2] = numCols - 1;']
[' ', ' // We use values from setValues due to the reason we mention at the top. ', ' // Here, we test setting a row, then an entry (or the other way around) on all possible combinations from ', " // a corner to a boundary, a boundary to a corner, or even middle cases. We also veri...
[{'reason_category': 'Loop Body', 'usage_line': 1210}]
Variable 'numCols' used at line 1210 is defined at line 1200 and has a Short-Range dependency. Variable 'changeCols' used at line 1210 is defined at line 1208 and has a Short-Range dependency.
{'Loop Body': 1}
{'Variable Short-Range': 2}
completion_java
DoubleMatrixTester
1,229
1,231
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' myMatrix = new ColumnMajorDoubleMatrix(numRows, numCols, 0.0);', ' setRow = new SparseDoubleVector(numCols, testVal);', ' testSetRowEntryCombo(myMatrix, change_i_Entry, change_j_Entry, changeRow, changeVal, setRow);']
[' ', ' // Test setting an entry and then the row on a row major double matrix', ' myMatrix = new RowMajorDoubleMatrix(numRows, numCols, 0.0);', ' setRow = new SparseDoubleVector(numCols, testVal);', ' testSetEntryRowCombo(my...
[{'reason_category': 'Loop Body', 'usage_line': 1229}, {'reason_category': 'Loop Body', 'usage_line': 1230}, {'reason_category': 'Loop Body', 'usage_line': 1231}]
Class 'ColumnMajorDoubleMatrix' used at line 1229 is defined at line 355 and has a Long-Range dependency. Variable 'numRows' used at line 1229 is defined at line 1199 and has a Medium-Range dependency. Variable 'numCols' used at line 1229 is defined at line 1200 and has a Medium-Range dependency. Variable 'myMatrix' us...
{'Loop Body': 3}
{'Class Long-Range': 1, 'Variable Medium-Range': 6, 'Variable Short-Range': 6, 'Function Long-Range': 1}
completion_java
DoubleMatrixTester
1,234
1,236
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' myMatrix = new RowMajorDoubleMatrix(numRows, numCols, 0.0);', ' setRow = new SparseDoubleVector(numCols, testVal);', ' testSetEntryRowCombo(myMatrix, change_i_Entry, change_j_Entry, changeRow, changeVal, setRow);']
[' ', ' // Test setting a row and then the entry on a row major double matrix', ' myMatrix = new RowMajorDoubleMatrix(numRows, numCols, 0.0);', ' setRow = new SparseDoubleVector(numCols, testVal);', ' testSetRowEntryCombo(myM...
[{'reason_category': 'Loop Body', 'usage_line': 1234}, {'reason_category': 'Loop Body', 'usage_line': 1235}, {'reason_category': 'Loop Body', 'usage_line': 1236}]
Class 'RowMajorDoubleMatrix' used at line 1234 is defined at line 405 and has a Long-Range dependency. Variable 'numRows' used at line 1234 is defined at line 1199 and has a Long-Range dependency. Variable 'numCols' used at line 1234 is defined at line 1200 and has a Long-Range dependency. Variable 'myMatrix' used at l...
{'Loop Body': 3}
{'Class Long-Range': 1, 'Variable Long-Range': 3, 'Variable Short-Range': 4, 'Variable Medium-Range': 5, 'Function Long-Range': 1}
completion_java
DoubleMatrixTester
1,239
1,241
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' myMatrix = new RowMajorDoubleMatrix(numRows, numCols, 0.0);', ' setRow = new SparseDoubleVector(numCols, testVal);', ' testSetRowEntryCombo(myMatrix, change_i_Entry, change_j_Entry, changeRow, changeVal, setRow);']
[' }', ' }', ' }', ' }', ' }', ' ', ' // We use values from setValues due to the reason we mention at the top. ', ' // Here, we test setting a column, then an entry (or the other way around) on all possible combinations from ',...
[{'reason_category': 'Loop Body', 'usage_line': 1239}, {'reason_category': 'Loop Body', 'usage_line': 1240}, {'reason_category': 'Loop Body', 'usage_line': 1241}]
Class 'RowMajorDoubleMatrix' used at line 1239 is defined at line 405 and has a Long-Range dependency. Variable 'numRows' used at line 1239 is defined at line 1199 and has a Long-Range dependency. Variable 'numCols' used at line 1239 is defined at line 1200 and has a Long-Range dependency. Variable 'myMatrix' used at l...
{'Loop Body': 3}
{'Class Long-Range': 1, 'Variable Long-Range': 3, 'Variable Short-Range': 4, 'Variable Medium-Range': 5, 'Function Long-Range': 1}
completion_java
DoubleMatrixTester
1,260
1,262
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' myMatrix = new ColumnMajorDoubleMatrix(numRows, numCols, 0.0);', ' setCol = new SparseDoubleVector(numRows, testVal);', ' testSetEntryColCombo(myMatrix, change_i_Entry, change_j_Entry, changeCol, changeVal, setCol);']
[' ', ' // Test setting a column and then the entry on a column major double matrix', ' myMatrix = new ColumnMajorDoubleMatrix(numRows, numCols, 0.0);', ' setCol = new SparseDoubleVector(numRows, testVal);', ' testSetColEntry...
[{'reason_category': 'Loop Body', 'usage_line': 1260}, {'reason_category': 'Loop Body', 'usage_line': 1261}, {'reason_category': 'Loop Body', 'usage_line': 1262}]
Class 'ColumnMajorDoubleMatrix' used at line 1260 is defined at line 355 and has a Long-Range dependency. Variable 'numRows' used at line 1260 is defined at line 1199 and has a Long-Range dependency. Variable 'numCols' used at line 1260 is defined at line 1200 and has a Long-Range dependency. Variable 'myMatrix' used a...
{'Loop Body': 3}
{'Class Long-Range': 1, 'Variable Long-Range': 5, 'Variable Short-Range': 7, 'Function Long-Range': 1}
completion_java
DoubleMatrixTester
1,265
1,267
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' myMatrix = new ColumnMajorDoubleMatrix(numRows, numCols, 0.0);', ' setCol = new SparseDoubleVector(numRows, testVal);', ' testSetColEntryCombo(myMatrix, change_i_Entry, change_j_Entry, changeCol, changeVal, setCol);']
[' ', ' // Test setting an entry and then the column on a row major double matrix', ' myMatrix = new RowMajorDoubleMatrix(numRows, numCols, 0.0);', ' setCol = new SparseDoubleVector(numRows, testVal);', ' testSetEntryColCombo...
[{'reason_category': 'Loop Body', 'usage_line': 1265}, {'reason_category': 'Loop Body', 'usage_line': 1266}, {'reason_category': 'Loop Body', 'usage_line': 1267}]
Class 'ColumnMajorDoubleMatrix' used at line 1265 is defined at line 355 and has a Long-Range dependency. Variable 'numRows' used at line 1265 is defined at line 1199 and has a Long-Range dependency. Variable 'numCols' used at line 1265 is defined at line 1200 and has a Long-Range dependency. Variable 'myMatrix' used a...
{'Loop Body': 3}
{'Class Long-Range': 1, 'Variable Long-Range': 3, 'Variable Short-Range': 6, 'Variable Medium-Range': 3, 'Function Long-Range': 1}
completion_java
DoubleMatrixTester
1,275
1,277
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' myMatrix = new RowMajorDoubleMatrix(numRows, numCols, 0.0);', ' setCol = new SparseDoubleVector(numRows, testVal);', ' testSetColEntryCombo(myMatrix, change_i_Entry, change_j_Entry, changeCol, changeVal, setCol);']
[' }', ' }', ' }', ' }', ' }', ' }', ' }', ' }', ' ', ' }', ' ', ' /**', ' * This test runs a test on the following combinations on a wide variety of matrix sizes and indices. ', ' * Here, we test ', ' * setting a column, the...
[{'reason_category': 'Loop Body', 'usage_line': 1275}, {'reason_category': 'Loop Body', 'usage_line': 1276}, {'reason_category': 'Loop Body', 'usage_line': 1277}]
Class 'RowMajorDoubleMatrix' used at line 1275 is defined at line 405 and has a Long-Range dependency. Variable 'numRows' used at line 1275 is defined at line 1199 and has a Long-Range dependency. Variable 'numCols' used at line 1275 is defined at line 1200 and has a Long-Range dependency. Variable 'myMatrix' used at l...
{'Loop Body': 3}
{'Class Long-Range': 1, 'Variable Long-Range': 3, 'Variable Short-Range': 4, 'Variable Medium-Range': 5, 'Function Long-Range': 1}
completion_java
DoubleMatrixTester
1,389
1,389
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' correct_val = row_val.getItem(i_entry);']
[' }', ' // The correct row is the row passed in since the row will never change.', ' correct_row = row_val;', ' ', ' // We set the entry and row here', ' myMatrix.setEntry(j_entry, i_entry, entry_val);', ' myMatrix.setRow(j_row, row_val);', ' // We then compare if it matches wit...
[{'reason_category': 'If Body', 'usage_line': 1389}]
Variable 'row_val' used at line 1389 is defined at line 1375 and has a Medium-Range dependency. Variable 'i_entry' used at line 1389 is defined at line 1375 and has a Medium-Range dependency. Variable 'correct_val' used at line 1389 is defined at line 1384 and has a Short-Range dependency.
{'If Body': 1}
{'Variable Medium-Range': 2, 'Variable Short-Range': 1}
completion_java
DoubleMatrixTester
1,392
1,392
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' correct_row = row_val;']
[' ', ' // We set the entry and row here', ' myMatrix.setEntry(j_entry, i_entry, entry_val);', ' myMatrix.setRow(j_row, row_val);', ' // We then compare if it matches with what was expected.', ' testGetRow(myMatrix, j_row, correct_row);', ' testGetEntry(myMatrix, i_entry, j_entry, cor...
[]
Variable 'row_val' used at line 1392 is defined at line 1375 and has a Medium-Range dependency. Variable 'correct_row' used at line 1392 is defined at line 1377 and has a Medium-Range dependency.
{}
{'Variable Medium-Range': 2}
completion_java
DoubleMatrixTester
1,395
1,396
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' myMatrix.setEntry(j_entry, i_entry, entry_val);', ' myMatrix.setRow(j_row, row_val);']
[' // We then compare if it matches with what was expected.', ' testGetRow(myMatrix, j_row, correct_row);', ' testGetEntry(myMatrix, i_entry, j_entry, correct_val);', ' } catch (OutOfBoundsException e) {', ' fail(e.getMessage());', ' }', ' }', ' ', ' /**', ' * Here, we test first setting ...
[]
Variable 'myMatrix' used at line 1395 is defined at line 1375 and has a Medium-Range dependency. Variable 'j_entry' used at line 1395 is defined at line 1375 and has a Medium-Range dependency. Variable 'i_entry' used at line 1395 is defined at line 1375 and has a Medium-Range dependency. Variable 'entry_val' used at li...
{}
{'Variable Medium-Range': 7}
completion_java
DoubleMatrixTester
1,427
1,428
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' myMatrix.setRow(j_row, row_val);', ' myMatrix.setEntry(j_entry, i_entry, entry_val);']
[' ', ' // Note though that if the entry we set resides on the row, then that will ', ' // change the value contained in the row. We change the correct_row to reflect such.', ' if (j_entry == j_row) {', ' correct_row.setItem(i_entry, entry_val);', ' }', ' ', ' // Now, we test ...
[]
Variable 'myMatrix' used at line 1427 is defined at line 1416 and has a Medium-Range dependency. Variable 'j_row' used at line 1427 is defined at line 1416 and has a Medium-Range dependency. Variable 'row_val' used at line 1427 is defined at line 1416 and has a Medium-Range dependency. Variable 'myMatrix' used at line ...
{}
{'Variable Medium-Range': 7}
completion_java
DoubleMatrixTester
1,433
1,433
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' correct_row.setItem(i_entry, entry_val);']
[' }', ' ', ' // Now, we test that the values are indeed correct.', ' testGetRow(myMatrix, j_row, row_val);', ' testGetEntry(myMatrix, i_entry, j_entry, correct_val);', ' } catch (OutOfBoundsException e) {', ' fail("setEntry setRow combo Failed: Encountered Out of Bounds Exception");', ...
[{'reason_category': 'If Body', 'usage_line': 1433}]
Variable 'correct_row' used at line 1433 is defined at line 1424 and has a Short-Range dependency. Variable 'i_entry' used at line 1433 is defined at line 1416 and has a Medium-Range dependency. Variable 'entry_val' used at line 1433 is defined at line 1416 and has a Medium-Range dependency.
{'If Body': 1}
{'Variable Short-Range': 1, 'Variable Medium-Range': 2}
completion_java
DoubleMatrixTester
1,437
1,438
['import junit.framework.TestCase;', 'import java.util.Random;', 'import java.util.*;', '', 'interface ISparseArray<T> extends Iterable<IIndexedData<T>> {', ' /**', ' * Add element to the array at position.', ' * ', ' * @param position position in the array', ' * @param element data to place in th...
[' testGetRow(myMatrix, j_row, row_val);', ' testGetEntry(myMatrix, i_entry, j_entry, correct_val);']
[' } catch (OutOfBoundsException e) {', ' fail("setEntry setRow combo Failed: Encountered Out of Bounds Exception");', ' }', ' }', ' ', ' /**', ' * Here, we test first setting an entry in the matrix, then setting a column within the matrix. ', ' * We check that the column is correct as well as the en...
[]
Function 'testGetRow' used at line 1437 is defined at line 1604 and has a Long-Range dependency. Variable 'myMatrix' used at line 1437 is defined at line 1416 and has a Medium-Range dependency. Variable 'j_row' used at line 1437 is defined at line 1416 and has a Medium-Range dependency. Variable 'row_val' used at line ...
{}
{'Function Long-Range': 2, 'Variable Medium-Range': 7}
completion_java
MTreeTester
211
211
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' if (myList.size () == maxCount && distance < large) {']
[' ', ' int badIndex = 0;', ' double maxDist = 0.0;', ' for (int i = 0; i < myList.size (); i++) {', ' if (myList.get (i).distance > maxDist) {', ' maxDist = myList.get (i).distance;', ' badIndex = i;', ' }', ' }', ' ', ' myList.remove (badIndex);', ' ...
[{'reason_category': 'If Condition', 'usage_line': 211}]
Global_Variable 'myList' used at line 211 is defined at line 186 and has a Medium-Range dependency. Global_Variable 'maxCount' used at line 211 is defined at line 192 and has a Medium-Range dependency. Variable 'distance' used at line 211 is defined at line 208 and has a Short-Range dependency. Global_Variable 'large' ...
{'If Condition': 1}
{'Global_Variable Medium-Range': 3, 'Variable Short-Range': 1}
completion_java
MTreeTester
211
223
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' if (myList.size () == maxCount && distance < large) {', ' ', ' int badIndex = 0;', ' double maxDist = 0.0;', ' for (int i = 0; i < myList.size (); i++) {', ' if (myList.get (i).distance > maxDist) {', ' maxDist = myList.get (i).distance;', ' badIndex = i;', ' }...
[' ', ' // see if there is room', ' if (myList.size () < maxCount) {', ' ', ' // add it ', ' Wrapper newOne = new Wrapper ();', ' newOne.myData = new DataWrapper <PointInMetricSpace, DataType> (key, data);', ' newOne.distance = distance;', ' myList.add (newOne); ', ' }', '...
[{'reason_category': 'If Condition', 'usage_line': 211}, {'reason_category': 'If Body', 'usage_line': 212}, {'reason_category': 'If Body', 'usage_line': 213}, {'reason_category': 'If Body', 'usage_line': 214}, {'reason_category': 'If Body', 'usage_line': 215}, {'reason_category': 'Define Stop Criteria', 'usage_line': 2...
Global_Variable 'myList' used at line 211 is defined at line 186 and has a Medium-Range dependency. Global_Variable 'maxCount' used at line 211 is defined at line 192 and has a Medium-Range dependency. Variable 'distance' used at line 211 is defined at line 208 and has a Short-Range dependency. Global_Variable 'large' ...
{'If Condition': 2, 'If Body': 13, 'Define Stop Criteria': 1, 'Loop Body': 4}
{'Global_Variable Medium-Range': 5, 'Variable Short-Range': 11, 'Global_Variable Long-Range': 2}
completion_java
MTreeTester
216
216
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' if (myList.get (i).distance > maxDist) {']
[' maxDist = myList.get (i).distance;', ' badIndex = i;', ' }', ' }', ' ', ' myList.remove (badIndex);', ' }', ' ', ' // see if there is room', ' if (myList.size () < maxCount) {', ' ', ' // add it ', ' Wrapper newOne = new Wrapper ();', ' newOne....
[{'reason_category': 'If Condition', 'usage_line': 216}, {'reason_category': 'If Body', 'usage_line': 216}, {'reason_category': 'Loop Body', 'usage_line': 216}]
Global_Variable 'myList' used at line 216 is defined at line 186 and has a Medium-Range dependency. Variable 'i' used at line 216 is defined at line 215 and has a Short-Range dependency. Variable 'distance' used at line 216 is defined at line 208 and has a Short-Range dependency. Variable 'maxDist' used at line 216 is ...
{'If Condition': 1, 'If Body': 1, 'Loop Body': 1}
{'Global_Variable Medium-Range': 1, 'Variable Short-Range': 3}
completion_java
MTreeTester
217
218
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' maxDist = myList.get (i).distance;', ' badIndex = i;']
[' }', ' }', ' ', ' myList.remove (badIndex);', ' }', ' ', ' // see if there is room', ' if (myList.size () < maxCount) {', ' ', ' // add it ', ' Wrapper newOne = new Wrapper ();', ' newOne.myData = new DataWrapper <PointInMetricSpace, DataType> (key, data);', ' ...
[{'reason_category': 'If Body', 'usage_line': 217}, {'reason_category': 'Loop Body', 'usage_line': 217}, {'reason_category': 'If Body', 'usage_line': 218}, {'reason_category': 'Loop Body', 'usage_line': 218}]
Global_Variable 'myList' used at line 217 is defined at line 186 and has a Long-Range dependency. Variable 'i' used at line 217 is defined at line 215 and has a Short-Range dependency. Variable 'distance' used at line 217 is defined at line 208 and has a Short-Range dependency. Variable 'maxDist' used at line 217 is de...
{'If Body': 2, 'Loop Body': 2}
{'Global_Variable Long-Range': 1, 'Variable Short-Range': 5}
completion_java
MTreeTester
222
222
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' myList.remove (badIndex);']
[' }', ' ', ' // see if there is room', ' if (myList.size () < maxCount) {', ' ', ' // add it ', ' Wrapper newOne = new Wrapper ();', ' newOne.myData = new DataWrapper <PointInMetricSpace, DataType> (key, data);', ' newOne.distance = distance;', ' myList.add (newOne); ', '...
[{'reason_category': 'If Body', 'usage_line': 222}]
Global_Variable 'myList' used at line 222 is defined at line 186 and has a Long-Range dependency. Variable 'badIndex' used at line 222 is defined at line 213 and has a Short-Range dependency.
{'If Body': 1}
{'Global_Variable Long-Range': 1, 'Variable Short-Range': 1}
completion_java
MTreeTester
226
226
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' if (myList.size () < maxCount) {']
[' ', ' // add it ', ' Wrapper newOne = new Wrapper ();', ' newOne.myData = new DataWrapper <PointInMetricSpace, DataType> (key, data);', ' newOne.distance = distance;', ' myList.add (newOne); ', ' }', ' ', ' // if we are full, reset the max distance', ' if (myList.size ()...
[{'reason_category': 'If Condition', 'usage_line': 226}]
Global_Variable 'myList' used at line 226 is defined at line 186 and has a Long-Range dependency. Global_Variable 'maxCount' used at line 226 is defined at line 192 and has a Long-Range dependency.
{'If Condition': 1}
{'Global_Variable Long-Range': 2}
completion_java
MTreeTester
231
232
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' newOne.distance = distance;', ' myList.add (newOne); ']
[' }', ' ', ' // if we are full, reset the max distance', ' if (myList.size () == maxCount) {', ' large = 0.0;', ' for (int i = 0; i < myList.size (); i++) {', ' if (myList.get (i).distance > large) {', ' large = myList.get (i).distance;', ' }', ' }', ' }', ' ', '...
[{'reason_category': 'If Body', 'usage_line': 231}, {'reason_category': 'If Body', 'usage_line': 232}]
Variable 'distance' used at line 231 is defined at line 208 and has a Medium-Range dependency. Variable 'newOne' used at line 231 is defined at line 229 and has a Short-Range dependency. Global_Variable 'myList' used at line 232 is defined at line 186 and has a Long-Range dependency. Variable 'newOne' used at line 232 ...
{'If Body': 2}
{'Variable Medium-Range': 1, 'Variable Short-Range': 2, 'Global_Variable Long-Range': 1}
completion_java
MTreeTester
236
243
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' if (myList.size () == maxCount) {', ' large = 0.0;', ' for (int i = 0; i < myList.size (); i++) {', ' if (myList.get (i).distance > large) {', ' large = myList.get (i).distance;', ' }', ' }', ' }']
[' ', ' }', ' ', ' // extracts the contents of the queue', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> done () {', ' ', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> returnVal = new ArrayList <DataWrapper <PointInMetricSpace, DataType>> ();', ' for (int i = 0; i < myList.size (); i...
[{'reason_category': 'If Condition', 'usage_line': 236}, {'reason_category': 'If Body', 'usage_line': 237}, {'reason_category': 'If Body', 'usage_line': 238}, {'reason_category': 'Define Stop Criteria', 'usage_line': 238}, {'reason_category': 'If Body', 'usage_line': 239}, {'reason_category': 'Loop Body', 'usage_line':...
Global_Variable 'myList' used at line 236 is defined at line 186 and has a Long-Range dependency. Global_Variable 'maxCount' used at line 236 is defined at line 192 and has a Long-Range dependency. Global_Variable 'large' used at line 237 is defined at line 189 and has a Long-Range dependency. Variable 'i' used at line...
{'If Condition': 2, 'If Body': 7, 'Define Stop Criteria': 1, 'Loop Body': 4}
{'Global_Variable Long-Range': 6, 'Variable Short-Range': 3, 'Variable Long-Range': 2, 'Global_Variable Short-Range': 2}
completion_java
MTreeTester
239
241
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' if (myList.get (i).distance > large) {', ' large = myList.get (i).distance;', ' }']
[' }', ' }', ' ', ' }', ' ', ' // extracts the contents of the queue', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> done () {', ' ', ' ArrayList <DataWrapper <PointInMetricSpace, DataType>> returnVal = new ArrayList <DataWrapper <PointInMetricSpace, DataType>> ();', ' for (int i = 0; i...
[{'reason_category': 'If Body', 'usage_line': 239}, {'reason_category': 'Loop Body', 'usage_line': 239}, {'reason_category': 'If Condition', 'usage_line': 239}, {'reason_category': 'Loop Body', 'usage_line': 240}, {'reason_category': 'If Body', 'usage_line': 240}, {'reason_category': 'Loop Body', 'usage_line': 241}, {'...
Global_Variable 'myList' used at line 239 is defined at line 186 and has a Long-Range dependency. Variable 'i' used at line 239 is defined at line 238 and has a Short-Range dependency. Variable 'distance' used at line 239 is defined at line 208 and has a Long-Range dependency. Global_Variable 'large' used at line 239 i...
{'If Body': 3, 'Loop Body': 3, 'If Condition': 1}
{'Global_Variable Long-Range': 2, 'Variable Short-Range': 2, 'Variable Long-Range': 2, 'Global_Variable Short-Range': 2}
completion_java
MTreeTester
252
252
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' returnVal.add (myList.get (i).myData); ']
[' }', ' ', ' return returnVal;', ' }', ' ', '}', '', '// this is a sphere in a particular metric space', 'class SphereABCD <PointInMetricSpace extends IPointInMetricSpace <PointInMetricSpace>> implements', ' IObjectInMetricSpaceABCD <PointInMetricSpace> {', '', ' // the center of the sphere and its radius...
[{'reason_category': 'Loop Body', 'usage_line': 252}]
Variable 'returnVal' used at line 252 is defined at line 250 and has a Short-Range dependency. Global_Variable 'myList' used at line 252 is defined at line 186 and has a Long-Range dependency. Variable 'i' used at line 252 is defined at line 251 and has a Short-Range dependency.
{'Loop Body': 1}
{'Variable Short-Range': 2, 'Global_Variable Long-Range': 1}
completion_java
MTreeTester
279
280
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' if (dist > radius)', ' radius = dist;']
[' }', ' ', ' // check to see if a sphere intersects another sphere', ' public boolean intersects (SphereABCD <PointInMetricSpace> me) {', ' return (me.center.getDistance (center) <= me.radius + radius);', ' }', ' ', ' // check to see if the sphere contains a point', ' public boolean contains (PointInMetricS...
[{'reason_category': 'If Condition', 'usage_line': 279}, {'reason_category': 'If Body', 'usage_line': 280}]
Variable 'dist' used at line 279 is defined at line 278 and has a Short-Range dependency. Global_Variable 'radius' used at line 279 is defined at line 266 and has a Medium-Range dependency. Variable 'dist' used at line 280 is defined at line 278 and has a Short-Range dependency. Global_Variable 'radius' used at line 28...
{'If Condition': 1, 'If Body': 1}
{'Variable Short-Range': 2, 'Global_Variable Medium-Range': 2}
completion_java
MTreeTester
285
285
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' return (me.center.getDistance (center) <= me.radius + radius);']
[' }', ' ', ' // check to see if the sphere contains a point', ' public boolean contains (PointInMetricSpace checkMe) {', ' return (checkMe.getDistance (center) <= radius);', ' }', ' ', ' public PointInMetricSpace getPointInInterior () {', ' return center; ', ' }', ' ', ' public double maxDistanceTo (Po...
[]
Global_Variable 'center' used at line 285 is defined at line 265 and has a Medium-Range dependency. Variable 'me' used at line 285 is defined at line 284 and has a Short-Range dependency. Global_Variable 'radius' used at line 285 is defined at line 266 and has a Medium-Range dependency.
{}
{'Global_Variable Medium-Range': 2, 'Variable Short-Range': 1}
completion_java
MTreeTester
290
290
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' return (checkMe.getDistance (center) <= radius);']
[' }', ' ', ' public PointInMetricSpace getPointInInterior () {', ' return center; ', ' }', ' ', ' public double maxDistanceTo (PointInMetricSpace checkMe) {', ' return radius + checkMe.getDistance (center); ', ' }', '}', '', '', '', 'class OneDimPoint implements IPointInMetricSpace <OneDimPoint> {', ' ', ...
[]
Variable 'checkMe' used at line 290 is defined at line 289 and has a Short-Range dependency. Global_Variable 'center' used at line 290 is defined at line 265 and has a Medium-Range dependency. Global_Variable 'radius' used at line 290 is defined at line 266 and has a Medium-Range dependency.
{}
{'Variable Short-Range': 1, 'Global_Variable Medium-Range': 2}
completion_java
MTreeTester
298
298
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' return radius + checkMe.getDistance (center); ']
[' }', '}', '', '', '', 'class OneDimPoint implements IPointInMetricSpace <OneDimPoint> {', ' ', ' // this is the actual double', ' Double value;', ' ', ' // construct this out of a double value', ' public OneDimPoint (double makeFromMe) {', ' value = new Double (makeFromMe);', ' }', ' ', ' // get the dista...
[]
Global_Variable 'radius' used at line 298 is defined at line 266 and has a Long-Range dependency. Variable 'checkMe' used at line 298 is defined at line 297 and has a Short-Range dependency. Global_Variable 'center' used at line 298 is defined at line 265 and has a Long-Range dependency.
{}
{'Global_Variable Long-Range': 2, 'Variable Short-Range': 1}
completion_java
MTreeTester
316
319
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' if (value > toMe.value)', ' return value - toMe.value;', ' else', ' return toMe.value - value;']
[' }', ' ', '}', '', 'class MultiDimPoint implements IPointInMetricSpace <MultiDimPoint> {', ' ', ' // this is the point in a multidimensional space', ' IDoubleVector me;', ' ', ' // make this out of an IDoubleVector', ' public MultiDimPoint (IDoubleVector useMe) {', ' me = useMe;', ' }', ' ', ' // get the...
[{'reason_category': 'If Condition', 'usage_line': 316}, {'reason_category': 'If Body', 'usage_line': 317}, {'reason_category': 'Else Reasoning', 'usage_line': 318}, {'reason_category': 'Else Reasoning', 'usage_line': 319}]
Global_Variable 'value' used at line 316 is defined at line 307 and has a Short-Range dependency. Variable 'toMe' used at line 316 is defined at line 315 and has a Short-Range dependency. Global_Variable 'value' used at line 317 is defined at line 307 and has a Short-Range dependency. Variable 'toMe' used at line 317 i...
{'If Condition': 1, 'If Body': 1, 'Else Reasoning': 2}
{'Global_Variable Short-Range': 2, 'Variable Short-Range': 3, 'Global_Variable Medium-Range': 1}
completion_java
MTreeTester
338
342
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' for (int i = 0; i < me.getLength (); i++) {', ' double diff = me.getItem (i) - toMe.me.getItem (i);', ' diff *= diff;', ' distance += diff;', ' }']
[' } catch (OutOfBoundsException e) {', ' throw new IndexOutOfBoundsException ("Can\'t compare two MultiDimPoint objects with different dimensionality!"); ', ' }', ' return Math.sqrt(distance);', ' }', ' ', '}', '// this is a leaf node', 'class LeafMTreeNodeABCD <PointInMetricSpace extends IPointInMet...
[{'reason_category': 'Define Stop Criteria', 'usage_line': 338}, {'reason_category': 'Loop Body', 'usage_line': 339}, {'reason_category': 'Loop Body', 'usage_line': 340}, {'reason_category': 'Loop Body', 'usage_line': 341}, {'reason_category': 'Loop Body', 'usage_line': 342}]
Variable 'i' used at line 338 is defined at line 338 and has a Short-Range dependency. Global_Variable 'me' used at line 338 is defined at line 327 and has a Medium-Range dependency. Global_Variable 'me' used at line 339 is defined at line 327 and has a Medium-Range dependency. Variable 'i' used at line 339 is defined ...
{'Define Stop Criteria': 1, 'Loop Body': 4}
{'Variable Short-Range': 5, 'Global_Variable Medium-Range': 2}
completion_java
MTreeTester
346
346
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' return Math.sqrt(distance);']
[' }', ' ', '}', '// this is a leaf node', 'class LeafMTreeNodeABCD <PointInMetricSpace extends IPointInMetricSpace <PointInMetricSpace>, DataType> implements ', ' IMTreeNodeABCD <PointInMetricSpace, DataType> {', ' ', ' // this holds all of the data in the leaf node', ' private IMetricDataListABCD <PointInMetricS...
[]
Variable 'distance' used at line 346 is defined at line 336 and has a Short-Range dependency.
{}
{'Variable Short-Range': 1}
completion_java
MTreeTester
378
382
['import junit.framework.TestCase;', 'import java.util.ArrayList;', 'import java.util.Random;', 'import java.util.Collections;', '', '// this is a map from a set of keys of type PointInMetricSpace to a', '// set of data of type DataType', 'interface IMTree <Key extends IPointInMetricSpace <Key>, Data> {', ' ', ' // in...
[' if (myData.size () > getMaxSize ()) {', ' IMetricDataListABCD <PointInMetricSpace, PointABCD <PointInMetricSpace>, DataType> newOne = myData.splitInTwo ();', ' LeafMTreeNodeABCD <PointInMetricSpace, DataType> returnVal = new LeafMTreeNodeABCD <PointInMetricSpace, DataType> (newOne);', ' return r...
[' ', ' // otherwise, we return a null to indcate that a split did not occur', ' return null;', ' }', ' ', ' public void findKClosest (PointInMetricSpace query, PQueueABCD <PointInMetricSpace, DataType> myQ) {', ' for (int i = 0; i < myData.size (); i++) {', ' SphereABCD <PointInMetricSpace> mySpher...
[{'reason_category': 'If Condition', 'usage_line': 378}, {'reason_category': 'If Body', 'usage_line': 379}, {'reason_category': 'If Body', 'usage_line': 380}, {'reason_category': 'If Body', 'usage_line': 381}, {'reason_category': 'If Body', 'usage_line': 382}]
Global_Variable 'myData' used at line 378 is defined at line 355 and has a Medium-Range dependency. Function 'getMaxSize' used at line 378 is defined at line 423 and has a Long-Range dependency. Class 'PointABCD' used at line 379 is defined at line 157 and has a Long-Range dependency. Global_Variable 'myData' used at l...
{'If Condition': 1, 'If Body': 4}
{'Global_Variable Medium-Range': 2, 'Function Long-Range': 1, 'Class Long-Range': 1, 'Class Medium-Range': 1, 'Variable Short-Range': 2}