Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- matrix inversion using packed storage

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Danesh_Daroui

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-18-2011
11:13 AM

159 Views

matrix inversion using packed storage

I have a real symmetric matrix that I want to calculate inverse of it. For testing, I first create the full matrix and then save it in packed storage to see if everything is correct. Then I call packed storage routines for choleskt factorization (I have symmetric matrix) and then matrix inversion. The code I use is:

[cpp]for (int i=0; i

where the matrix I am trying to invert is a sub-matrix "nx-by-nx" which is in the bigger matrix "nCells-by-nCells". The code is clear enough how I read data from the larger matrix and store it as a packed sub-matrix. The manual of MKL suggests the addressing of the data in one-dimension vector when lower triangle is used as"ap(i+(2*n-j)*(j-1)/2)" so I just modified it to change to to zero-based addressing as above. I hope it is correct!

When I run the code, the routine "dpptrf" always return the number "22" in "info" variable. The strange thing is that the code works OK (info is always zero) for smaller matrices but as the dimensions grow the error comes up. Does anybody know where my code can be faulty? I have read it several time but everything seem to be correct. The manual says that positive value of "info" can be because of error formatting the matrix in packed storage format but if my formatting is incorrect why it does work for smaller matrices? Besides, I have checked the addressing many times and it seems to be correct.

Thanks in advance,

D.

Link Copied

9 Replies

mecej4

Black Belt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-18-2011
07:53 PM

159 Views

It is possible that the matrix as passed is not positive definite for certain values of nx. The returned value of 22 suggests just that possibility, i.e., it is not the arrangement of the matrix elements that is causing the problem but the values of certain elements. You could check this by dumping the smallest matrix that elicits info=22 and trying the Cholesky factorization of that using, e.g., Matlab or Octave.

Danesh_Daroui

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2011
12:11 AM

159 Views

mecej4

Black Belt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2011
03:19 AM

159 Views

Well, in mathematics all matrices are rectangular but "triangular matrix" is standard in numerical analysis as representing the lower or upper triangle including the main diagonal.

Here is a simple matrix that DGETRF will factor but not DPOTRF:

A = [1 2; 2 1]

and the vector x = [1; -2] will prove that A is indefinite ( x

Your results show that for small values of

Danesh_Daroui

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2011
07:21 AM

159 Views

Anyway, I checked more and found out that as you mentioned my matrix is symmetric and indefinite so I used Bunch-Kaufman factorization for packed storage and it worked correctly.

Thanks,

D.

mecej4

Black Belt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-19-2011
07:39 AM

159 Views

junuylia

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-21-2011
02:35 PM

159 Views

[bash]! TAU = TAU_I^{-1}I'm trying to get the inversion of tau_i, since the original matrix would be overwritten, I used a substitute. Also, make sure the triangular matrix is stored by column.

CALL COPY ( TAU_I, TAU)

! CHOLESKY FACTORIZATION, THE MATRIX IS UPDATED BY THE LOWER MATRIX

CALL PPTRF( TAU, UPLO, INFO)

! INVERSION AFTER THE CHOLESKY FACTORIZATION, THE MATRIX IS OVERWRITTEN

! BY THE INVERSION

CALL PPTRI( TAU, UPLO, INFO)

[/bash]

yuriisig

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-22-2011
10:59 AM

159 Views

Unfortunately, algorithms of operation with the packed matrixes in Intel MKL are ineffective.

Danesh_Daroui

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-28-2011
09:25 AM

159 Views

Thanks,

D.

Danesh_Daroui

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-28-2011
09:33 AM

159 Views

Regards,

D.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.