Multidimensional sparse matrices in Julia
Asked Answered
C

1

16

Why aren't there any multidimensional sparse matrices/arrays in Julia? Why can we only have 2D sparse matrices and not for example 3D sparse matrices (or arrays)?

Celandine answered 5/2, 2014 at 23:38 Comment(0)
T
10

The problem as I understand it (I'm not sparse linear algebra expert, although Viral Shah, who is one of the other Julia co-founders is) is that all libraries (e.g. SuiteSparse) for doing sparse computations are matrix-only. They don't support sparse vectors and they don't support higher dimensional tensors either. So we could define types for higher-dimensional sparse tensors, but you wouldn't be able to do anything useful with them.

Torpedo answered 6/2, 2014 at 18:22 Comment(4)
I see. Well, tat seems too bad... In my (sparse) mind, the larger the dimension the more gain we can have from being able to sparse it.Celandine
I agree. We've talked about doing a "tuple soup" sparse matrix implementation which could support arbitrary dimensions of sparsity. The hard part is making operations like matvec and matmul reasonably fast.Torpedo
To be honest, I'd be happy with 3D only. That would open up all sorts of applications related to the 3D space (such as ray-tracing). But I guess that if you've done the work for expanding it to 3D you might as well make it all the way to any arbitrary dimension. So realistically speaking, you don't think it's gonna happen (I take it you're involved with Julia's development team)?Celandine
Yes, I'm one of the co-founders of the project. Arbitrary multiple dimensions is actually quite hard, so 3D might be significantly easier. One caveat is that only one of the dimensions will be sparse; this is true of normal sparse matrices as well, but there are only two dimensions. CSC is the standard sparse matrix format on column major systems.Torpedo

© 2022 - 2024 — McMap. All rights reserved.