Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions density/Extractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ else if (!grids[i].getDimension().equals(dimension))
return;
}
features = new Feature[ngrids];
final float[][] vals = new float[numBackground][ngrids];
final double[][] vals = new double[numBackground][ngrids];
int c=0;
for (int i=0; i<numBackground; i++)
vals[c++] = randextract[i].vals;
Expand Down Expand Up @@ -245,7 +245,7 @@ public int compare(Object o1, Object o2) {
int sample=0;
int chosen=0;
long seen=0;
float[] vals = new float[ngrids];
double[] vals = new double[ngrids];
boolean[] hasData = new boolean[ngrids];
for (int r=0; r<nr; r++) {
Utils.reportProgress((r*100)/(double)nr);
Expand All @@ -271,14 +271,14 @@ public int compare(Object o1, Object o2) {
seen++;
if (chosen<n)
randextract[chosen++] =
new Rc(r,c,(float[]) vals.clone());
new Rc(r,c,vals.clone());
else {
long rnd = (seen < Integer.MAX_VALUE) ?
Utils.generator.nextInt((int) seen) :
Utils.generator.nextLong() % seen;
if(rnd < n)
randextract[(int) rnd] =
new Rc(r,c,(float[]) vals.clone());
new Rc(r,c,vals.clone());
}
}
}
Expand Down