use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.
the class BinTreeCorrectTest method queryGrid.
void queryGrid(final int nGridCells, final double cellSize) {
final Stopwatch sw = new Stopwatch();
sw.start();
int gridSize = (int) Math.sqrt(nGridCells);
gridSize += 1;
final double extent = MAX_EXTENT - MIN_EXTENT;
final double gridInc = extent / gridSize;
for (int i = 0; i < gridSize; i++) {
final double x = MIN_EXTENT + gridInc * i;
final Interval interval = new Interval(x, x + cellSize);
queryTest(interval);
// queryTime(env);
}
// System.out.println("Time = " + sw.getTimeString());
}
use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.
the class IndexTester method testAll.
public IndexResult testAll(final List items) {
final IndexResult result = new IndexResult(this.index.toString());
System.out.print(this.index.toString() + " ");
System.gc();
final Stopwatch sw = new Stopwatch();
sw.start();
loadGrid(items);
final String loadTime = sw.getTimeString();
result.loadMilliseconds = sw.getTime();
System.gc();
sw.start();
// runQueries();
runSelfQuery(items);
final String queryTime = sw.getTimeString();
result.queryMilliseconds = sw.getTime();
// + queryTime);
return result;
}
use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.
the class TestPerfDistanceGeomPair method test.
public void test(final Geometry[] geom) {
final Stopwatch sw = new Stopwatch();
final double dist = 0.0;
final double dist2 = 0.0;
for (int i = 0; i < MAX_ITER; i++) {
// dist = geom[0].distance(geom[1]);
// dist = SortedBoundsFacetDistance.distance(g1, g2);
// dist2 = BranchAndBoundFacetDistance.distance(geom[0], geom[1]);
// if (dist != dist2) System.out.println("distance discrepancy found!");
computeDistanceToAllPoints(geom);
}
if (!this.verbose) {
// System.out.println(sw.getTimeString());
}
if (this.verbose) {
// System.out.println("Finished in " + sw.getTimeString());
// System.out.println(" (Distance = " + dist + ")");
}
}
use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.
the class DelaunayRobustTest method run.
public void run(final int nPts) {
// System.out.println("Base offset: " + BASE_OFFSET);
final List<Point> pts = randomPointsInGrid(nPts, BASE_OFFSET, BASE_OFFSET);
// System.out.println("# pts: " + pts.size());
final Stopwatch sw = new Stopwatch();
final QuadEdgeDelaunayTinBuilder builder = new QuadEdgeDelaunayTinBuilder(GEOMETRY_FACTORY);
builder.insertVertices(pts);
// Geometry g = builder.getEdges(geomFact);
// don't actually form output geometry, to save time and memory
builder.getSubdivision();
// System.out.println(" -- Time: " + sw.getTimeString() + " Mem: "
// + Memory.usedTotalString());
// System.out.println(g);
}
use of com.revolsys.geometry.util.Stopwatch in project com.revolsys.open by revolsys.
the class InCirclePerf method runDDSelf2.
public double runDDSelf2(final int nIter) {
final Stopwatch sw = new Stopwatch();
for (int i = 0; i < nIter; i++) {
TriPredicate.isInCircleDD3(this.pa, this.pb, this.pc, this.pp);
}
sw.stop();
// + sw.getTimeString());
return sw.getTime() / (double) nIter;
}
Aggregations