This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Polar Decomposition using Eigen?

Tags: None
(comma "," separated)
jb4652
Registered Member
Posts
9
Karma
0

Polar Decomposition using Eigen?

Fri Jul 02, 2010 8:19 am
Hi all,

Does Eigen have routines to solve the polar decomposition problem?

I finally tried to use the method described below(using SVD to solve polar decomposition):

http://people.sc.fsu.edu/~jburkardt/m_s ... atrix.html
poldec.m, polar decomposition of a matrix.

The question is when using Eigen::SVD, the results are different from Matlab. How should I do polar decomposition using Eigen?

For example (only differ in sign):
Code: Select all
>> A = [88 44 0;44 88 0; 0 0 0]

A =

    88    44     0
    44    88     0
     0     0     0

>> [U S V] = svd(A)

U =

   -0.7071   -0.7071         0
   -0.7071    0.7071         0
         0         0    1.0000


S =

   132     0     0
     0    44     0
     0     0     0


V =

   -0.7071   -0.7071         0
   -0.7071    0.7071         0
         0         0    1.0000

>> poldec(A)

ans =

    1.0000         0         0
    0.0000    1.0000         0
         0         0    1.0000


However, using Eigen, I get:
Code: Select all
matrixU() =

    0.7071    0.7071         0
   -0.7071    0.7071         0
         0         0    1.0000

matrixV() =

    0.7071    0.7071          0
   -0.7071    0.7071          0
         0         0    -1.0000

U * V' =

    1.0000         0          0
    0.0000    1.0000          0
         0         0    -1.0000


Another Example(differ in U & V, but the result is the same):
Code: Select all
A =

    0.0458    0.0053   -0.0104
    0.0053    0.0007   -0.0023
   -0.0104   -0.0023    0.0203

>> [U S V] = svd(A)

U =

   -0.9351    0.3395   -0.1013
   -0.1166   -0.0248    0.9929
    0.3346    0.9403    0.0628


S =

    0.0502         0         0
         0    0.0166         0
         0         0    0.0000


V =

   -0.9351    0.3395   -0.1013
   -0.1166   -0.0248    0.9929
    0.3346    0.9403    0.0628

>> poldec(A)

ans =

    1.0000         0    0.0000
   -0.0000    1.0000   -0.0000
    0.0000   -0.0000    1.0000


Using Eigen, I get:
Code: Select all
matrixU() =

    0.9351    0.1166    -0.3346
   -0.3395    0.0248    -0.9402
   -0.1013    0.9928     0.0628

matrixV() =

    0.9351    0.1166    -0.3346
   -0.3395    0.0248    -0.9402
   -0.1013    0.9928     0.0628

U * V' =

    1.0000         0         0
    0.0000    1.0000         0
         0         0    1.0000
jitseniesen
Registered Member
Posts
204
Karma
2

Re: Polar Decomposition using Eigen?

Fri Jul 02, 2010 11:41 am
The polar decomposition of a singular matrix A (as you have in your examples) is not unique. So it's not a problem if Eigen gives a different result than Matlab. The thing you need to check is, if you compute the decomposition A = PU, that P times U does indeed equal A, that P is positive semi-definite, and that U is unitary. Alternatively, make sure that A is invertible and then the polar decomposition is unique, so Matlab and Eigen should give the same results.
jb4652
Registered Member
Posts
9
Karma
0

Re: Polar Decomposition using Eigen?

Fri Jul 02, 2010 12:02 pm
Thank you very much for your reply


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]