Package linear_operators :: Module operators :: Class SliceOperator
[hide private]
[frames] | no frames]

Class SliceOperator

source code

              object --+    
                       |    
interface.LinearOperator --+
                           |
                          SliceOperator


Perform slicing on the input vector.

Attributes
----------
slice: slice
   Slice applied to the input vector.

Instance Methods [hide private]
 
__init__(self, shape, slice, **kwargs)
Exemple ------- >>> S = lo.SliceOperator((2, 4), slice(None, None, 2)) >>> S.todense() array([[ 1., 0., 0., 0.], [ 0., 0., 1., 0.]])
source code

Inherited from interface.LinearOperator: __add__, __iadd__, __imul__, __isub__, __mul__, __neg__, __pow__, __radd__, __repr__, __rmul__, __rsub__, __sub__, matmat, matvec, todense

Inherited from interface.LinearOperator (private): _matmat

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from interface.LinearOperator: T

Inherited from object: __class__

Method Details [hide private]

__init__(self, shape, slice, **kwargs)
(Constructor)

source code 


Exemple
-------
>>> S = lo.SliceOperator((2, 4), slice(None, None, 2))
>>> S.todense()
array([[ 1.,  0.,  0.,  0.],
       [ 0.,  0.,  1.,  0.]])

>>> S.T.todense()
array([[ 1.,  0.],
       [ 0.,  0.],
       [ 0.,  1.],
       [ 0.,  0.]])

Overrides: object.__init__