I was poking around in the spatial pooler and noticed that this function really only really needs to be called once per column (per program lifespan).
The only reason to re-call it would be if the column dimensions or inhibition radius changed, which should not happen after construction.
_getColumnNeighborhood is called once per column when updating boost factors, during inhibition, and when updating duty cycles.
Would it not be better to calculate the neighborhoods on SP construction and keep it around as a lookup? We’d take a memory hit, but it might be worth it.