3ee2aad83c4d67758886398a5ccfd353f81a71f9,scipy/sparse/linalg/interface.py,_PowerLinearOperator,__init__,#_PowerLinearOperator#Any#Any#,318

Before Change


            raise ValueError("square LinearOperator expected as A")
        if not isintlike(p):
            raise ValueError("integer expected as p")
        super(_PowerLinearOperator, self).__init__(A.shape,
                self.matvec, self.rmatvec, self.matmat,
                _get_dtype([A]))
        self.args = (A, p)

    def _power(self, fun, x):
        res = np.array(x, copy=True)

After Change




class _PowerLinearOperator(LinearOperator):
    def __init__(self, A, p):
        if not isinstance(A, LinearOperator):
            raise ValueError("LinearOperator expected as A")
        if A.shape[0] != A.shape[1]:
            raise ValueError("square LinearOperator expected, got %r" % A)
        if not isintlike(p):
            raise ValueError("integer expected as p")

        self.args = (A, p)
        self.dtype = _get_dtype([A])
        self.shape = A.shape

    def _power(self, fun, x):
        res = np.array(x, copy=True)
        for i in range(self.args[1]):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: scipy/scipy
Commit Name: 3ee2aad83c4d67758886398a5ccfd353f81a71f9
Time: 2014-12-26
Author: larsmans@gmail.com
File Name: scipy/sparse/linalg/interface.py
Class Name: _PowerLinearOperator
Method Name: __init__


Project Name: scipy/scipy
Commit Name: 3ee2aad83c4d67758886398a5ccfd353f81a71f9
Time: 2014-12-26
Author: larsmans@gmail.com
File Name: scipy/sparse/linalg/interface.py
Class Name: _ScaledLinearOperator
Method Name: __init__


Project Name: scipy/scipy
Commit Name: 3ee2aad83c4d67758886398a5ccfd353f81a71f9
Time: 2014-12-26
Author: larsmans@gmail.com
File Name: scipy/sparse/linalg/interface.py
Class Name: _SumLinearOperator
Method Name: __init__