@@ -21,9 +21,23 @@ function _test_basis(basis)
2121end
2222
2323struct TypeA end
24- struct TypeB end
2524Base. zero (:: Type{TypeA} ) = TypeA ()
25+ Base. iszero (:: TypeA ) = false
26+ LinearAlgebra. adjoint (:: TypeA ) = TypeA ()
27+ struct TypeB end
28+ Base. zero (:: Type{TypeB} ) = TypeB ()
29+ Base. iszero (:: TypeB ) = false
30+ LinearAlgebra. adjoint (:: TypeB ) = TypeB ()
31+
2632Base.:* (:: Float64 , :: TypeA ) = TypeB ()
33+ Base.:* (:: TypeA , :: Float64 ) = TypeB ()
34+ Base.:* (:: Float64 , :: TypeB ) = TypeB ()
35+ Base.:* (:: TypeB , :: Float64 ) = TypeB ()
36+ Base.:/ (:: TypeA , :: Float64 ) = TypeB ()
37+ Base.:/ (:: TypeB , :: Float64 ) = TypeB ()
38+ Base.:+ (:: TypeB , :: TypeB ) = TypeB ()
39+ Base.:- (:: TypeB , :: TypeB ) = TypeB ()
40+ Base. convert (:: Type{TypeB} , :: TypeA ) = TypeB ()
2741
2842function api_test (B:: Type{<:MB.AbstractMonomialIndexed} , degree)
2943 @polyvar x[1 : 2 ]
@@ -66,6 +80,15 @@ function api_test(B::Type{<:MB.AbstractMonomialIndexed}, degree)
6680 a = MB. algebra_element (ones (length (basis)), basis)
6781 _test_op (MB. implicit, a)
6882 @test SA. star (a) == a
83+ if B == Chebyshev || B == ScaledMonomial
84+ mono = explicit_basis_covering (
85+ FullBasis {Monomial,eltype(basis.monomials)} (),
86+ basis,
87+ )
88+ a = MB. algebra_element (fill (TypeA (), length (basis)), mono)
89+ @test SA. coeffs (a, full_basis). values ==
90+ fill (TypeB (), length (basis))
91+ end
6992 end
7093 mono = x[1 ]^ 2 * x[2 ]^ 3
7194 p = MB. Polynomial {B} (mono)
0 commit comments