The definition of the CSC format does not ordinarily admit for allocated
but unused space:

http://netlib.org/linalg/html_templates/node92.html

You may recognize that CSC is a sorted representation of a trie of depth 2
(one for the rows, then for the columns).

Theoretically we could relax the definition so that we can have allocated
but unused space in the val array. However, it's not clear what sizehint!
should do? - allocate more space and distribute the unused space amongst
each column? It's very tricky and won't be robust enough for general use
cases.

Thanks,

Jiahao Chen
Staff Research Scientist
MIT Computer Science and Artificial Intelligence Laboratory

On Tue, Feb 24, 2015 at 4:47 PM, Seth <[email protected]> wrote:

> I was surprised to find that there is no method on sizehint! for sparse
> matrices:
>
> ERROR: MethodError: `sizehint!` has no method matching sizehint!(::Base.
> SparseMatrix.SparseMatrixCSC{Int64,Int64}, ::Int64)
>
>
> Is this intentional? I noticed that insert performance on sparse matrices (
> setindex! in particular) is the bottleneck in my code, and I was hoping
> to optimize a bit more.
>
>

Reply via email to