Add accurate arithmetic for summation, fix order of input particles

This commit is contained in:
Anton Reinhard
2023-09-07 15:15:21 +02:00
parent 0f78053ccf
commit d1666de432
14 changed files with 183 additions and 66 deletions

View File

@ -34,3 +34,26 @@ function test_random_walk(g::DAG, n::Int64)
return reset_graph!(g)
end
function reduce_all!(g::DAG)
reset_graph!(g)
opt = get_operations(g)
while (!isempty(opt.nodeReductions))
push_operation!(g, pop!(opt.nodeReductions))
if (isempty(opt.nodeReductions))
opt = get_operations(g)
end
end
return nothing
end
function reduce_one!(g::DAG)
opt = get_operations(g)
if !isempty(opt.nodeReductions)
push_operation!(g, pop!(opt.nodeReductions))
end
opt = get_operations(g)
return nothing
end