Package com.nr.cg

Examples of com.nr.cg.KDtree.locate()


    int nb;       // number of box containing y
    localflag=false;
    for (i=0;i<M;i++) {
      y.x[0]=myran.doub();
      y.x[1]=myran.doub();
      nb=tree2.locate(y);
//      System.out.printf(nb);
//      System.out.printf(tree2.boxes[nb].lo.x[0] << " %f\n", tree2.boxes[nb].lo.x[1]);
//      System.out.printf(tree2.boxes[nb].hi.x[0] << " %f\n", tree2.boxes[nb].hi.x[1]);
      localflag = localflag || (y.x[0] < tree2.boxes[nb].lo.x[0]);
      localflag = localflag || (y.x[0] > tree2.boxes[nb].hi.x[0]);
View Full Code Here


    // Test locate(int) method
    int n0;
    localflag=false;
    for (i=0;i<M;i++) {
      n0=myran.int32p() % N;
      nb=tree2.locate(n0);
//      System.out.printf(nb);
//      System.out.printf(tree2.boxes[nb].lo.x[0] << " %f\n", tree2.boxes[nb].lo.x[1]);
//      System.out.printf(tree2.boxes[nb].hi.x[0] << " %f\n", tree2.boxes[nb].hi.x[1]);
      localflag = localflag || (kd2[n0].x[0] < tree2.boxes[nb].lo.x[0]);
      localflag = localflag || (kd2[n0].x[0] > tree2.boxes[nb].hi.x[0]);
View Full Code Here

    localflag=false;
    for (i=0;i<M;i++) {
      yy.x[0]=myran.doub();
      yy.x[1]=myran.doub();
      yy.x[2]=myran.doub();
      nb=tree3.locate(yy);
//      System.out.printf(nb);
//      System.out.printf(tree3.boxes[nb].lo.x[0] << " %f\n", tree3.boxes[nb].lo.x[1]
//        << tree3.boxes[nb].lo.x[2]);
//      System.out.printf(tree3.boxes[nb].hi.x[0] << " %f\n", tree3.boxes[nb].hi.x[1]
//        << tree3.boxes[nb].hi.x[2]);
View Full Code Here

    // Test locate(int) method in 3D
    localflag=false;
    for (i=0;i<M;i++) {
      n0=myran.int32p() % N;
      nb=tree3.locate(n0);
//      System.out.printf(nb);
//      System.out.printf(tree3.boxes[nb].lo.x[0] << " %f\n", tree3.boxes[nb].lo.x[1]
//        tree3.boxes[nb].lo.x[2]);
//      System.out.printf(tree3.boxes[nb].hi.x[0] << " %f\n", tree3.boxes[nb].hi.x[1]
//        tree3.boxes[nb].hi.x[2]);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.