Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Static vs. dynamic vector input

vincent_ferri
Beginner
1,269 Views

Hi,

I am having an issue with dynamic input arguements to the following functions;

LAPACKE_dgelss();

dgetrf();dgetri();

ippmInvert_m_64f();

When the input vector is static A[10 * 10] = {...}; the output is correct namely A inverse.  If the same data values are read into a dynamic vector the output is incorrect. Why am I getting this anomally?

Thanks

Vince

0 Kudos
23 Replies
vincent_ferri
Beginner
165 Views

Hi,

c_vector is the file name, what is wrong with you, it contains matrices which intel calls vectors ( everything in MKL seems to use vectors). The file contains three matrices a,b,c.

a is [4 x 10] and b is [10X4] and c should be [10 X 10] not a scalar.

What I now is Matlab computes the c matrix and inv(c) computs the correct coeff.

Regards,

0 Kudos
SergeyKostrov
Valued Contributor II
165 Views
>>...c_vector is the file name, what is wrong with you,.. Vicent, please watch your language.
0 Kudos
mecej4
Honored Contributor III
165 Views

vincent.ferri wrote:

a is [4 x 10] and b is [10X4] and c should be [10 X 10] not a scalar.

What I now is Matlab computes the c matrix and inv(c) computs the correct coeff.

Presumably, you want c to match b X a, rather than a X b, which would be a 4 X 4 matrix. Perhaps, you obtained the values of the elements of matrix c using Matlab or some such tool, but printed out the values with insufficient precision. Since a and b contain three-digit numbers, you need at least six digits for the elements of c. In the file, however, you only display three significant digits for  these. Therefore, you should expect errors of as much as 500 in the elements of matrix c in the file.

The solution is quite simple. Set Matlab (or other utility) to print enough significant digits before you compare.

0 Kudos
Reply