From 7033c692bd836ca300fc6d91ce7cd733a2342cde Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Wed, 25 Oct 2017 12:25:59 +0100 Subject: Added print to screen to debug faulty FGP_TV Bug #2 came from not initializing lambda but mu. --- src/Python/fista_module.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/Python') diff --git a/src/Python/fista_module.cpp b/src/Python/fista_module.cpp index c36329e..f8fd812 100644 --- a/src/Python/fista_module.cpp +++ b/src/Python/fista_module.cpp @@ -338,7 +338,7 @@ bp::list FGP_TV(np::ndarray input, double d_mu, int iter, double d_epsil, int me A = reinterpret_cast(input.get_data()); //mu = (float)mxGetScalar(prhs[1]); /* regularization parameter */ - mu = (float)d_mu; + lambda = (float)d_mu; //iter = 35; /* default iterations number */ @@ -408,15 +408,17 @@ bp::list FGP_TV(np::ndarray input, double d_mu, int iter, double d_epsil, int me /* begin iterations */ for (ll = 0; ll 3) { Obj_func2D(A, D, P1, P2, lambda, dimX, dimY); + std::cout << "Obj_func2D D[0] " << D[0]<< " A[0]" << A[0] << " R1[0] " << R1[0] << " R2[0] " << R2[0] << " lambda " << lambda << " dimX " << dimX << " dimY " << dimY << std::endl; funcval = 0.0f; for (j = 0; j 2) { if (re > re_old) { Obj_func2D(A, D, P1, P2, lambda, dimX, dimY); + std::cout << "Obj_func2D D[0] " << D[0]<< " A[0]" << A[0] << " R1[0] " << R1[0] << " R2[0] " << R2[0] << " lambda " << lambda << " dimX " << dimX << " dimY " << dimY << std::endl; funcval = 0.0f; for (j = 0; j