Created
June 19, 2015 18:18
-
-
Save LeifAndersen/993fa5e320827f8c3654 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
setClass("Node", | |
slots = list(data="character", | |
edges="list")) | |
setClass("Edge", | |
slots = list(weight="numeric", | |
left = "character", | |
right = "character")) | |
setClass("Graph", | |
slots = list(nodes = "list", | |
edges = "list")) | |
#setGeneric("==", | |
# function(e1,e2) standardGeneric("=="), | |
# useAsDefault = .Primitive("==")) | |
setMethod("==", | |
c(e1="Node",e2="Node"), | |
function(e1,e2) { | |
e1@data == e2@data | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment