Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Jun 14, 2024
1 parent fdbcbdc commit 3eff68e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ function adjoint_coeffs!(res, cfs, source::AbstractBasis, target::AbstractBasis)
end
return res
end

function adjoint_coeffs(a::AlgebraElement, target::AbstractBasis)
return adjoint_coeffs(coeffs(a), target, basis(a))
end
4 changes: 4 additions & 0 deletions test/abstract_coeffs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
y = AlgebraElement(ACoeffs(coeffs(b, basis(fRG))), fRG)
x, y
end
@test coeffs- β, SA.FixedBasis(basis(RG); n = 2)) == [1, -1]
@test_throws KeyError coeffs- β, SA.FixedBasis(basis(RG); n = 1))
@test SA.adjoint_coeffs- β, SA.FixedBasis(basis(RG); n = 2)) == [1, -1]
@test SA.adjoint_coeffs- β, SA.FixedBasis(basis(RG); n = 1)) == [1]
@test coeffs(2α) isa ACoeffs{Int}
@test coeffs- β) isa ACoeffs
@test coeffs- β // 3) isa ACoeffs{<:Rational}
Expand Down

0 comments on commit 3eff68e

Please sign in to comment.