[geos-devel] Current project status

Norman Vine nhv at cape.com
Sun Nov 24 23:53:51 EST 2002


FYI

To days CVS code with following classes inlined 
Coordinate, CoordinateList, Envelope, 
RobustCGAlgorithms, RobustLineIntersector

compiled with 
-O3 -fomit-frame-pointer

and tweak below

(PIII 733)

 Pts: 1000  Executed in     20 ms.
 Pts: 2000  Executed in     40 ms.
 Pts: 4000  Executed in     70 ms.
 Pts: 8000  Executed in    160 ms.
 Pts: 16000  Executed in    351 ms.
 Pts: 32000  Executed in    661 ms.
 Pts: 64000  Executed in   1302 ms.
 Pts: 128000  Executed in   2593 ms.
 Pts: 256000  Executed in   5267 ms.

Note Yury reported
 n Pts: 256000  Executed in   7120 ms.
on a (P4-2.53):

Norman 

// below I am assuming this means 
//  "is on line segment"  between getAt(i) and getAt(i-1)

bool RobustCGAlgorithms::isOnLine(Coordinate p,CoordinateList pt) {
 for(int i=1;i<pt.getSize();i++) {
  if( pt.inRange(p,i-1,i) ) {
   lineIntersector->computeIntersection(p,pt.getAt(i-1),pt.getAt(i));
   if (lineIntersector->hasIntersection()) {
    return true;
   }
  }
 }
 return false;
}


class CoordinateList 

public

 bool inXrange( double x, int idx1, int idx2) {
  if( x >= (*vect)[idx1].x )
   return x <= (*vect)[idx2].x;
  else if( x <= (*vect)[idx1].x )
   return x >= (*vect)[idx2].x;
  return false;
 }

 bool inYrange( double y, int idx1, int idx2) {
  if( y >= (*vect)[idx1].y )
   return y <= (*vect)[idx2].y;
  else if( y <= (*vect)[idx1].y )
   return y >= (*vect)[idx2].y;
  return false;
 }
 
 bool inRange( Coordinate &pt, int idx1, int idx2) {
  return( inXrange(pt.x,idx1,idx2) && inYrange(pt.y,idx1,idx2) );
 }




More information about the geos-devel mailing list