Re: [mkgmap-dev] [PATCH v1] quick distance calculation

2009-05-20 Thread Wolfgang v. Hansen
On Wed, 20 May 2009, Mark Burton wrote: Really? In that case you could as well change the metric from Euclidean to something more simple like the Manhattan metric: dist = abs(lat2-lat1) + costab[lat1] * abs(lon2-lon1) where costab is a table lookup for cos(). This will still find a point

Re: [mkgmap-dev] [PATCH v1] quick distance calculation

2009-05-20 Thread Mark Burton
Hi Wolfgang, > > Well, that's a good question. As distance() mostly gets called to > > determine which of a bunch of points is nearest, it probably doesn't > > matter at all that the result is slightly "wrong". > > Really? In that case you could as well change the metric from Euclidean to > som

Re: [mkgmap-dev] [PATCH v1] quick distance calculation

2009-05-19 Thread Wolfgang v. Hansen
On Tue, 19 May 2009, Mark Burton wrote: Well, that's a good question. As distance() mostly gets called to determine which of a bunch of points is nearest, it probably doesn't matter at all that the result is slightly "wrong". Really? In that case you could as well change the metric from Euclid

Re: [mkgmap-dev] [PATCH v1] quick distance calculation

2009-05-19 Thread Mark Burton
Hi Robert, Many thanks for the feedback. > how much difference is tolerable...? > > enabling your diagnostic code, i've observed differences typically in > the range of .25% to .4%, with some exceptions like... > > quickDistance() = 1.4536911305450404 slowDistance() = 1.446011378093334 > (0.5

Re: [mkgmap-dev] [PATCH v1] quick distance calculation

2009-05-19 Thread Robert Joop
On 09-05-16 19:54:31 CEST, Mark Burton wrote: > It is substantially faster and so I believe we should change to using > it as long as it doesn't introduce any issues. > > So please try out this patch and report: > > a - if any breakage is observed how much difference is tolerable...? enabling y

Re: [mkgmap-dev] [PATCH v1] quick distance calculation

2009-05-19 Thread Mark Burton
Clinton, > I've applied and tested this patch: at first glance, it seems OK. I > didn't notice breakage or similar problems. I also did not do any > performance tests, so I cannot say if the compilation time has > improved significantly. I'll do more extensive tests later. Please do, I think you

Re: [mkgmap-dev] [PATCH v1] quick distance calculation

2009-05-19 Thread Clinton Gladstone
On Tue, May 19, 2009 at 12:57 AM, Mark Burton wrote: > > With all the postings to the list in the last 24H or so, it's easy to > miss stuff - so just in case you missed this patch, please give it a go > as I believe it provides a useful performance boost. I've applied and tested this patch: at fi

Re: [mkgmap-dev] [PATCH v1] quick distance calculation

2009-05-18 Thread Mark Burton
With all the postings to the list in the last 24H or so, it's easy to miss stuff - so just in case you missed this patch, please give it a go as I believe it provides a useful performance boost. Thanks, Mark ___ mkgmap-dev mailing list mkgmap-dev@lists