From d7c0fbe2fbd7331fd107b207b7fd54a60b5c02a2 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Fri, 6 Oct 2023 17:59:45 -0400 Subject: [PATCH] Add similarterm for array --- src/arrays.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/arrays.jl b/src/arrays.jl index 3c8b7b84e..15ee6dd17 100644 --- a/src/arrays.jl +++ b/src/arrays.jl @@ -92,6 +92,14 @@ function arguments(a::ArrayOp) arguments(a.term) end +function similarterm(a::ArrayOp, f, args, type; metadata=nothing) + res = f(args...) + if res isa Symbolic && metadata !== nothing + res = SymbolicUtils.metadata(res, metadata) + end + res +end + function Base.isequal(a::ArrayOp, b::ArrayOp) a === b && return true isequal(a.shape, b.shape) &&