summaryrefslogtreecommitdiffstats
path: root/Wrappers
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2019-07-02 10:07:20 +0100
committerEdoardo Pasca <edo.paskino@gmail.com>2019-07-02 10:07:20 +0100
commitc39a1a781b37f9d249c8dd533b6a150acebc650e (patch)
treee3fdc700ce35bad5c9e0dfdedbd1b465196ddf42 /Wrappers
parent5265eb1926ca362f786a0d2e216731ee4be8d97c (diff)
downloadframework-c39a1a781b37f9d249c8dd533b6a150acebc650e.tar.gz
framework-c39a1a781b37f9d249c8dd533b6a150acebc650e.tar.bz2
framework-c39a1a781b37f9d249c8dd533b6a150acebc650e.tar.xz
framework-c39a1a781b37f9d249c8dd533b6a150acebc650e.zip
added print of reached tolerance
Diffstat (limited to 'Wrappers')
-rwxr-xr-xWrappers/Python/ccpi/optimisation/algorithms/CGLS.py5
-rwxr-xr-xWrappers/Python/test/test_algorithms.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/Wrappers/Python/ccpi/optimisation/algorithms/CGLS.py b/Wrappers/Python/ccpi/optimisation/algorithms/CGLS.py
index 5a8341e..d3aea8e 100755
--- a/Wrappers/Python/ccpi/optimisation/algorithms/CGLS.py
+++ b/Wrappers/Python/ccpi/optimisation/algorithms/CGLS.py
@@ -115,6 +115,9 @@ class CGLS(Algorithm):
if flag:
self.update_objective()
- print (self.verbose_output())
+ if self.iteration > self._iteration[-1]:
+ print (self.verbose_output())
+ print('Tolerance is reached: {}'.format(self.tolerance))
+
return flag
diff --git a/Wrappers/Python/test/test_algorithms.py b/Wrappers/Python/test/test_algorithms.py
index 3bb3d57..4bcc95a 100755
--- a/Wrappers/Python/test/test_algorithms.py
+++ b/Wrappers/Python/test/test_algorithms.py
@@ -72,7 +72,7 @@ class TestAlgorithms(unittest.TestCase):
identity = Identity(ig)
alg = CGLS(x_init=x_init, operator=identity, data=b)
- alg.max_iteration = 1
+ alg.max_iteration = 200
alg.run(20, verbose=True)
self.assertNumpyArrayAlmostEqual(alg.x.as_array(), b.as_array())