Skip to content

Commit

Permalink
Fix star for SubBasis
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Jul 5, 2024
1 parent 2548ae1 commit cd9d98b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/monomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -435,3 +435,6 @@ function SA.coeffs(
return SA.coeffs!(res, cfs, source, target)
end
end

# FIXME this assumes that the basis is invariant under adjoint
SA.star(::SubBasis, coeffs) = SA.star.(coeffs)
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function api_test(B::Type{<:MB.AbstractMonomialIndexed}, degree)
#@test polynomial(i -> 0.0, basis) isa polynomial_type(basis, Float64)
a = MB.algebra_element(ones(length(basis)), basis)
_test_op(MB.implicit, a)
@test SA.star(a) == a
end
mono = x[1]^2 * x[2]^3
p = MB.Polynomial{B}(mono)
Expand Down

0 comments on commit cd9d98b

Please sign in to comment.