Skip to content

Improve algorithm in GetEnergyLossesFromReach & GetEnergyLossesInTransit #77

@mdunphy

Description

@mdunphy

Addressing a Problem?

The calculation in GetEnergyLossesFromReach & GetEnergyLossesInTransit is cubic complexity in N=_nMlatHist[p]. First the k loop, then the m loop, and then inside of FunkyEnergyIntegral again a loop over m, yields O(N^3) work

Potential Solution

It should be possible to reduce this to quadratic complexity through using a prefix-sum recurrence to replace the summation in FunkyTemperatureIntegral, which will save a lot of calls to exp()

Additional context

i think #76 needs resolution before working up the prefix sum part.

Contribution

  • I would be willing/able to open a Pull Request to contribute this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions