ComponentProjection¶
- class odl.operator.pspace_ops.ComponentProjection(*args, **kwargs)[source]¶
Bases:
Operator
Projection onto the subspace identified by an index.
For a product space , the component projection
is given by for an element .
More generally, for an index set , the projection operator is defined by .
Note that this is a special case of a product space operator where the "operator matrix" has only one row and contains only identity operators.
- Attributes:
adjoint
The adjoint operator.
domain
Set of objects on which this operator can be evaluated.
index
Index of the subspace.
inverse
Return the operator inverse.
is_functional
True
if this operator's range is aField
.is_linear
True
if this operator is linear.range
Set 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__(space, index)[source]¶
Initialize a new instance.
- Parameters:
- space
ProductSpace
Space to project from.
- indexint, slice, or list
Indices defining the subspace. If
index
is not an integer, theOperator.range
of this operator is also aProductSpace
.
- space
Examples
>>> r1 = odl.rn(1) >>> r2 = odl.rn(2) >>> r3 = odl.rn(3) >>> pspace = odl.ProductSpace(r1, r2, r3)
Projection on n-th component:
>>> proj = odl.ComponentProjection(pspace, 0) >>> x = [[1], ... [2, 3], ... [4, 5, 6]] >>> proj(x) rn(1).element([ 1.])
Projection on sub-space:
>>> proj = odl.ComponentProjection(pspace, [0, 2]) >>> proj(x) ProductSpace(rn(1), rn(3)).element([ [ 1.], [ 4., 5., 6.] ])