39 __declspec( target(mic) )
void getpartialinv_mp_dgetpartialinv_(
int *sizeA,
int *nonzerosA,
double *a,
int *ia,
int *ja,
int *sizeInv,
double *invA,
int *error);
53 int nrhs,
const mxArray *prhs[])
60 int sizeAn_fort, nonzerosA_fort, sizeInv_fort;
63 int *ia_fort, *ja_fort;
65 double* a, *invA_fort;
71 mexErrMsgIdAndTxt (
"MATLAB:timestwo:nInput",
"Two inputs required.");
74 mexErrMsgIdAndTxt (
"MATLAB:timestwo:nOutput",
"Too many output arguments.");
80 if ((mxIsDouble(prhs[0]) == 0)) {
81 mexErrMsgIdAndTxt (
"MATLAB:timestwo:NonDouble",
"Input must be a double.");
85 if ((mxIsComplex(prhs[0]) != 0) ) {
86 mexErrMsgIdAndTxt (
"MATLAB:convec:NonReal",
"Inputs must be real.");
90 nonzerosA = mxGetNzmax(prhs[0]);
91 sizeAm = mxGetM(prhs[0]);
92 sizeAn = mxGetN(prhs[0]);
94 ia = mxGetJc(prhs[0]);
95 ja = mxGetIr(prhs[0]);
98 ia_fort = (
int*)malloc( (sizeAm+1)*
sizeof(int) );
99 ja_fort = (
int*)malloc( nonzerosA*
sizeof(
int) );
102 for( idx=1; idx<=sizeAm+1; idx++ ) {
103 ia_fort[idx-1] = (int)ia[idx-1] + 1;
106 for( idx=1; idx<=nonzerosA; idx++ ) {
107 ja_fort[idx-1] = (int)ja[idx-1] + 1;
111 sizeInv = *mxGetPr(prhs[1]);
114 plhs[0] = mxCreateDoubleMatrix(sizeInv, sizeInv, mxREAL);
116 invA_fort = (
double *)mxGetData(plhs[0]);
118 sizeAn_fort = (int)sizeAn;
119 nonzerosA_fort = (int)nonzerosA;
120 sizeInv_fort = (int)sizeInv;
123 #pragma offload target(mic) \ 124 in(sizeAn_fort, nonzerosA_fort, sizeInv_fort) \ 125 in(a:length(nonzerosA)) \ 126 in(ia_fort:length(sizeAn+1)) \ 127 in(ja_fort:length(nonzerosA)) \ 128 out(invA_fort:length(sizeInv_fort*sizeInv_fort)) \ 133 #ifdef __INTEL_COMPILER 136 __getpartialinv_MOD_dgetpartialinv(&sizeAn_fort, &nonzerosA_fort, a, ia_fort, ja_fort, &sizeInv_fort, invA_fort, &error);
149 sprintf(output,
"PARDISO solver ended with error flag: %i\n", error);
150 mexErrMsgIdAndTxt (
"EQuUs:dgetPartialInv:PardisoError", output);
154 mexPrintf(
"Pardiso calculations finished for real matrix\n");
void getpartialinv_mp_dgetpartialinv_(int *sizeA, int *nonzerosA, double *a, int *ia, int *ja, int *sizeInv, double *invA, int *error)
For specification see getpartialinv::dgetpartialinv.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Gateway routine to call the dgetpartialinv subroutine from the mkl_EQuUs package.