-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring #20
Comments
how about implementing our own SparseVector (without length) struct SparseCoeffs{Tv, Tb, Vv<:AbstractVector{Tv}, Vb<:AbstractVector{Tb}}
coeffs::Vv
basis_elts::Vb
end (without length!) and then on top of this we could have struct AlgebraElement{A,SC<:SparseCoeffs}
parent::A
coeffs::SC
end Also: multiplicative structures for implicit (e.g. potentially infinite) bases should work on the level of basis elements and not integers. For explicit bases (i.e. finite dimensional) translation from the former to the latter is already implemented as |
For implicit bases, we have two issues with struct InfiniteSparseVector{T,I}
nzind::Vector{I}
nzval::Vector{T}
end
Base.IteratorSize(::Type{<:InfiniteSparseVector}) = Base.IsInfinite()
import SparseArrays
SparseArrays.nonzeroinds(v::InfiniteSparseVector) = v.nzidx
SparseArrays.nonzeros(v::InfiniteSparseVector) = v.nzval The sophisticated part of the printing of Base.show(io::IO, x::InfiniteSparseVector) = show(convert(IOContext, io), x)
function Base.show(io::IO, ::MIME"text/plain", x::InfiniteSparseVector)
xnnz = length(nonzeros(x))
print(io, typeof(x), " with ", xnnz,
" stored ", xnnz == 1 ? "entry" : "entries")
if xnnz != 0
println(io, ":")
show(IOContext(io, :typeinfo => eltype(x)), x)
end
end
import SparseArrays
function Base.show(io::IOContext, x::InfiniteSparseVector)
show(io, SparseVector(last(x.nzind), x.nzind, x.nzval))
end |
To handle the monomials efficiently, the |
The coefficient vector can also be struct CanonicalVector{I,T} <: AbstractVector{T} # for explicit
index::I
length::I
end
struct InfiniteCanonicalVector{K} # for implicit
key::K
end |
For |
Here are the conclusion of our meeting with @kalmarek
We should have two types of
AbstractBasis
For
AbstractSubBasis
, you can build the subbasis withThe text was updated successfully, but these errors were encountered: