dfdx / Espresso.jl

Expression transformation package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option for exact matching

dfdx opened this issue · comments

This:

Z[i, j] = -(X[k, j])

matches this:

tmp1212[i, j] = -(x4[i, j]

Here both i and k in pattern are matched against i in expression. We should have an option (exact?) to disallow this.

Added exact option:

matchingex(:(_x + _y), :(a + a))                      # true
matchingex(:(_x + _y), :(a + a); exact=true)   # ==> false

Also works for the index case above.