Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: partial matrix operations without memory copying
Replies: 2   Last Post: Dec 2, 2012 6:30 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bruno Luong

Posts: 8,845
Registered: 7/26/08
Re: partial matrix operations without memory copying
Posted: Dec 2, 2012 3:39 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"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/24576-inplacearray-a-semi-pointer-package-for-matlab

But you need to be careful when using it.

Bruno



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.