From c5c1cfa0ba0e9935e63475553f47d769661f6b62 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Sun, 1 Dec 2024 23:09:54 +0100 Subject: [PATCH] fixes to dot --- src/algebra_elts.jl | 1 + src/coefficients.jl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/algebra_elts.jl b/src/algebra_elts.jl index 44954df..a718cf7 100644 --- a/src/algebra_elts.jl +++ b/src/algebra_elts.jl @@ -37,5 +37,6 @@ function LinearAlgebra.dot(w::AbstractVector, b::AlgebraElement) return LinearAlgebra.dot(w, coeffs(b)) end function LinearAlgebra.dot(a::AlgebraElement, w::AbstractVector) + @assert key_type(basis(parent(a))) <: Integer return LinearAlgebra.dot(coeffs(a), w) end diff --git a/src/coefficients.jl b/src/coefficients.jl index 54bcf21..b956f65 100644 --- a/src/coefficients.jl +++ b/src/coefficients.jl @@ -115,7 +115,7 @@ function LinearAlgebra.dot(w::AbstractVector, ac::AbstractCoefficients) if isempty(values(ac)) return zero(MA.promote_sum_mul(eltype(w), value_type(ac))) else - return sum(w[i] * star(v) for (i, v) in nonzero_pairs(ac)) + return sum(w[i] * v for (i, v) in nonzero_pairs(ac)) end end