The reason rowvals exists is to access the vector of row-indices of a
CSC-matrix, i.e. one of the internals of CSC, to allow efficient
iteration over the non-zeros.  However, there is no equivalent colvals
internal, so there is little reason to do this and even less reason to
encourage it.  Consider:

julia> s = sprand(10^7, 10^7, 1e-7);

julia> @time rowvals(s);
  0.000004 seconds (4 allocations: 160 bytes)

julia> @time colvals(s);
  0.508060 seconds (20 allocations: 533.748 MB, 14.61% gc time)


On Fri, 2016-04-01 at 10:48, Anonymous <espr...@gmail.com> wrote:
> There is a rowals function, and then there is a find function, and the find
> function actually allows you to write a one line colvals function:
>
> colvals(S::SparseMatrixCSC) = round(Int, floor(find(S)/(size(S, 1)+0.1))+1)
>
> shouldn't someone add this to base?

Reply via email to