use iter4 interface in moba
#include "iter/prox.h"
#include "iter/vec.h"
#include "iter/italgos.h"
-#include "iter/iter3.h"
#include "iter/iter2.h"
+#include "iter/iter3.h"
+#include "iter/iter4.h"
#include "iter_l1.h"
@@ -274,32 +275,6 @@ static const struct operator_p_s* T1inv_p_create(const struct mdb_irgnm_l1_conf*
-struct iterT1_nlop_s {
-
- INTERFACE(iter_op_data);
-
- struct nlop_s nlop;
-};
-
-DEF_TYPEID(iterT1_nlop_s);
-
-
-static void nlop_for_iter(iter_op_data* _o, float* _dst, const float* _src)
-{
- const auto nlop = CAST_DOWN(iterT1_nlop_s, _o);
-
- operator_apply_unchecked(nlop->nlop.op, (complex float*)_dst, (const complex float*)_src);
-}
-
-static void nlop_der_iter(iter_op_data* _o, float* _dst, const float* _src)
-{
- const auto nlop = CAST_DOWN(iterT1_nlop_s, _o);
-
- assert(2 == operator_nr_args(nlop->nlop.op));
- linop_forward_unchecked(nlop->nlop.derivative[0], (complex float*)_dst, (const complex float*)_src);
-}
-
-
void mdb_irgnm_l1(const struct mdb_irgnm_l1_conf* conf,
const long dims[],
@@ -313,17 +288,11 @@ void mdb_irgnm_l1(const struct mdb_irgnm_l1_conf* conf,
assert(M * sizeof(float) == md_calc_size(cd->N, cd->dims) * cd->size);
assert(N * sizeof(float) == md_calc_size(dm->N, dm->dims) * dm->size);
- struct iterT1_nlop_s nl_data = { { &TYPEID(iterT1_nlop_s) }, *nlop };
-
const struct operator_p_s* inv_op = T1inv_p_create(conf, dims, nlop);
- irgnm2(conf->c2->iter, conf->c2->alpha, 0., conf->c2->alpha_min, conf->c2->redu, N, M, select_vecops(src),
- (struct iter_op_s){ nlop_for_iter, CAST_UP(&nl_data) },
- (struct iter_op_s){ nlop_der_iter, CAST_UP(&nl_data) },
- OPERATOR_P2ITOP(inv_op),
- dst, NULL, src,
- (struct iter_op_s){ NULL, NULL },
- NULL);
+ iter4_irgnm2(CAST_UP(conf->c2), nlop,
+ N, dst, NULL, M, src, inv_op,
+ (struct iter_op_s){ NULL, NULL });
operator_p_free(inv_op);
}
