Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro committed Aug 24, 2021
1 parent 96e33d9 commit 4d0ff5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ for `simplify` to work. Other required methods are `gethead` and `isterm`

In addition, the methods for `Base.hash` and `Base.isequal` should also be implemented by the types for the purposes of substitution and equality matching respectively.

#### `similarterm(t::MyType, f, args; type=T, metadata=nothing)`
#### `similarterm(t::MyType, f, args, symtype=T; metadata=nothing)`

Or `similarterm(t::Type{MyType}, f, args; type=T, metadata=nothing)`.
Or `similarterm(t::Type{MyType}, f, args, symtype=T; metadata=nothing)`.

Construct a new term with the operation `f` and arguments `args`, the term should be similar to `t` in type. if `t` is a `SymbolicUtils.Term` object a new Term is created with the same symtype as `t`. If not, the result is computed as `f(args...)`. Defining this method for your term type will reduce any performance loss in performing `f(args...)` (esp. the splatting, and redundant type computation). T is the symtype of the output term. You can use `SymbolicUtils.promote_symtype` to infer this type.

Expand Down

0 comments on commit 4d0ff5e

Please sign in to comment.