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

Class ReplicationOperator

source code

              object --+    
                       |    
interface.LinearOperator --+
                           |
                          ReplicationOperator

Generate an operator which replicates the input vector n times.

Instance Methods [hide private]
 
__init__(self, shape, rep_num, **kwargs)
Parameters ---------- shape : length 2 tuple.
source code
 
__repr__(self)
repr(x)
source code

Inherited from interface.LinearOperator: __add__, __iadd__, __imul__, __isub__, __mul__, __neg__, __pow__, __radd__, __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, rep_num, **kwargs)
(Constructor)

source code 

Parameters
----------
shape : length 2 tuple.
    The shape of the operator.

rep_num : int
    The number of replications.

Returns
-------
A ReplicationOperator instance.

Exemple
-------
>>> import numpy as np
>>> import linear_operators as lo
>>> R = lo.ReplicationOperator((4, 2), 2)
>>> R.todense()
array([[ 1.,  0.],
       [ 0.,  1.],
       [ 1.,  0.],
       [ 0.,  1.]])

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)