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

mkl fmgres : try to solve 1 euquation with 1 unknown

dennis_r_
Beginner
311 Views
Hi, beginner problem, I try to solve A x = b with A = 0.2 and b=0.1 so x should become 0.5. In the fgmres_full_funct_c.c example I did this:

#define N 1
int ia[2] = {1, 2};
int ja[1] = { 1 };
double A[1] = { 0.2 };
double expected_solution = { 0.5 };

when I compile and run the fgmres_full_funct_c.out I get a 'nan' in the computed solution in stead of 0.5 I use mkl version 9.0.018.

thanks, Dennis
0 Kudos
1 Reply
dennisgerardusroddem
311 Views
Hi, reply to myself for those who try the same,

1. I found that the declaration of the tmp array: tmp[N*(2N+1)+(N*(N+9))/2+1] is less general then it looks. For N=1 this generates a too small tmp array, since the code actually uses a longer array. Thus for small N do not use that declaration, but add something extra, eg tmp[100+N*(2N+1)+(N*(N+9))/2+1].

2. Also notice that RCI_request==3 contains code dependend on the size N.
0 Kudos
Reply