281 |
|
RBFNODE *rbf; |
282 |
|
|
283 |
|
for (rbf = dsf_list; rbf != NULL; rbf = rbf->next) |
284 |
< |
if (rbf->ord == ord); |
284 |
> |
if (rbf->ord == ord) |
285 |
|
return(rbf); |
286 |
|
return(NULL); |
287 |
|
} |
370 |
|
/* write out as sparse data */ |
371 |
|
n = mtx_nrows(mig) * mtx_ncols(mig); |
372 |
|
for (i = 0; i < n; i++) { |
373 |
< |
if (zerocnt >= 0xff) { |
374 |
< |
putint(zerocnt, 1, ofp); zerocnt = 0; |
373 |
> |
if (zerocnt == 0xff) { |
374 |
> |
putint(0xff, 1, ofp); zerocnt = 0; |
375 |
|
} |
376 |
|
if (mig->mtx[i] != 0) { |
377 |
|
putint(zerocnt, 1, ofp); zerocnt = 0; |
441 |
|
rbfh.invec[0] = getflt(ifp); |
442 |
|
rbfh.invec[1] = getflt(ifp); |
443 |
|
rbfh.invec[2] = getflt(ifp); |
444 |
+ |
rbfh.vtotal = getflt(ifp); |
445 |
|
rbfh.nrbf = getint(4, ifp); |
445 |
– |
if (!new_input_vector(rbfh.invec)) |
446 |
– |
return(0); |
446 |
|
newrbf = (RBFNODE *)malloc(sizeof(RBFNODE) + |
447 |
|
sizeof(RBFVAL)*(rbfh.nrbf-1)); |
448 |
|
if (newrbf == NULL) |
486 |
|
memset(newmig->mtx, 0, sizeof(float)*n); |
487 |
|
for (i = 0; ; ) { /* read sparse data */ |
488 |
|
int zc = getint(1, ifp) & 0xff; |
490 |
– |
if (zc == 0xff) { |
491 |
– |
i += 0xff; |
492 |
– |
continue; |
493 |
– |
} |
489 |
|
if ((i += zc) >= n) |
490 |
|
break; |
491 |
+ |
if (zc == 0xff) |
492 |
+ |
continue; |
493 |
|
newmig->mtx[i++] = getflt(ifp); |
494 |
|
} |
495 |
|
if (feof(ifp)) |