Skip to content

Commit

Permalink
Update SparseGramMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Oct 30, 2020
1 parent 2c84bae commit cce3242
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gram_matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ function Base.isapprox(p::GramMatrix, q::GramMatrix; kwargs...)
p.basis == q.basis && isapprox(p.Q, q.Q; kwargs...)
end

struct SparseGramMatrix{T, B, U} <: AbstractGramMatrix{T, B, U}
sub_gram_matrices::Vector{GramMatrix{T, B, U}}
struct SparseGramMatrix{T, B, U, MT} <: AbstractGramMatrix{T, B, U}
sub_gram_matrices::Vector{GramMatrix{T, B, U, MT}}
end

Base.zero(::Type{SparseGramMatrix{T, B, U}}) where {T, B, U} = SparseGramMatrix(GramMatrix{T, B, U}[])
Base.zero(::Type{SparseGramMatrix{T, B, U, MT}}) where {T, B, U, MT} = SparseGramMatrix(GramMatrix{T, B, U, MT}[])
function MP.polynomial(p::SparseGramMatrix)
return mapreduce(identity, MA.add!, p.sub_gram_matrices, init = zero(MP.polynomialtype(p)))
end

0 comments on commit cce3242

Please sign in to comment.