| 35 |
|
mig->rbfv[1]->vtotal; |
| 36 |
|
|
| 37 |
|
n = 0; /* minimize EMD */ |
| 38 |
< |
transportSimplex(&srcSig, &dstSig, &lobe_distance, flow, &n); |
| 39 |
< |
|
| 38 |
> |
try { |
| 39 |
> |
transportSimplex(&srcSig, &dstSig, &lobe_distance, flow, &n); |
| 40 |
> |
} catch (...) { |
| 41 |
> |
fprintf(stderr, "%s: caught exception from transportSimplex()!\n", |
| 42 |
> |
progname); |
| 43 |
> |
exit(1); |
| 44 |
> |
} |
| 45 |
> |
if (n > mtx_nrows(mig)+mtx_ncols(mig)-1) { |
| 46 |
> |
fprintf(stderr, "%s: signature overflow in plan_transport()!\n", |
| 47 |
> |
progname); |
| 48 |
> |
exit(1); |
| 49 |
> |
} |
| 50 |
|
while (n-- > 0) /* assign sparse matrix */ |
| 51 |
|
mtx_coef(mig, flow[n].from, flow[n].to) = flow[n].amount; |
| 52 |
|
} |