'mwIndex' does not name a type

1 Ansicht (letzte 30 Tage)
Zili Chai
Zili Chai am 7 Nov. 2017
Beantwortet: Steven Lord am 7 Nov. 2017
Environment: Matlab R2017a/Windows 10/MinGW64 Compiler (C++)
When I run the following codes, I encounter some errors:
# include "math.h"
void CSR_VecMult_CaABC_double(
const int k, const int m, const double alpha,
const double *val, const mwIndex *indx,
const mwIndex *pntrb,
const double *b,
double *c)
{
double t;
const double *pval;
int i,j,jb,je;
pval = val;
for (i=0;i!=m;i++) {
t = 0;
jb = pntrb[i];
je = pntrb[i+1];
for (j=jb;j!=je;j++)
t += alpha * b[indx[j]] * (*pval++);
c[i] += t;
}
}
The warning is as follow:
>>mex -largeArrayDims a_times_b_cmplx.cpp
D:\Ncut_9\a_times_b_cmplx.cpp:52:43: error: 'mwIndex' does not name a type
const double *val, const mwIndex *indx,
^
D:\Ncut_9\a_times_b_cmplx.cpp:53:24: error: 'mwIndex' does not name a type
const mwIndex *pntrb,
Actually I've tried to use another compiler such as Visual C++, but more errors occurred. :-(

Antworten (1)

Steven Lord
Steven Lord am 7 Nov. 2017
Did you include the right header file?

Kategorien

Mehr zu C MEX 文件应用程序 finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!