diff options
| -rwxr-xr-x | Wrappers/Python/ccpi/optimisation/algorithms/Algorithm.py | 20 | 
1 files changed, 17 insertions, 3 deletions
diff --git a/Wrappers/Python/ccpi/optimisation/algorithms/Algorithm.py b/Wrappers/Python/ccpi/optimisation/algorithms/Algorithm.py index ed95c3f..3c97480 100755 --- a/Wrappers/Python/ccpi/optimisation/algorithms/Algorithm.py +++ b/Wrappers/Python/ccpi/optimisation/algorithms/Algorithm.py @@ -145,13 +145,27 @@ class Algorithm(object):          if self.should_stop():              print ("Stop cryterion has been reached.")          i = 0 +         +        print("Iteration {:<5} Primal {:<5} Dual {:<5} PDgap".format('','',''))          for _ in self: +             +                          if verbose and self.iteration % self.update_objective_interval == 0: -                print ("Iteration {}/{}, objective {}".format(self.iteration,  -                       self.max_iteration, self.get_last_objective()) ) +                #pass +                print( "{}/{} {:<5} {:.4f} {:<5} {:.4f} {:<5} {:.4f}".\ +                      format(self.iteration, self.max_iteration,'', \ +                             self.get_last_objective()[0],'',\ +                             self.get_last_objective()[1],'',\ +                             self.get_last_objective()[2])) +                 +                 +                #print ("Iteration {}/{}, Primal, Dual, PDgap = {}".format(self.iteration,  +                #       self.max_iteration, self.get_last_objective()) ) +                 +                              else:                  if callback is not None: -                    callback(self.iteration, self.get_last_objective()) +                    callback(self.iteration, self.get_last_objective(), self.x)              i += 1              if i == iterations:                  break  | 
