summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepapoutsellis <epapoutsellis@gmail.com>2019-04-25 10:08:08 +0100
committerepapoutsellis <epapoutsellis@gmail.com>2019-04-25 10:08:08 +0100
commitf1da1e2bda23a978c92b91a5d533c7d4b331acc3 (patch)
tree7158313192b8291439dd1bc4b719328ac1ac6f86
parente05bed848d826d219efba6f78354b4c3f76161cc (diff)
downloadframework-f1da1e2bda23a978c92b91a5d533c7d4b331acc3.tar.gz
framework-f1da1e2bda23a978c92b91a5d533c7d4b331acc3.tar.bz2
framework-f1da1e2bda23a978c92b91a5d533c7d4b331acc3.tar.xz
framework-f1da1e2bda23a978c92b91a5d533c7d4b331acc3.zip
change verbose format
-rwxr-xr-xWrappers/Python/ccpi/optimisation/algorithms/Algorithm.py20
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