Skip to content
Snippets Groups Projects
Commit 9785a424 authored by Philipp Suffa's avatar Philipp Suffa
Browse files

Merge branch 'GeneralCumulantSimplification' into 'master'

Generalise Cumulant simplificaiton

See merge request pycodegen/lbmpy!150
parents 358eead3 0809e2ea
1 merge request!150Generalise Cumulant simplificaiton
Pipeline #54866 passed with stages
in 29 minutes and 31 seconds
......@@ -16,11 +16,8 @@ def insert_logs(ac, **kwargs):
def insert_log_products(ac, **kwargs):
def callback(asm):
rhs = asm.rhs
if isinstance(rhs, sp.log):
if rhs.find(sp.log):
return True
if isinstance(rhs, sp.Mul):
if any(isinstance(arg, sp.log) for arg in rhs.args):
return True
return False
return insert_subexpressions(ac, callback, **kwargs)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment