Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/arithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,23 +140,24 @@ function MA.operate_to!(
::typeof(*),
args::Vararg{AlgebraElement,N},
) where {N}
for arg in args
@assert parent(res) == parent(arg)
end
mstr = mstructure(basis(res))
mstr = mstructure(parent(res), parent.(args)...)
MA.operate_to!(coeffs(res), mstr, coeffs.(args)...)
return res
end

function mstructure(args::AbstractStarAlgebra...)
for arg in args
@assert arg == first(args)
end
return mstructure(basis(args[1]))
end

function MA.operate!(
::UnsafeAddMul{typeof(*)},
res::AlgebraElement,
args::Vararg{AlgebraElement,N},
) where {N}
for arg in args
@assert parent(res) == parent(arg)
end
mstr = mstructure(basis(res))
mstr = mstructure(parent(res), parent.(args)...)
MA.operate!(UnsafeAddMul(mstr), coeffs(res), coeffs.(args)...)
return res
end
Expand Down