Skip to content

Commit

Permalink
Documentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
MargaretDuff committed Nov 7, 2023
1 parent 0962313 commit 1eea20b
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions Wrappers/Python/cil/optimisation/operators/Operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ def norm(self, **kwargs):

def set_norm(self, norm=None):
'''Sets the norm of the operator to a custom value.
Parameter
---------
norm: Positive real valued number of `None`
Note
----
The passed values are cached so that when self.norm() is called, the saved value will be returned and not calculated via the power method.
If `None` is passed, the cache is cleared prompting the function to call the power method to calculate the norm the next time self.norm() is called.
'''

if norm is not None:
Expand Down Expand Up @@ -361,10 +370,16 @@ class ScaledOperator(Operator):
of the result of direct and adjoint of the operator with the scalar.
For the rest it behaves like the operator it holds.
:param operator: a Operator or LinearOperator
:param scalar: a scalar multiplier
Parameters
----------
operator: a Operator or LinearOperator
scalar: a scalar multiplier
Example:
Example
-------
The scaled operator behaves like the following:
.. code-block:: python
Expand All @@ -379,11 +394,6 @@ class ScaledOperator(Operator):
'''

def __init__(self, operator, scalar, **kwargs):
'''creator
:param operator: a Operator or LinearOperator
:param scalar: a scalar multiplier
:type scalar: Number'''

super(ScaledOperator, self).__init__(domain_geometry=operator.domain_geometry(),
range_geometry=operator.range_geometry())
Expand Down Expand Up @@ -420,9 +430,7 @@ def norm(self, **kwargs):
return numpy.abs(self.scalar) * self.operator.norm(**kwargs)

def is_linear(self):
'''returns whether the operator is linear
:returns: boolean '''
'''returns a `boolean` indicating whether the operator is linear '''
return self.operator.is_linear()


Expand Down

0 comments on commit 1eea20b

Please sign in to comment.