Skip to content

Algorithmic complexity of healpix_rangesearch() is way too high #104

@mreineck

Description

@mreineck

I just tried to run this simple cone search:

int *ind = NULL;
int npix = healpix_rangesearch_radec_simple(1.5, 0., 1.5, 128, &ind);

When compiling the C library with "-O2", this computation took 40 seconds on my laptop, which is way off the scale; expected run times should be below a millisecond.

From looking at the sources, I fear that the run time of healpix_rangesearch is not only scaling with the number of returned pixels, but actually with its square (this is caused by the calls to ll_contains, which have linear complexity by themselves). This won't do for any application where the cone search returns more than a handful of pixels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions