views:

97

answers:

3

I have a square n*n matrix S that has to be decomposed into a product of two matrices - A1 and A2, where A2 is transposed matrix to A1 (A2=A1^T) , so A1 * A2 = S. Are there any algorithms to do such operation effectively? C#/C++ solution would be nice.

+2  A: 

In that case you probably want http://en.wikipedia.org/wiki/Cholesky_decomposition

Andrei
+1: I was about to add the same link for the new version of the question.
Moron
What if S is not symmetric?
Singularity
@Singularity: Use (AB)^T = B^T.A^T and see that if such a decomposition is possible then S = S^T.
Moron
Why -1 for this?
Moron
+1  A: 

As Andrei suggested, it seems you are trying to do Cholesky Decomposition.

There is provided C++ code in polish wiki site for it.

There is also separate subsection in "Numerical recipes in C" (2.9 Cholesky decomposition, can be found here: http://www.nrbook.com/a/bookcpdf/c2-9.pdf )

Gacek
A: 

I'm not quite sure what you want to do but

here is the GSL lib that might help

14 Linear Algebra

lukas