From fda4b1fa81901d4cdbd3cbf3c402aa7b67e9fbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Fri, 5 Jul 2024 15:42:18 +0200 Subject: [PATCH 1/3] Broadcast star --- src/star.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/star.jl b/src/star.jl index 100f707..4857e1a 100644 --- a/src/star.jl +++ b/src/star.jl @@ -6,7 +6,7 @@ function star(X::AlgebraElement) return AlgebraElement(res, parent(X)) end -star(::AbstractBasis, x) = star(x) +star(::AbstractBasis, x) = star.(x) function star(basis::AbstractBasis, d::SparseCoefficients) k = star.(Ref(basis), keys(d)) From 7d3ef841b4142b56c1e7a1d67bc6d1a9d3bdb74a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Fri, 5 Jul 2024 16:01:01 +0200 Subject: [PATCH 2/3] Add test --- test/constructors.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/constructors.jl b/test/constructors.jl index 0fdf940..883a262 100644 --- a/test/constructors.jl +++ b/test/constructors.jl @@ -111,6 +111,8 @@ end @test coeffs(deepcopy(a)) !== coeffs(a) @test parent(deepcopy(a)) === parent(a) + @test star(a) == a + latex = CustomLaTeXPrint(" \$\$ \\[\\(α_β∀ \\) \\]\t \$\$") a = SA.AlgebraElement(SA.SparseCoefficients([p], [latex]), RG) # Tests that `getindex` works even if `zero(typeof(latex))` is not defined @@ -122,5 +124,5 @@ end @test sprint((io, x) -> show(io, "text/latex", x), SA.AlgebraElement(SA.SparseCoefficients([p], [latex]), RG)) == "\$\$ (\\(β∀) \\cdot b·c \$\$" - + end From af75d8222f92d025375cef6da2244be9bd0dc025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Fri, 5 Jul 2024 16:01:14 +0200 Subject: [PATCH 3/3] Revert "Broadcast star" This reverts commit fda4b1fa81901d4cdbd3cbf3c402aa7b67e9fbea. --- src/star.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/star.jl b/src/star.jl index 4857e1a..100f707 100644 --- a/src/star.jl +++ b/src/star.jl @@ -6,7 +6,7 @@ function star(X::AlgebraElement) return AlgebraElement(res, parent(X)) end -star(::AbstractBasis, x) = star.(x) +star(::AbstractBasis, x) = star(x) function star(basis::AbstractBasis, d::SparseCoefficients) k = star.(Ref(basis), keys(d))