Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: partial matrix operations without memory copying
Posted:
Dec 2, 2012 3:39 AM


"Nick" wrote in message <k9e78r$m21$1@newscl01ah.mathworks.com>... > I would like to do operations on vectors of a matrix efficiently, without memory copying. > For example, say V is KxK, A is Nxp p>k > I want to do X(:,1:K)*V efficiently. As it is currently written, matlab makes a temporary copy of the first K colomns of X and does the multiplication. The primitive BLAS routines can handle this without memory copying: just give it the same pointer to X with different number of columns as input. I would like to realize this speedup without having to go to mex. Is this possible?
I wrote this package for such purpose: http://www.mathworks.com/matlabcentral/fileexchange/24576inplacearrayasemipointerpackageformatlab
But you need to be careful when using it.
Bruno



