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)?

1 Answer 1

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.

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.
    – 12.yakir
    Commented Feb 7, 2014 at 2:06
  • 2
    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. Commented Feb 7, 2014 at 17:40
  • 2
    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)?
    – 12.yakir
    Commented Feb 8, 2014 at 0:03
  • 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. Commented Feb 8, 2014 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.