[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RE : cctbx debian package



On Thu, 26. Jul 19:17, Frédéric-Emmanuel Picca wrote:
> Is is clear ?
Yes it's clear now, but I don't think it can be done.
Problem is we can't remove that ann source code because this
"self_include" code is generated from that source. Problem is that the code is
generate with an older ann src. But I did more research on that.
Basically what they are doing is taking that ann sources looping with python
through it and changing all ANN includes for instance:
#include <ANN/ANN.h>
to
#include <ANNSELF_INCLUDE/ANN.h>
Then they are setting the namespace like this:
namespace annself_include {
ALL source code here.....
} //namespace annself_include
I was playing with diff to find what this is for and if I haven't overlooked
anything. The only other thing they do is to change a constant:
const ANNbool   ANN_ALLOW_SELF_MATCH    = ANNfalse;
to
const ANNbool   ANN_ALLOW_SELF_MATCH    = ANNtrue;
in ANN.h.

So I checked in my systems /usr/include/ANN. And I saw that this constant is set
to true by default in the current version (from 2010).

The following is the comment in the header:
//In some applications, the nearest neighbor of a point is not
//allowed to be the point itself. This occurs, for example, when
//computing all nearest neighbors in a set.  By setting the
//parameter ANN_ALLOW_SELF_MATCH to ANNfalse, the nearest neighbor
//is the closest point whose distance from the query point is
//strictly positive.

What they do now in their ann_adaptor is to define 2 identical classes one with
ANN namespace and the other one with annself_include namespace. 
I guess this way they can "find the nearest neighbor of a point" in two ways.

OK now the problem for us is that we can't use systems ANN since it uses
ANNtrue. This way we'd destroy upstreams logic. We can't push the changes back
into ANN upstream since ann_adaptor depends on scitbx. So we'd have a dependency
loop.

CBFLIB is also tricky. The code included in cctbx is much newer than the debian
package.

regards
Radi


Reply to: