FlatteningOperator¶
- class odl.operator.tensor_ops.FlatteningOperator(*args, **kwargs)[source]¶
Bases:
OperatorOperator 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.- Attributes:
adjointAdjoint of the flattening, a scaled version of the
inverse.domainSet of objects on which this operator can be evaluated.
inverseOperator that reshapes to original shape.
is_functionalTrueif this operator's range is aField.is_linearTrueif this operator is linear.orderorder of the flattening operation.
rangeSet in which the result of an evaluation of this operator lies.
Methods
__call__(x[, out])Return
self(x[, out, **kwargs]).derivative(point)Return the operator derivative at
point.norm([estimate])Return the operator norm of this operator.
- __init__(domain, order='C')[source]¶
Initialize a new instance.
- Parameters:
- domain
TensorSpace Set of elements on which this operator acts.
- order{'C', 'F'}, optional
If provided, flattening is performed in this order.
'C'means that that the last index is changing fastest, while in'F'ordering, the first index changes fastest.
- domain
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.]) >>> op = odl.FlatteningOperator(space, order='F') >>> op(x) rn(6).element([ 1., 4., 2., 5., 3., 6.])