The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Reducing memory requirements for tiled matrices
Replies: 5   Last Post: Nov 14, 2012 11:27 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Roger Stafford

Posts: 5,929
Registered: 12/7/04
Reducing memory requirements for tiled matrices
Posted: Nov 14, 2012 11:27 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Harry Commin" wrote in message <k8010m$98f$>...
> Yes, using multiple loops was actually my starting point, but then I removed the loops in an attempt to speed up execution. This worked pretty well for modestly-sized matrices (allowing execution to finish within a day or two). However, I've hit a wall with this slightly larger data size in that I now run out of memory.
> I suppose a brute-force approach would be to get my hands on a 64-bit architecture. Or I could try keeping "some" loops and not others... but it's difficult to identify a good trade-off.

- - - - - - - - - - -
Just in case you are still interested in "loops" solutions, here is a modification of the code I sent before. I think you can replace the repmat term with just the scalar F(i1,j1). I had to use the repmat version on my very ancient system.

K = zeros(Nf*Ns*N0,Mf*Ms);
for i1 = 1:Nf*N0
for j1 = 1:Mf
K(1+Ns*(i1-1):Ns*i1,j1:Mf:j1+Mf*(Ms-1)) = repmat(F(i1,j1),Ns,Ms);
for i1 = 1:Ns*N0
for j1 = 1:Ms
i2 = i1:Ns*N0:i1+Ns*N0*(Nf-1);
j2 = 1+Mf*(j1-1):Mf*j1;
K(i2,j2) = K(i2,j2)*S(i1,j1);

Roger Stafford

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.