diff options
author | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-02-14 14:13:42 +0000 |
---|---|---|
committer | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-02-14 14:13:42 +0000 |
commit | 7144216342686b49e4f759c2fdd8de4946db8fdb (patch) | |
tree | 1fedc52bfdded273bae0fb9bb34c3e74a5f71ce3 /src | |
parent | 10ece6fb4017738589e4cad309b9d4091a2745a3 (diff) |
Trap further downstream if IPR fails
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@7 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src')
-rw-r--r-- | src/ipr.c | 6 | ||||
-rw-r--r-- | src/ipr.h | 2 | ||||
-rw-r--r-- | src/main.c | 4 |
3 files changed, 7 insertions, 5 deletions
@@ -243,13 +243,13 @@ static void ipr_sort(ReflectionContext *rctx) { } -void ipr_reduce(ControlContext *ctx) { +int ipr_reduce(ControlContext *ctx) { Basis *basis; basis = ipr_choose_initial_basis(ctx); - if ( !basis ) return; ctx->reflectionctx->basis = basis; + if ( !basis ) return -1; /* Get rid of the original list and replace it with the prediction list */ reflection_clear(ctx->reflectionctx); @@ -259,5 +259,7 @@ void ipr_reduce(ControlContext *ctx) { /* Sort the reflections into order of increasing g */ ipr_sort(ctx->reflectionctx); + + return 0; } @@ -18,6 +18,6 @@ #include "control.h" -extern void ipr_reduce(ControlContext *ctx); +extern int ipr_reduce(ControlContext *ctx); #endif /* IPR_H */ @@ -58,8 +58,8 @@ static gint main_method_window_response(GtkWidget *method_window, gint response, val = mrc_read(ctx); } - if ( ctx->rmode == RECONSTRUCTION_PREDICTION ) { - ipr_reduce(ctx); + if ( !val && (ctx->rmode == RECONSTRUCTION_PREDICTION) ) { + val = ipr_reduce(ctx); } if ( val == 0 ) { |