Last active
August 19, 2019 15:23
-
-
Save michelp/d1a6b0c86a539d9ab4fc63a125df23b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pygraphblas import Type, Monoid, Semiring, binary_op | |
class BF_Tuple3(Type): | |
identity = (float('inf'), # sum of edge lengths | |
UINT64_MAX, # parent of ith vertex | |
UINT64_MAX) # number of edges from s to i | |
@binary_op | |
def min(self, other): | |
... | |
@binary_op | |
def plus(self, other): | |
... | |
min_monoid = Monoid(min, identity) | |
min_plus = Semiring(min_monoid, plus) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment