Opened 13 years ago
Closed 12 years ago
#123 closed defect (fixed)
Improve voxel list handling
Reported by: | MatthewWhiting | Owned by: | MatthewWhiting |
---|---|---|---|
Priority: | normal | Milestone: | Release-1.2 |
Component: | Code base | Version: | 1.1.13 |
Severity: | normal | Keywords: | |
Cc: |
Description
There are a number of functions that take a vector of Voxels with which to calculate the various parameters of a Detection.
This is quite inefficient, which becomes obvious for large detections (ie. million+ voxels).
A better approach would be to use std::map, where the voxel set is directly accessed via the voxel location.
Change History (5)
comment:1 Changed 13 years ago by
Status: | new → assigned |
---|
comment:2 Changed 13 years ago by
The same comments apply to the Detection::calcIntegFlux(long zdim, std::vector<Voxel> voxelList, FitsHeader? &head) and Detection::calcVelWidths(long zdim, std::vector<Voxel> voxelList, FitsHeader? &head) functions, where the loop code would be structured in the same way.
comment:3 Changed 13 years ago by
Have added a comparison function (operator<) for Voxel in [858]. This will allow Voxels to be used in std::map structures. The comparison is done first by position (looking at z, then y, then x) and then, if those are all equal, by flux.
comment:4 Changed 12 years ago by
Milestone: | → Release-1.1.14 |
---|
Where are we up to with this? Look at the status of things for 1.1.14 - if sufficient, can we close this ticket?
comment:5 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I think this is sufficient for the moment - the functionality that is here has been tested in Selavy, and I don't think anything new is required for now.
Closing.
This is how you would fix Detection::calcFluxes(std::vector<Voxel> voxelList):
Code inside the loop would be something like:
then everything else as it is.