@@ -62,15 +62,15 @@ is_leaf(n::Node) = false
62
62
63
63
_zero (:: Type{String} ) = " "
64
64
_zero (x:: Any ) = zero (x)
65
- convert (:: Type{Node{S, T}} , lf:: Leaf{T} ) where {S, T} = Node (0 , _zero (S), lf, Leaf (lf. features))
66
- convert (:: Type{Root{S, T}} , node:: LeafOrNode{S, T} ) where {S, T} = Root {S, T} (node, 0 , Float64[])
67
- convert (:: Type{LeafOrNode{S, T}} , tree:: Root{S, T} ) where {S, T} = tree. node
68
- promote_rule (:: Type{Node{S, T}} , :: Type{Leaf{T}} ) where {S, T} = Node{S, T}
69
- promote_rule (:: Type{Leaf{T}} , :: Type{Node{S, T}} ) where {S, T} = Node{S, T}
70
- promote_rule (:: Type{Root{S, T}} , :: Type{Leaf{T}} ) where {S, T} = Root{S, T}
71
- promote_rule (:: Type{Leaf{T}} , :: Type{Root{S, T}} ) where {S, T} = Root{S, T}
72
- promote_rule (:: Type{Root{S, T}} , :: Type{Node{S, T}} ) where {S, T} = Root{S, T}
73
- promote_rule (:: Type{Node{S, T}} , :: Type{Root{S, T}} ) where {S, T} = Root{S, T}
65
+ convert (:: Type{Node{S, T, N }} , lf:: Leaf{T, N } ) where {S, T, N } = Node (0 , _zero (S), lf, Leaf (lf. features))
66
+ convert (:: Type{Root{S, T, N }} , node:: LeafOrNode{S, T, N } ) where {S, T, N } = Root {S, T, N } (node, 0 , Float64[])
67
+ convert (:: Type{LeafOrNode{S, T, N }} , tree:: Root{S, T, N } ) where {S, T, N } = tree. node
68
+ promote_rule (:: Type{Node{S, T, N }} , :: Type{Leaf{T, N }} ) where {S, T, N } = Node{S, T, N }
69
+ promote_rule (:: Type{Leaf{T, N }} , :: Type{Node{S, T, N }} ) where {S, T, N } = Node{S, T, N }
70
+ promote_rule (:: Type{Root{S, T, N }} , :: Type{Leaf{T}} ) where {S, T, N } = Root{S, T, N }
71
+ promote_rule (:: Type{Leaf{T, N }} , :: Type{Root{S, T, N }} ) where {S, T, N } = Root{S, T, N }
72
+ promote_rule (:: Type{Root{S, T, N }} , :: Type{Node{S, T, N }} ) where {S, T, N } = Root{S, T, N }
73
+ promote_rule (:: Type{Node{S, T, N }} , :: Type{Root{S, T, N }} ) where {S, T, N } = Root{S, T}
74
74
75
75
# make a Random Number Generator object
76
76
mk_rng (rng:: Random.AbstractRNG ) = rng
0 commit comments