Skip to content

Add MFD implementation - #237

Open
wkearn wants to merge 2 commits into
TopoToolbox:mainfrom
wkearn:mfd
Open

Add MFD implementation#237
wkearn wants to merge 2 commits into
TopoToolbox:mainfrom
wkearn:mfd

Conversation

@wkearn

@wkearn wkearn commented Aug 6, 2026

Copy link
Copy Markdown
Member

Resolves #236

A new file, src/mfd.c, contains the two flow routing interface functions for multiple flow direction routing. These are

  • flow_routing_mfd_directions
  • flow_routing_mfd_weights

As in Dinf, the former computes a bitset of directions and also sums the gradients along the way to normalize the weights later. Once we know how many edges we have, we can allocate and compute the weights with flow_routing_mfd_weights.

These tests are copied from the Dinf tests, with appropriate modifications to the flow routing subroutine.

The only difference in the tests is that the sum of edge weights is permitted to be numerically different from 1.0. Some of the test case sizes were also changed for debugging purposes and have been left as they were.

I may hold off on merging this for a little bit because I have not successfully implemented the MATLAB MFD flat resolution algorithm yet, and I want to make sure that we have all the information we need for that.

wkearn added 2 commits August 6, 2026 16:40
Resolves TopoToolbox#236

A new file, src/mfd.c, contains the two flow routing interface
functions for multiple flow direction routing. These are

- flow_routing_mfd_directions
- flow_routing_mfd_weights

As in Dinf, the former computes a bitset of directions and also sums
the gradients along the way to normalize the weights later. Once we
know how many edges we have, we can allocate and compute the weights
with flow_routing_mfd_weights.

These tests are copied from the Dinf tests, with appropriate
modifications to the flow routing subroutine.

The only difference in the tests is that the sum of edge weights is
permitted to be numerically different from 1.0. Some of the test case
sizes were also changed for debugging purposes and have been left as
they were.

Signed-off-by: William Kearney <william.kearney@uni-potsdam.de>
Signed-off-by: William Kearney <william.kearney@uni-potsdam.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple flow directions

1 participant