MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / setWeights

Function setWeights

applications/test/router/router.C:46–69  ·  view source on GitHub ↗

Given connections between nodes set minimum distance from nodeI

Source from the content-addressed store, hash-verified

44
45// Given connections between nodes set minimum distance from nodeI
46void Foam::router::setWeights
47(
48 const label weight,
49 const label nodeI
50)
51{
52 // Set weight at current node
53 weights_[nodeI] = weight;
54
55 const labelList& myNeighbours = connections_[nodeI];
56
57 forAll(myNeighbours, neighbourI)
58 {
59 if (weights_[myNeighbours[neighbourI]] > weight + 1)
60 {
61 // Distribute weight+1 to neighbours
62 setWeights
63 (
64 weight+1,
65 myNeighbours[neighbourI]
66 );
67 }
68 }
69}
70
71
72// Mark shortest path from endNode to startNode by setting the weights

Callers 1

routeFunction · 0.85

Calls 1

forAllFunction · 0.50

Tested by

no test coverage detected