From: Bruno Luong on 5 Jun 2010 10:56 "Andrei Baskakov" <dronbas(a)yahoo.com> wrote in message <hudni9$mi9$1(a)fred.mathworks.com>... > Yes, I'm using it also. But this function (as I undestand) first set's to zero given elements and then removes zeros from a sparse matrix. I wonder whether it will be really faster to modify setsparse so it only removes elements. Remove non-zero elements is costly operation for sparse matrix, because the internal data have to be squeezed. My guess is this is a biggest time consuming part. But of you wish, you can hack the code and dig out the function called "SpRemoveZ" in setspvalmex.c, that performs only the task of removing elements. Note that this function removes the sparse matrix in the *inplace* manner. thus if needed you have to copy the sparse matrix before calling this function. Bruno
|
Pages: 1 Prev: Remove elements from sparse matrix Next: Remove elements from sparse matrix |