File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,6 +96,15 @@ function get_last_letter(indices::IndexList)
9696 return current_last
9797end
9898
99+
100+ function to_binary_operation (op:: Op , terms:: AbstractArray ) where {Op}
101+ if length (terms) == 1
102+ return first (terms)
103+ end
104+
105+ return BinaryOperation {Op} (to_binary_operation (op, terms[1 : (end - 1 )]), terms[end ])
106+ end
107+
99108function simplify (:: Mult , arg1:: BinaryOperation{Mult} , arg2:: KrD )
100109 if is_diag (arg1)
101110 d = get_diag_delta (arg1)
Original file line number Diff line number Diff line change @@ -601,25 +601,6 @@ function to_standard(arg::Real)
601601 return arg
602602end
603603
604- function to_binary_operation (op:: Op , terms:: AbstractArray ) where {Op}
605- binop = nothing
606-
607- for t ∈ terms
608- if isnothing (binop)
609- binop = t
610- continue
611- end
612-
613- binop = BinaryOperation {Op} (binop, t)
614- end
615-
616- return binop
617- end
618-
619- function to_binary_operation (op:: Op , term) where {Op}
620- return term
621- end
622-
623604# Recursive adjoint
624605function radjoint (arg:: T ) where {T<: UnaryOperation }
625606 return T (arg. arg' )
You can’t perform that action at this time.
0 commit comments