Turn on suggestions

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
- problem about LAPACKE_dgetrf and LAPACKE_dgetri

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

HM_Li

Beginner

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

04-06-2016
06:05 AM

89 Views

problem about LAPACKE_dgetrf and LAPACKE_dgetri

Please see attachment b.c.

if I comment out from* * to *//hmli begin* in the follow code of b.c, it works wrong, but if I do not comment out and use sprintf and atof to convert from double to string, then convert back to double, it work well. *//hmli end*

for (k = 0; k < 64; k++)a+=(double) A1* A1 ; //hmli begin sprintf(t,"%lf",a ); a=atof(t); //hmli end a= (double)a ;

Is it just because of the precision?

Can you help me? Thank you very much.

- b.c: source code
- body.log : input data file
- ainv.log: result of matrix inversion.
- compiling :icc -mkl b.c

1 Solution

Alexander_K_Intel3

Employee

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

04-19-2016
03:47 AM

89 Views

The input matrix in the example is very ill-conditioned. This means it hardly could lead to an accurate result, and round-offs cause big fluctuation of the output.

As I see the best option here is to improve the condition number of the input matrix.

However you also could try dgesvxx with FACT=E. This way the function does normalization and equlibration of input data, which could improve accuracy for ill-conditioned matrices. Please provide and identity matrix NxN in B, and on output B will contain inverse of matrix A. Or the function will return a warning in INFO (see documentation) if the matrix is too ill-conditioned.

Best regards,

Alexander

Link Copied

4 Replies

mecej4

Black Belt

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

04-07-2016
02:30 PM

89 Views

_{1,1} has been degraded to just five significant digits, i.e, it is now 5.2734000e-002. What is the purpose of writing a limited number of digits and reading the truncated number back in?

HM_Li

Beginner

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

04-10-2016
12:10 AM

89 Views

Alexander_K_Intel3

Employee

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

04-19-2016
03:47 AM

90 Views

The input matrix in the example is very ill-conditioned. This means it hardly could lead to an accurate result, and round-offs cause big fluctuation of the output.

As I see the best option here is to improve the condition number of the input matrix.

However you also could try dgesvxx with FACT=E. This way the function does normalization and equlibration of input data, which could improve accuracy for ill-conditioned matrices. Please provide and identity matrix NxN in B, and on output B will contain inverse of matrix A. Or the function will return a warning in INFO (see documentation) if the matrix is too ill-conditioned.

Best regards,

Alexander

HM_Li

Beginner

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

04-19-2016
05:04 AM

89 Views

Thank you very much. I see.

Topic Options

- 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.

Thank you.

The reason is: if the double float data not truncated, LAPACKE_dgetrf and LAPACKE_dgetri can't give the right result, so I want to know why and how to use LAPACKE_dgetrf and LAPACKE_dgetri right.