Advantages/disadvantages with PSparseMatrix <: AbstractMatrix #174
fredrikekre
started this conversation in
General
Replies: 2 comments 4 replies
-
Pros:
cons:
|
Beta Was this translation helpful? Give feedback.
3 replies
-
BTW, when using HYPRE.jl with PAs do you also support |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently
PSparseMatrix <: AbstractMatrix
andPVector <: AbstractVector
(PartitionedArrays.jl/src/p_sparse_matrix.jl
Line 971 in b211949
PartitionedArrays.jl/src/p_vector.jl
Line 324 in b211949
I was wondering if this was always the case and if there was any discussion around it, concretely:
Why not subtype
AbstractSparseMatrix
(https://github.com/JuliaSparse/SparseArrays.jl/blob/313a04f4a78bbc534f89b6b4d9c598453e2af17c/src/abstractsparse.jl#L33)?What are the advantages? You get some things like
eltype
for free and such but anything "major"?What are the disadvantages? Does the subtyping cause any issues with hitting generic methods (for example)? I guess since indexing is not supported generic code paths will error eventually anyway?
The reason I am asking is because currently in HYPRE I don't subtype, see e.g. https://github.com/fredrikekre/HYPRE.jl/blob/10bdaec7230a90666c0672f74b2587cca90e8797/src/HYPRE.jl#L52 but I am considering if it is actually useful to do so.
Beta Was this translation helpful? Give feedback.
All reactions