use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.
the class FileBufferPerfTest method runAll.
void runAll(final List polys, final double distance) {
// System.out.println("Geom count = " + polys.size() + " distance = "
// + distance);
final Stopwatch sw = new Stopwatch();
for (final Iterator i = polys.iterator(); i.hasNext(); ) {
final Geometry g = (Geometry) i.next();
g.buffer(distance);
System.out.print(".");
}
// System.out.println();
// System.out.println(" Time = " + sw.getTimeString());
}
use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.
the class PreparedPolygonIntersectsPerfTest method test.
public void test(final Geometry g, final List lines) {
// System.out.println("AOI # pts: " + g.getVertexCount() + " # lines: "
// + lines.size() + " # pts in line: " + NUM_LINE_PTS);
final Stopwatch sw = new Stopwatch();
int count = 0;
for (int i = 0; i < MAX_ITER; i++) {
// count = testPrepGeomNotCached(i, g, lines);
count = testPrepGeomCached(i, g, lines);
// count = testOriginal(i, g, lines);
}
// System.out.println("Count of intersections = " + count);
// System.out.println("Finished in " + sw.getTimeString());
}
use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.
the class DDExpressionPerf method runDoubleDouble.
public double runDoubleDouble(final int nIter) {
final Stopwatch sw = new Stopwatch();
for (int i = 0; i < nIter; i++) {
final DD a = new DD(9.0);
final DD factor = new DD(10.0);
final DD aMul = factor.multiply(a);
final DD aDiv = a.divide(factor);
final DD det = a.multiply(a).subtract(aMul.multiply(aDiv));
// System.out.println(aDiv);
// System.out.println(det);
}
sw.stop();
// + sw.getTimeString());
return sw.getTime() / (double) nIter;
}
use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.
the class DDExpressionPerf method runBigDecimal.
public double runBigDecimal(final int nIter) {
final Stopwatch sw = new Stopwatch();
for (int i = 0; i < nIter; i++) {
final BigDecimal a = new BigDecimal(9.0).setScale(20);
final BigDecimal factor = new BigDecimal(10.0).setScale(20);
final BigDecimal aMul = factor.multiply(a);
final BigDecimal aDiv = a.divide(factor, BigDecimal.ROUND_HALF_UP);
final BigDecimal det = a.multiply(a).subtract(aMul.multiply(aDiv));
// System.out.println(aDiv);
// System.out.println(det);
}
sw.stop();
// + sw.getTimeString());
return sw.getTime() / (double) nIter;
}
use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.
the class DDExpressionPerf method runDoubleDoubleSelf.
// *
public double runDoubleDoubleSelf(final int nIter) {
final Stopwatch sw = new Stopwatch();
for (int i = 0; i < nIter; i++) {
final double a = 9.0;
final double factor = 10.0;
final DD c = new DD(9.0);
c.selfMultiply(factor);
final DD b = new DD(9.0);
b.selfDivide(factor);
final DD a2 = new DD(a);
a2.selfMultiply(a);
final DD b2 = new DD(b);
b2.selfMultiply(c);
a2.selfDivide(b2);
final DD det = a2;
// System.out.println(aDiv);
// System.out.println(det);
}
sw.stop();
// + sw.getTimeString());
return sw.getTime() / (double) nIter;
}
Aggregations