@@ -16,16 +16,16 @@ nodes, you can evaluate or print a given expression.
1616
1717# Fields
1818
19- - `degree::Int `: Degree of the node. 0 for constants, 1 for
19+ - `degree::Int8 `: Degree of the node. 0 for constants, 1 for
2020 unary operators, 2 for binary operators.
2121- `constant::Bool`: Whether the node is a constant.
2222- `val::T`: Value of the node. If `degree==0`, and `constant==true`,
2323 this is the value of the constant. It has a type specified by the
2424 overall type of the `Node` (e.g., `Float64`).
25- - `feature::Int ` (optional): Index of the feature to use in the
25+ - `feature::Int16 ` (optional): Index of the feature to use in the
2626 case of a feature node. Only used if `degree==0` and `constant==false`.
2727 Only defined if `degree == 0 && constant == false`.
28- - `op::Int `: If `degree==1`, this is the index of the operator
28+ - `op::Int8 `: If `degree==1`, this is the index of the operator
2929 in `operators.unaops`. If `degree==2`, this is the index of the
3030 operator in `operators.binops`. In other words, this is an enum
3131 of the operators, and is dependent on the specific `OperatorEnum`
6262include (" base.jl" )
6363
6464"""
65- Node([::Type{T}]; val=nothing, feature::Int =nothing) where {T}
65+ Node([::Type{T}]; val=nothing, feature::Union{Integer,Nothing} =nothing) where {T}
6666
6767Create a leaf node: either a constant, or a variable.
6868
@@ -112,14 +112,14 @@ function Node(
112112end
113113
114114"""
115- Node(op::Int , l::Node)
115+ Node(op::Integer , l::Node)
116116
117117Apply unary operator `op` (enumerating over the order given) to `Node` `l`
118118"""
119119Node (op:: Integer , l:: Node{T} ) where {T} = Node (1 , false , nothing , 0 , op, l)
120120
121121"""
122- Node(op::Int , l::Node, r::Node)
122+ Node(op::Integer , l::Node, r::Node)
123123
124124Apply binary operator `op` (enumerating over the order given) to `Node`s `l` and `r`
125125"""
138138
139139Create a variable node, using the format `"x1"` to mean feature 1
140140"""
141- Node (var_string:: String ) = Node (; feature= parse (Int , var_string[2 : end ]))
141+ Node (var_string:: String ) = Node (; feature= parse (Int16 , var_string[2 : end ]))
142142
143143"""
144144 Node(var_string::String, variable_names::Array{String, 1})
@@ -258,7 +258,7 @@ Convert an equation to a string.
258258
259259# Keyword Arguments
260260- `bracketed`: (optional) whether to put brackets around the outside.
261- - `f_variable`: (optional) function to convert a variable to a string, of the form `(feature::Int , variable_names)`.
261+ - `f_variable`: (optional) function to convert a variable to a string, of the form `(feature::Int8 , variable_names)`.
262262- `f_constant`: (optional) function to convert a constant to a string, of the form `(val, bracketed::Bool)`
263263- `variable_names::Union{Array{String, 1}, Nothing}=nothing`: (optional) what variables to print for each feature.
264264"""
0 commit comments