@@ -213,7 +213,7 @@ function deg1_l2_ll0_lr0_eval(
213213 cumulator = Array {T,1} (undef, n)
214214 @maybe_turbo turbo for j in indices ((cX, cumulator), (2 , 1 ))
215215 x_l = op_l (val_ll, cX[feature_lr, j]):: T
216- x = isfinite (x_l) ? op (x_l):: T : T (Inf ) # These will get discovered by _eval_tree_array at end.
216+ x = isfinite (x_l) ? op (x_l):: T : T (Inf )
217217 cumulator[j] = x
218218 end
219219 return (cumulator, true )
@@ -273,6 +273,7 @@ function deg1_l1_ll0_eval(
273273 end
274274end
275275
276+ # op(x, y) for x and y variable/constant
276277function deg2_l0_r0_eval (
277278 tree:: Node{T} ,
278279 cX:: AbstractMatrix{T} ,
@@ -320,6 +321,7 @@ function deg2_l0_r0_eval(
320321 return (cumulator, true )
321322end
322323
324+ # op(x, y) for x variable/constant, y arbitrary
323325function deg2_l0_eval (
324326 tree:: Node{T} ,
325327 cX:: AbstractMatrix{T} ,
@@ -349,6 +351,7 @@ function deg2_l0_eval(
349351 return (cumulator, true )
350352end
351353
354+ # op(x, y) for x arbitrary, y variable/constant
352355function deg2_r0_eval (
353356 tree:: Node{T} ,
354357 cX:: AbstractMatrix{T} ,
@@ -520,9 +523,9 @@ function eval(current_node)
520523function eval_tree_array (
521524 tree:: Node , cX:: AbstractArray , operators:: GenericOperatorEnum ; throw_errors:: Bool = true
522525)
523- ! throw_errors && return _eval_tree_array (tree, cX, operators, Val (false ))
526+ ! throw_errors && return _eval_tree_array_generic (tree, cX, operators, Val (false ))
524527 try
525- return _eval_tree_array (tree, cX, operators, Val (true ))
528+ return _eval_tree_array_generic (tree, cX, operators, Val (true ))
526529 catch e
527530 tree_s = string_tree (tree, operators)
528531 error_msg = " Failed to evaluate tree $(tree_s) ."
@@ -537,7 +540,7 @@ function eval_tree_array(
537540 end
538541end
539542
540- function _eval_tree_array (
543+ function _eval_tree_array_generic (
541544 tree:: Node{T1} ,
542545 cX:: AbstractArray{T2,N} ,
543546 operators:: GenericOperatorEnum ,
@@ -554,13 +557,13 @@ function _eval_tree_array(
554557 end
555558 end
556559 elseif tree. degree == 1
557- return deg1_eval (tree, cX, vals[tree. op], operators, Val (throw_errors))
560+ return deg1_eval_generic (tree, cX, vals[tree. op], operators, Val (throw_errors))
558561 else
559- return deg2_eval (tree, cX, vals[tree. op], operators, Val (throw_errors))
562+ return deg2_eval_generic (tree, cX, vals[tree. op], operators, Val (throw_errors))
560563 end
561564end
562565
563- function deg1_eval (
566+ function deg1_eval_generic (
564567 tree, cX, :: Val{op_idx} , operators:: GenericOperatorEnum , :: Val{throw_errors}
565568) where {op_idx,throw_errors}
566569 left, complete = eval_tree_array (tree. l, cX, operators)
@@ -570,7 +573,7 @@ function deg1_eval(
570573 return op (left), true
571574end
572575
573- function deg2_eval (
576+ function deg2_eval_generic (
574577 tree, cX, :: Val{op_idx} , operators:: GenericOperatorEnum , :: Val{throw_errors}
575578) where {op_idx,throw_errors}
576579 left, complete = eval_tree_array (tree. l, cX, operators)
0 commit comments