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

## Sstrange behavior MKL-FEAST Beginner
201 Views

At the moment I am trying to implement a minimal working example of the <<dfeast_scsrgv>>   routine  in c++ of the FEAST package to solve the generalized eigenvalue problem Ax=lBx. The problem size is just 4x4 for testing  purposes

The first time I executed the program I got the error:
Info =3 that is a warning  "Size of the subspace m0 is too small (m0<m)".
thus I changed the value of M0 from 4 to 10 and tried again.

This time I the error was  "201" which means  "Problem with size of initial subspace m0 (m0≤0)"

this does not make any sense as M0 is positive.

I would appreciate any help on this.

[cpp]
#include <iostream>
#include<math.h>
#include<cmath>
#include<algorithm>
#include "mkl.h"
#include "mkl_solvers_ee.h"
using namespace std;

///////TEST MATRIX///////////////
/*

A=        |1  0  0  1|
|0  2  1  0|
|0  1  3  0|
|1  0  0  4|

B=         |1  0  0  0|
|0  2  0  0|
|0  0  3  0|
|0  0  0  4|

PROBLEM Ax=lBx

*/

int main(){

MKL_INT fpm;

//MATRIX SET UP
double  AV[]={1,1,2,1,3,4};
MKL_INT IA[]={1,3,5,6,7};
MKL_INT JA[]={1,4,2,3,3,4};

double  BV[]={1,2,3,4};
MKL_INT IB[]={1,2,3,4,5};
MKL_INT JB[]={1,2,3,4};

//SET UP EIGENSOLVER
//initialize parameters of FEAST algorithm
feastinit(fpm);
fpm=1;
char UPLO= 'U';                            //uses the upper triangular part of the matrix
const MKL_INT N=4;                         //set problem size
double Emin=double(0.0), Emax=double(4);   // bounds of the igenvalues to be searched
MKL_INT M0=10;                              //initial guess
MKL_INT M=N;
MKL_INT info;                              //info of the outcome
double epsout;                             //contains relative error
MKL_INT loop;                              //ouput information
double E;                               //will contain the eigenvalues
double res;
double X[4*4];                             //initial subspace guess

dfeast_scsrgv(&UPLO,&N,AV,IA,JA,BV,IB,JB,fpm,&epsout,&loop,&Emin,&Emax,&M0,E,X,&M,res,&info);
cout<<"INFO="<<info<<endl;

return 0;
}

[/cpp]

1 Solution Moderator
201 Views

hello,

this is the problem with documentation -- the initial guess for subspace dimension have to be like the follows  0<M0<=n

4 Replies Moderator
202 Views

hello,

this is the problem with documentation -- the initial guess for subspace dimension have to be like the follows  0<M0<=n Moderator
201 Views

the documentation would be updated the next update of MKL ( 11.1 update 2 ) - we will let you know when it will happens, Beginner
201 Views

Thank you, that solved the problem Moderator
201 Views

fyi -- the documentation has been updated into the version 11.1.2 released yesterday. You can check this update and let us know if any further issue/improvements we have to do with mkl's doc. regards, gennady. 