Return sum of all edges that point to vertex. >>> g = Graph(VertexType=WVertex) >>> g.add(1, [1, 2, 3]) >>> g.add(4, 1, 3) >>> g[1].sum_in(), g[3].sum_in(), g[4].sum_in() (4, 1, 0)
(self)
| 287 | __slots__ = [] |
| 288 | |
| 289 | def sum_in(self): |
| 290 | """Return sum of all edges that point to vertex. |
| 291 | |
| 292 | >>> g = Graph(VertexType=WVertex) |
| 293 | >>> g.add(1, [1, 2, 3]) |
| 294 | >>> g.add(4, 1, 3) |
| 295 | >>> g[1].sum_in(), g[3].sum_in(), g[4].sum_in() |
| 296 | (4, 1, 0) |
| 297 | """ |
| 298 | g, t = self._graph, self._id |
| 299 | sum = 0 |
| 300 | for h in self.in_vertices(): |
| 301 | sum += g[h][t] |
| 302 | return sum |
| 303 | |
| 304 | def sum_out(self): |
| 305 | """Return sum of all edges that leave from vertex. |
nothing calls this directly
no test coverage detected