# Sstrange behavior MKL-FEAST

## Sstrange behavior MKL-FEAST

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.

```
#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[128];

//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[0]=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[10];                               //will contain the eigenvalues

double res[N];

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;

}
```

publicaciones de 5 / 0 nuevos
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

hello,

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