summaryrefslogtreecommitdiffstats
path: root/Wrappers
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2019-03-21 16:23:14 +0000
committerEdoardo Pasca <edo.paskino@gmail.com>2019-03-21 16:23:14 +0000
commit27ea6509eaa294529c86567bf50def2d27966bb7 (patch)
tree9f13c85280d277752a6c5a4ce8c024dd514d8dab /Wrappers
parent757de9d5f43fd05cc05dd9e3bb96078a86948475 (diff)
downloadframework-27ea6509eaa294529c86567bf50def2d27966bb7.tar.gz
framework-27ea6509eaa294529c86567bf50def2d27966bb7.tar.bz2
framework-27ea6509eaa294529c86567bf50def2d27966bb7.tar.xz
framework-27ea6509eaa294529c86567bf50def2d27966bb7.zip
add Vaggelis fix, missing docstrings are added
Diffstat (limited to 'Wrappers')
-rw-r--r--Wrappers/Python/ccpi/optimisation/functions/BlockFunction.py34
1 files changed, 10 insertions, 24 deletions
diff --git a/Wrappers/Python/ccpi/optimisation/functions/BlockFunction.py b/Wrappers/Python/ccpi/optimisation/functions/BlockFunction.py
index d6c98c4..89dd9eb 100644
--- a/Wrappers/Python/ccpi/optimisation/functions/BlockFunction.py
+++ b/Wrappers/Python/ccpi/optimisation/functions/BlockFunction.py
@@ -12,45 +12,31 @@ from ccpi.optimisation.functions import Function
from ccpi.framework import BlockDataContainer
class BlockFunction(Function):
-
+ '''missing docstring'''
def __init__(self, operator, *functions):
-
+ '''missing docstring'''
self.functions = functions
- self.operator = operator
self.length = len(self.functions)
super(BlockFunction, self).__init__()
def __call__(self, x):
-
- tmp = self.operator.direct(x)
-
+ '''missing docstring'''
t = 0
- for i in range(tmp.shape[0]):
- t += self.functions[i](tmp.get_item(i))
+ for i in range(x.shape[0]):
+ t += self.functions[i](x.get_item(i))
return t
- def call_adjoint(self, x):
-
- tmp = operator.adjoint(x)
-
- t = 0
- for i in range(tmp.shape[0]):
- t += self.functions[i](tmp.get_item(i))
- return t
-
def convex_conjugate(self, x):
-
- ''' Convex_conjugate does not take into account the BlockOperator'''
+ '''Convex_conjugate does not take into account the BlockOperator'''
t = 0
for i in range(x.shape[0]):
- t += self.functions[i].convex_conjugate(x.get_item(i))
+ t += self.functions[i].convex_conjugate(x.get_item(i))
return t
def proximal_conjugate(self, x, tau, out = None):
-
- ''' proximal_conjugate does not take into account the BlockOperator'''
+ '''proximal_conjugate does not take into account the BlockOperator'''
out = [None]*self.length
for i in range(self.length):
out[i] = self.functions[i].proximal_conjugate(x.get_item(i), tau)
@@ -58,8 +44,7 @@ class BlockFunction(Function):
return BlockDataContainer(*out)
def proximal(self, x, tau, out = None):
-
- ''' proximal does not take into account the BlockOperator'''
+ '''proximal does not take into account the BlockOperator'''
out = [None]*self.length
for i in range(self.length):
out[i] = self.functions[i].proximal(x.get_item(i), tau)
@@ -67,4 +52,5 @@ class BlockFunction(Function):
return BlockDataContainer(*out)
def gradient(self,x, out=None):
+ '''missing docstring'''
pass \ No newline at end of file