Re: [julia-users] why is there no colvals function for sparse matrices in base?

2016-04-01 Thread Anonymous
oh cool that's convenient, for some reason the nzrange function isn't mentioned in the documentation. On Friday, April 1, 2016 at 2:46:53 AM UTC-7, Mauro wrote: > > On Fri, 2016-04-01 at 11:07, Anonymous > wrote: > > but what if I need to access the coordinates of the

Re: [julia-users] why is there no colvals function for sparse matrices in base?

2016-04-01 Thread Mauro
On Fri, 2016-04-01 at 11:07, Anonymous wrote: > but what if I need to access the coordinates of the nonzero entries of a > sparse matrix for some reason? Is there a faster way to do it than using > my colvals function? help?> nzrange search: nzrange nzrange(A, col)

Re: [julia-users] why is there no colvals function for sparse matrices in base?

2016-04-01 Thread Anonymous
but what if I need to access the coordinates of the nonzero entries of a sparse matrix for some reason? Is there a faster way to do it than using my colvals function? On Friday, April 1, 2016 at 2:03:31 AM UTC-7, Mauro wrote: > > The reason rowvals exists is to access the vector of row-indices

Re: [julia-users] why is there no colvals function for sparse matrices in base?

2016-04-01 Thread Mauro
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.

[julia-users] why is there no colvals function for sparse matrices in base?

2016-04-01 Thread Anonymous
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?