From 45ef71f18d0f07cada75115d631be28b20309bdf Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Thu, 30 May 2024 16:02:30 +0200 Subject: [PATCH] =?UTF-8?q?replace=20further=20uses=20of=20basis(parent(?= =?UTF-8?q?=E2=80=A6))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/algebra_elts.jl | 6 +++--- src/arithmetic.jl | 2 +- src/star.jl | 2 +- src/types.jl | 2 +- test/group_algebra.jl | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/algebra_elts.jl b/src/algebra_elts.jl index e2e160b..44954df 100644 --- a/src/algebra_elts.jl +++ b/src/algebra_elts.jl @@ -15,13 +15,13 @@ function Base.deepcopy_internal(a::AlgebraElement, id::IdDict) end # call overload: -(a::AlgebraElement)(x) = coeffs(a)[basis(parent(a))[x]] -Base.setindex!(a::AlgebraElement, v, idx) = a.coeffs[basis(parent(a))[idx]] = v +(a::AlgebraElement)(x) = coeffs(a)[basis(a)[x]] +Base.setindex!(a::AlgebraElement, v, idx) = a.coeffs[basis(a)[idx]] = v # AlgebraElement specific functions function supp(a::AlgebraElement) - b = basis(parent(a)) + b = basis(a) return [b[i] for (i, _) in nonzero_pairs(coeffs(a))] end diff --git a/src/arithmetic.jl b/src/arithmetic.jl index d25c3a5..39fe8cb 100644 --- a/src/arithmetic.jl +++ b/src/arithmetic.jl @@ -103,7 +103,7 @@ function MA.operate_to!( Y::AlgebraElement, ) @assert parent(res) == parent(X) == parent(Y) - mstr = mstructure(basis(parent(res))) + mstr = mstructure(basis(res)) MA.operate_to!(coeffs(res), mstr, coeffs(X), coeffs(Y)) return res end diff --git a/src/star.jl b/src/star.jl index b0e971d..100f707 100644 --- a/src/star.jl +++ b/src/star.jl @@ -2,7 +2,7 @@ Base.adjoint(a::AlgebraElement) = star(a) star(x::Any) = x' function star(X::AlgebraElement) - res = star(basis(parent(X)), coeffs(X)) + res = star(basis(X), coeffs(X)) return AlgebraElement(res, parent(X)) end diff --git a/src/types.jl b/src/types.jl index 231dc2d..88443d8 100644 --- a/src/types.jl +++ b/src/types.jl @@ -90,7 +90,7 @@ function Base.isone(a::AlgebraElement) if basis(A) isa DiracBasis return c == cfs1 else - dc = coeffs(c, basis(parent(a)), DiracBasis{UInt}(object(parent(a)))) + dc = coeffs(c, basis(a), DiracBasis{UInt}(object(parent(a)))) return dc == cfs1 end end diff --git a/test/group_algebra.jl b/test/group_algebra.jl index 0dc2c25..6804b6b 100644 --- a/test/group_algebra.jl +++ b/test/group_algebra.jl @@ -115,7 +115,7 @@ z = sum((one(RG) - RG(g)) * star(one(RG) - RG(g)) for g in G) @test SA.aug(z) == 0 - @test SA.supp(z) == sort(collect(basis(parent(z)))) + @test SA.supp(z) == sort(collect(basis(z))) @test SA.supp(RG(1) + RG(g)) == [one(G), g] @test SA.supp(a) == [one(G), h, g]