Skip to content

Commit

Permalink
add backwards compatibility mode
Browse files Browse the repository at this point in the history
  • Loading branch information
uecker committed Jan 19, 2025
1 parent 61741be commit a9accdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/misc/opts.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ static void check_options(int n, const struct opt_s opts[n ?: 1])
if (f[c])
error("duplicate option: %c\n", opts[i].c);

f[c] = true;
if (c)
f[c] = true;

if ((OPT_SPECIAL != opts[i].type) && (NULL != opts[i].conv))
error("Custom conversion functions are only allowed in OPT_SPECIAL\n");
Expand Down
6 changes: 4 additions & 2 deletions src/nlinv.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,15 @@ int main_nlinv(int argc, char* argv[argc])
bool pattern_for_each_coil = false;
float oversampling_coils = -1.;

const char *rR = use_compat_to_version("v0.9.00") ? "R " : " R";

const struct opt_s opts[] = {

OPT_UINT('i', &conf.iter, "iter", "Number of Newton steps"),
OPT_FLOAT('r', &conf.redu, "", "(reduction factor)"),
OPTL_FLOAT(rR[0], "reduction-factor", &conf.redu, "q", "reduction factor"),
OPTL_FLOAT(0, "alpha", &conf.alpha, "val", "(alpha in first iteration)"),
OPT_FLOAT('M', &conf.alpha_min, "", "(minimum for regularization)"),
{ 'R', NULL, true, OPT_SPECIAL, opt_reg, conf.regs, "<T>:A:B:C", "generalized regularization options (-Rh for help)" },
{ rR[1], NULL, true, OPT_SPECIAL, opt_reg, conf.regs, "<T>:A:B:C", "generalized regularization options (-Rh for help)" },
OPTL_INT(0, "reg-iter", &conf.iter_reg, "iter", "Number of Newton steps with regularization (-1 means all)"),
OPT_INT('d', &debug_level, "level", "Debug level"),
OPT_SET('c', &conf.rvc, "Real-value constraint"),
Expand Down

0 comments on commit a9accdb

Please sign in to comment.