Memory usage of decomposition
Hello,
Consider linear systems Ax=b_i with A sparse and positive definite and several right hand sides b_i. In the experiments I have done, it is faster to use
dA = decomposition(A,’chol’,’upper’);
x_i = dAb_i; % repeat as needed
than the classical
R = chol(A);
x_i=R(R’b_i); % repeat as needed
But dA occupies much more memory than R
n = 1e5;d = 1e-5;rc = 1e-5;
A=sprand(n,n,d,rc);
A = A+A’+10*speye(n,n);
R = chol(A);
dA = decomposition(A,’chol’,’upper’);
memR = whos("R"); memR = memR.bytes;
memdA = whos("dA"); memdA = memdA.bytes;
fprintf(‘ R occupies %.1e bytes.ndA occupies %.1e bytesn’,memR,memdA)
Any idea of why? Any solution?
Thanks,
MarianoHello,
Consider linear systems Ax=b_i with A sparse and positive definite and several right hand sides b_i. In the experiments I have done, it is faster to use
dA = decomposition(A,’chol’,’upper’);
x_i = dAb_i; % repeat as needed
than the classical
R = chol(A);
x_i=R(R’b_i); % repeat as needed
But dA occupies much more memory than R
n = 1e5;d = 1e-5;rc = 1e-5;
A=sprand(n,n,d,rc);
A = A+A’+10*speye(n,n);
R = chol(A);
dA = decomposition(A,’chol’,’upper’);
memR = whos("R"); memR = memR.bytes;
memdA = whos("dA"); memdA = memdA.bytes;
fprintf(‘ R occupies %.1e bytes.ndA occupies %.1e bytesn’,memR,memdA)
Any idea of why? Any solution?
Thanks,
Mariano Hello,
Consider linear systems Ax=b_i with A sparse and positive definite and several right hand sides b_i. In the experiments I have done, it is faster to use
dA = decomposition(A,’chol’,’upper’);
x_i = dAb_i; % repeat as needed
than the classical
R = chol(A);
x_i=R(R’b_i); % repeat as needed
But dA occupies much more memory than R
n = 1e5;d = 1e-5;rc = 1e-5;
A=sprand(n,n,d,rc);
A = A+A’+10*speye(n,n);
R = chol(A);
dA = decomposition(A,’chol’,’upper’);
memR = whos("R"); memR = memR.bytes;
memdA = whos("dA"); memdA = memdA.bytes;
fprintf(‘ R occupies %.1e bytes.ndA occupies %.1e bytesn’,memR,memdA)
Any idea of why? Any solution?
Thanks,
Mariano linear systems, sparse matrix, decomposition, memory MATLAB Answers — New Questions