Skip to content

Commit

Permalink
fix a bug in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardWarburton committed May 26, 2013
1 parent 82c94a1 commit 6f08e05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Expand Up @@ -5,3 +5,13 @@ target/
*.jar
*.war
*.ear

# Intellij
*.iml
.idea/

# Eclipse
.classpath
.project
.settings/

Expand Up @@ -18,6 +18,7 @@

import com.google.caliper.Runner;
import com.google.caliper.SimpleBenchmark;
import com.gs.collections.api.tuple.Pair;
import com.gs.collections.impl.list.mutable.primitive.DoubleArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -62,7 +63,7 @@ public double timeImperativeDotProduct(int reps) {
double sum = 0;
for (int j= 0; j < reps; j++) {
sum = 0;
for (int i = 0; i < SIZE; i++) {
for (int i = 0; i < x.length; i++) {
sum += x[i] * y[i];
}
}
Expand All @@ -85,7 +86,7 @@ public double timeGSDotProduct(int reps) {
for (int j= 0; j < reps; j++) {
sum = gsX.asLazy().collect(Double::new)
.zip(gsY.asLazy().collect(Double::new))
.sumOfDouble(pair -> pair.getOne() * pair.getTwo());
.sumOfDouble((Pair<Double, Double> pair) -> pair.getOne() * pair.getTwo());
}
return sum;
}
Expand Down

0 comments on commit 6f08e05

Please sign in to comment.