def __call__(self, x, out=None, **kwargs):
        """Return ``self(x[, out, **kwargs])``.

        Implementation of the call pattern ``op(x)`` with the private
        ``_call()`` method and added error checking.

        Parameters
        ----------
        x : `domain` `element-like`
            An object which can be converted into an element of this
            operator's domain with the ``self.domain.element`` method.
            The operator is applied to this object, which is treated
            as immutable, hence it is not modified during evaluation.
        out : `range` element, optional
            An object in the operator range to which the result of the
            operator evaluation is written. The result is independent
            of the initial state of this object.
        kwargs :
            Passed on to the underlying implementation in `_call`.

        Returns
        -------
        out : `range` element
            Result of the operator evaluation. If ``out`` was provided,
            the returned object is a reference to it.

        Examples
        --------
        >>> rn = odl.rn(3)
        >>> op = odl.ScalingOperator(rn, 2.0)
        >>> x = rn.element([1, 2, 3])

        Out-of-place evaluation:

        >>> op(x)
        rn(3).element([ 2.,  4.,  6.])

        In-place evaluation:

        >>> y = rn.element()
        >>> op(x, out=y)
        rn(3).element([ 2.,  4.,  6.])
        >>> y
        rn(3).element([ 2.,  4.,  6.])

        See Also
        --------
        _call : Implementation of the method
        """
        if x not in self.domain:
            try:
                x = self.domain.element(x)
            except (TypeError, ValueError):
                raise OpDomainError(
                    'unable to cast {!r} to an element of '
                    'the domain {!r}'.format(x, self.domain))

        if out is not None:  # In-place evaluation
            if out not in self.range:
                raise OpRangeError('`out` {!r} not an element of the range '
                                   '{!r} of {!r}'
                                   ''.format(out, self.range, self))

            if self.is_functional:
                raise TypeError('`out` parameter cannot be used '
                                'when range is a field')

            result = self._call_in_place(x, out=out, **kwargs)
            if result is not None and result is not out:
                raise ValueError('`op` returned a different value than `out`. '
                                 'With in-place evaluation, the operator can '
                                 'only return nothing (`None`) or the `out` '
                                 'parameter.')

        else:  # Out-of-place evaluation
            out = self._call_out_of_place(x, **kwargs)

            if out not in self.range:
                try:
                    out = self.range.element(out)
                except (TypeError, ValueError):
                    raise OpRangeError(
                        'unable to cast {!r} to an element of '
                        'the range {!r}'.format(out, self.range))
        return out
def __call__ ( self , x , out = None , ** kwargs ) : if x not in self . domain : try : x = self . domain . element ( x ) except ( TypeError , ValueError ) : raise OpDomainError ( 'unable to cast {!r} to an element of ' 'the domain {!r}' . format ( x , self . domain ) ) if out is not None : if out not in self . range : raise OpRangeError ( '`out` {!r} not an element of the range ' '{!r} of {!r}' '' . format ( out , self . range , self ) ) if self . is_functional : raise TypeError ( '`out` parameter cannot be used ' 'when range is a field' ) result = self . _call_in_place ( x , out = out , ** kwargs ) if result is not None and result is not out : raise ValueError ( '`op` returned a different value than `out`. ' 'With in-place evaluation, the operator can ' 'only return nothing (`None`) or the `out` ' 'parameter.' ) else : out = self . _call_out_of_place ( x , ** kwargs ) if out not in self . range : try : out = self . range . element ( out ) except ( TypeError , ValueError ) : raise OpRangeError ( 'unable to cast {!r} to an element of ' 'the range {!r}' . format ( out , self . range ) ) return out
Return ``self(x[, out, **kwargs])``.

        Implementation of the call pattern ``op(x)`` with the private
        ``_call()`` method and added error checking.

        Parameters
        ----------
        x : `domain` `element-like`
            An object which can be converted into an element of this
            operator's domain with the ``self.domain.element`` method.
            The operator is applied to this object, which is treated
            as immutable, hence it is not modified during evaluation.
        out : `range` element, optional
            An object in the operator range to which the result of the
            operator evaluation is written. The result is independent
            of the initial state of this object.
        kwargs :
            Passed on to the underlying implementation in `_call`.

        Returns
        -------
        out : `range` element
            Result of the operator evaluation. If ``out`` was provided,
            the returned object is a reference to it.

        Examples
        --------
        >>> rn = odl.rn(3)
        >>> op = odl.ScalingOperator(rn, 2.0)
        >>> x = rn.element([1, 2, 3])

        Out-of-place evaluation:

        >>> op(x)
        rn(3).element([ 2.,  4.,  6.])

        In-place evaluation:

        >>> y = rn.element()
        >>> op(x, out=y)
        rn(3).element([ 2.,  4.,  6.])
        >>> y
        rn(3).element([ 2.,  4.,  6.])

        See Also
        --------
        _call : Implementation of the method