Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
ec58b6d
1
Parent(s):
0f6ed91
Increase speed by explicitly allocating arrays
Browse files- julia/sr.jl +2 -2
julia/sr.jl
CHANGED
@@ -240,9 +240,9 @@ end
|
|
240 |
function evalTreeArray(tree::Node)::Array{Float32, 1}
|
241 |
if tree.degree == 0
|
242 |
if tree.constant
|
243 |
-
return
|
244 |
else
|
245 |
-
return
|
246 |
end
|
247 |
elseif tree.degree == 1
|
248 |
return unaops[tree.op].(evalTreeArray(tree.l))
|
|
|
240 |
function evalTreeArray(tree::Node)::Array{Float32, 1}
|
241 |
if tree.degree == 0
|
242 |
if tree.constant
|
243 |
+
return fill(tree.val, len)
|
244 |
else
|
245 |
+
return copy(X[:, tree.val])
|
246 |
end
|
247 |
elseif tree.degree == 1
|
248 |
return unaops[tree.op].(evalTreeArray(tree.l))
|