FlatteningOperator

class odl.FlatteningOperator(*args, **kwargs)

Bases: Operator

Operator that reshapes the object as a column vector.

The operation performed by this operator is

FlatteningOperator(x) == ravel(x)

The range of this operator is always a TensorSpace, i.e., even if the domain is a discrete function space.

__init__(domain)[source]

Initialize a new instance.

Parameters

domainTensorSpace

Set of elements on which this operator acts.

Examples

>>> space = odl.uniform_discr([-1, -1], [1, 1], shape=(2, 3))
>>> op = odl.FlatteningOperator(space)
>>> op.range
rn(6)
>>> x = space.element([[1, 2, 3],
...                    [4, 5, 6]])
>>> op(x)
rn(6).element([ 1.,  2.,  3.,  4.,  5.,  6.])