void Multiply(RLSMatrix a, RLSMatrix b, RLSMatrix* r)
{
Initrpos(&a);
Initrpos(&b);
int num[MAXSIZE + 1];
int tp =0,brow=0,t= 0,q=0,c=0;
if (a.cn!=b.rn)
{
printf("wrong input");
}
r->cn = b.cn;
r->rn = a.rn;
r->nz = 0; //进行初始化
if (a.nz * b.nz)
{
int i = 0;
for (i = 1; i <= a.rn; i++)
{
num[i] = 0;
r->rpos[i] = r->nz + 1;
if (i < a.rn)
{
tp = a.rpos[i + 1];
}
else {
tp = a.nz + 1;
}
int p = 0;
for (p = a.rpos[i]; p < tp; p++)
{
brow = a.data[p].col;
if (brow < b.rn) t = b.rpos[brow + 1];
else { t = b.nz + 1; }
for (q = b.rpos[brow]; q < t; q++)
{
c = b.data[q].col;
num[c] += a.data[p].e * b.data[q].e;
}
}
for (c = 1; c <= b.cn; c++)
{
if (num[c])
{
if (++r->nz > MAXSIZE) printf("wrong index");
r->data[r->nz].row = i;
r->data[r->nz].col = c;
r->data[r->nz].e = num[c];
}
}
}
}
}
请问这里报错是什么原因?