33 #define lapack_int long 47 int nrhs,
const mxArray *prhs[])
52 mwSize sizeAm, sizeAn;
53 mwSize sizeBm, sizeBn;
59 double *alphar, *alphai, *beta;
60 double *l_eigvec, *r_eigvec;
73 mexErrMsgIdAndTxt (
"MATLAB:dggev:nInput",
"Two inputs required.");
76 mexErrMsgIdAndTxt (
"MATLAB:dggev:nOutput",
"Too many output arguments.");
82 if ((mxIsDouble(prhs[0]) == 0) && (mxIsDouble(prhs[1]) == 0)) {
83 mexErrMsgIdAndTxt (
"MATLAB:dggev:NonDouble",
"Inputs must be both a double.");
87 if ((mxIsComplex(prhs[0]) != 0) && (mxIsComplex(prhs[1]) != 0)) {
88 mexErrMsgIdAndTxt (
"MATLAB:dggev:NonReal",
"Inputs must be both real.");
92 sizeAm = mxGetM(prhs[0]);
93 sizeAn = mxGetN(prhs[0]);
94 sizeBm = mxGetM(prhs[1]);
95 sizeBn = mxGetN(prhs[1]);
101 plhs[0] = mxCreateDoubleMatrix(sizeAm, 1, mxREAL);
102 plhs[1] = mxCreateDoubleMatrix(sizeAm, 1, mxREAL);
103 plhs[2] = mxCreateDoubleMatrix(sizeAm, 1, mxREAL);
104 plhs[3] = mxCreateDoubleMatrix(sizeAm, sizeAn, mxREAL);
105 plhs[4] = mxCreateDoubleMatrix(sizeAm, sizeAn, mxREAL);
108 alphar = mxGetPr(plhs[0]);
109 alphai = mxGetPr(plhs[1]);
110 beta = mxGetPr(plhs[2]);
111 l_eigvec = mxGetPr(plhs[3]);
112 r_eigvec = mxGetPr(plhs[4]);
121 if ( sizeAm != sizeAn || sizeAm != sizeBm || sizeAm != sizeBn ) {
122 mexErrMsgIdAndTxt (
"MATLAB:dggev:MatrixSize",
"Inputs must be square matrices and must have the same dimensions.");
126 mexPrintf(
"Size of the matrix: %d\n", sizeAm_mkl);
129 info = LAPACKE_dggev( LAPACK_COL_MAJOR,
'V',
'V',
130 sizeAm_mkl, a, sizeAn_mkl, b,
131 sizeBm_mkl, alphar, alphai,
132 beta, l_eigvec, sizeAm_mkl, r_eigvec,
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Gateway routine to call the dggev function from LAPACKE package.