39 __declspec( target(mic) )
void getdiaginv_mp_dgetdiaginv_(
int *sizeA,
int *nonzerosA,
double *a,
int *ia,
int *ja,
double *invA,
int *error);
53 int nrhs,
const mxArray *prhs[])
59 int sizeAn_fort, nonzerosA_fort;
62 int *ia_fort, *ja_fort;
64 double* a, *invA_fort;
70 mexErrMsgIdAndTxt (
"MATLAB:timestwo:nInput",
"One input required.");
73 mexErrMsgIdAndTxt (
"MATLAB:timestwo:nOutput",
"Too many output arguments.");
79 if ((mxIsDouble(prhs[0]) == 0)) {
80 mexErrMsgIdAndTxt (
"MATLAB:timestwo:NonDouble",
"Input must be a double.");
84 if ((mxIsComplex(prhs[0]) != 0) ) {
85 mexErrMsgIdAndTxt (
"MATLAB:convec:NonReal",
"Input must be real.");
89 nonzerosA = mxGetNzmax(prhs[0]);
90 sizeAm = mxGetM(prhs[0]);
91 sizeAn = mxGetN(prhs[0]);
93 ia = mxGetJc(prhs[0]);
94 ja = mxGetIr(prhs[0]);
97 ia_fort = (
int*)malloc( (sizeAm+1)*
sizeof(int) );
98 ja_fort = (
int*)malloc( nonzerosA*
sizeof(
int) );
101 for( idx=1; idx<=sizeAm+1; idx++ ) {
102 ia_fort[idx-1] = (int)ia[idx-1] + 1;
105 for( idx=1; idx<=nonzerosA; idx++ ) {
106 ja_fort[idx-1] = (int)ja[idx-1] + 1;
111 plhs[0] = mxCreateDoubleMatrix(sizeAn, 1, mxREAL);
113 invA_fort = (
double *)mxGetData(plhs[0]);
115 sizeAn_fort = (int)sizeAn;
116 nonzerosA_fort = (int)nonzerosA;
119 #pragma offload target(mic) \ 120 in(sizeAn_fort, nonzerosA_fort) \ 121 in(a:length(nonzerosA)) \ 122 in(ia_fort:length(sizeAn+1)) \ 123 in(ja_fort:length(nonzerosA)) \ 124 out(invA_fort:length(sizeAn_fort)) \ 129 #ifdef __INTEL_COMPILER 132 __getdiaginv_MOD_dgetdiaginv(&sizeAn_fort, &nonzerosA_fort, a, ia_fort, ja_fort, invA_fort, &error);
145 sprintf(output,
"PARDISO solver ended with error flag: %i\n", error);
146 mexErrMsgIdAndTxt (
"EQuUs:dgetPartialInv:PardisoError", output);
150 mexPrintf(
"Pardiso calculations finished for real matrix\n");
void getdiaginv_mp_dgetdiaginv_(int *sizeA, int *nonzerosA, double *a, int *ia, int *ja, double *invA, int *error)
For specification see getdiaginv::dgetdiaginv.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Gateway routine to call the dgetdiaginv subroutine from the mkl_EQuUs package.