Trick to finding A*A^T without wasting memory?

  • Thread starter mikeph
  • Start date
  • Tags
    Memory
In summary, the conversation discussed finding eigenvalues of a large matrix A*A^T in MATLAB and encountering memory errors due to limited physical memory. The idea of converting the matrix to single-precision floats and using singular value decomposition as a solution was suggested.
  • #1
mikeph
1,235
18
Hi,

I have a rather large matrix A, and I need to find the eigenvalues of A*A^T. The problem is, when I type this in MATLAB I get a memory error. I am physically limited to 3GB so I'm now searching for mathematical tricks to find this without performing the full calculation.

I've successfully re-arranged similar things before which removed the memory error (I think as soon as MATLAB sees A' it creates a second matrix the exact same size as A, doubling memory use). This time I am a little stuck.

Any hints?

Thanks,
Mike
 
Physics news on Phys.org
  • #2
Have you tried converting the matrix to single-precision floats? It will cut memory usage in half: A=single(A);
 
  • #3
Have you tried singular value decomposition? Matlab does that with the function svd(X). It also supplies an "economy size" singular value decomposition via svd(X,0).
 

Related to Trick to finding A*A^T without wasting memory?

1. How do I find A*A^T without using extra memory?

One trick is to take advantage of the fact that A*A^T is a symmetric matrix. This means that the upper triangular half of the matrix is the transpose of the lower triangular half. Therefore, you can calculate only one half of the matrix and then use it to fill in the other half.

2. Why is it important to avoid wasting memory when finding A*A^T?

In some cases, the size of the matrix A can be very large, which means that calculating A*A^T can require a significant amount of memory. By using the trick to avoid wasting memory, you can save time and resources.

3. Can I use this trick for any size of matrix A?

Yes, this trick can be used for any size of matrix A. However, it is particularly useful for larger matrices where memory usage is a concern.

4. Are there any other tricks for finding A*A^T without wasting memory?

Yes, there are other tricks that can be used, such as using parallel computing techniques or using specialized algorithms designed for symmetric matrices. Additionally, some programming languages have built-in functions for efficiently calculating symmetric matrices.

5. How do I implement this trick in my code?

The implementation of this trick will depend on the programming language and environment you are using. Generally, you will need to use a for loop to calculate only the necessary elements of the matrix and then use this to fill in the other half. It may also be helpful to consult online resources or seek advice from other programmers for specific implementation techniques.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
18
Views
2K
Replies
5
Views
965
  • Atomic and Condensed Matter
Replies
0
Views
541
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • General Discussion
Replies
2
Views
728
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
18
Views
2K
Back
Top