70 |
|
nip->ns = nsamps; |
71 |
|
nip->dmin = 1; /* default minimum diameter */ |
72 |
|
nip->smf = NI2DSMF; /* default smoothing factor */ |
73 |
+ |
nip->c_data = NULL; |
74 |
|
nip->da = NULL; |
75 |
|
/* caller must assign spt[] array */ |
76 |
|
return(nip); |
80 |
|
INTERP2 * |
81 |
|
interp2_realloc(INTERP2 *ip, int nsamps) |
82 |
|
{ |
83 |
+ |
INTERP2 *old_ip = ip; |
84 |
+ |
|
85 |
|
if (ip == NULL) |
86 |
|
return(interp2_alloc(nsamps)); |
87 |
|
if (nsamps <= 1) { |
95 |
|
ip->da = NULL; |
96 |
|
} |
97 |
|
ip = (INTERP2 *)realloc(ip, sizeof(INTERP2)+sizeof(float)*2*(nsamps-1)); |
98 |
< |
if (ip == NULL) |
99 |
< |
return(NULL); |
98 |
> |
if (ip == NULL) { |
99 |
> |
if (nsamps <= ip->ns) |
100 |
> |
ip = old_ip; |
101 |
> |
else |
102 |
> |
return(NULL); |
103 |
> |
} |
104 |
|
ip->ns = nsamps; |
105 |
|
return(ip); |
106 |
|
} |
273 |
|
sord[i].si = i; |
274 |
|
sord[i].dm = cosd*ip->spt[i][0] + sind*ip->spt[i][1]; |
275 |
|
} |
276 |
< |
qsort(sord, ip->ns, sizeof(SAMPORD), &cmp_spos); |
276 |
> |
qsort(sord, ip->ns, sizeof(SAMPORD), cmp_spos); |
277 |
|
} |
278 |
|
|
279 |
|
/* (Re)compute anisotropic basis function interpolant (normally automatic) */ |