Problemas con el operador de barra invertida en matlab

I have this huge matrix A of dimension 900000x900000. And I have to solve this linear equation Ax=b where b is a column matrix of size 900000x1.

I used matlab's backslash operator like A\b to try to get x. However, it freezes and I couldn't get x. Mostly I get out of memory issue. Even though I ran it in a computer with higher memory it makes the system very slow and I have to wait to get the answer.

How can I solve this equation. My matrix is pretty sparse. However, it's band is wider but most of the elements are zero. b is a full matrix. Any suggestions?

preguntado el 26 de agosto de 12 a las 23:08

Have you tried these approaches: If you are running 32 bit Matlab on 32 bit Windows then the 3 GB ini switch could help? -

Full storage of a 900000x900000 real double precision matrix requires about 6 TiB of memory, so I assume you are already using sparse storage. Can you provide the output of whos A ? Maybe this question is better asked on providing more detail on matrix A (symmetric? hermitian? positive definite?) along with a brief description of the application area. -

It never matters how much capability you give someone, there will always be someone wanting to do something beyond that capability, while having absolutely no idea of what they are doing, or why what they are trying is insane. -

1 Respuestas

I did a project, where we also operated with such large but fortunately very sparse matrices. Using such large matrices, you are pretty lost with direct methods: You can never compute the inverse because it will be a dense matrix, which you can never store. Also methods such as LU or Cholesky factorization are quite expensive because they again create a significant fill-in, i.e. they destroy zeros.

A viable alternative is to use iterative methods. If you know that your matrix is symmetric and positive-definite, try the método de gradiente conjugado:

x = pcg(A, b);  %# Computes a solution to Ax = b, with A symm. pos-def.

I would just give it a try and have a look, if the method converges. Proofing the assumption of positive-definiteness is not easy, I'm afraid.

If you do not get a solution, there are many more iterative methods. For example:

bicg     - BiConjugate Gradient Method
bicgstab - BiConjugate Gradient Method (stabilized)
lsqr     - Least Squares QR Method
gmres    - Generalized Minimum Residual Method (I like this a lot)

Respondido 29 ago 12, 16:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.