pub struct ParameterisedOp<'a, C: Op> {
pub op: &'a C,
pub p: &'a C::V,
}
Expand description
A wrapper for an operator that parameterises it with a parameter vector.
Fields§
§op: &'a C
§p: &'a C::V
Implementations§
Trait Implementations§
Source§impl<M, I> ConstantOp for ParameterisedOp<'_, ConstantClosure<M, I>>
impl<M, I> ConstantOp for ParameterisedOp<'_, ConstantClosure<M, I>>
Source§impl<M, I, J> ConstantOp for ParameterisedOp<'_, ConstantClosureWithAdjoint<M, I, J>>
impl<M, I, J> ConstantOp for ParameterisedOp<'_, ConstantClosureWithAdjoint<M, I, J>>
Source§impl<M, I, J> ConstantOp for ParameterisedOp<'_, ConstantClosureWithSens<M, I, J>>
impl<M, I, J> ConstantOp for ParameterisedOp<'_, ConstantClosureWithSens<M, I, J>>
Source§impl<M, I, J> ConstantOpSens for ParameterisedOp<'_, ConstantClosureWithSens<M, I, J>>
impl<M, I, J> ConstantOpSens for ParameterisedOp<'_, ConstantClosureWithSens<M, I, J>>
Source§fn sens_mul_inplace(&self, t: Self::T, v: &Self::V, y: &mut Self::V)
fn sens_mul_inplace(&self, t: Self::T, v: &Self::V, y: &mut Self::V)
Compute the product of the gradient of F wrt a parameter vector p with a given vector
J_p(x, t) * v
.
Note that the vector v is of size nparams() and the result is of size nstates().Source§fn sens_inplace(&self, t: Self::T, y: &mut Self::M)
fn sens_inplace(&self, t: Self::T, y: &mut Self::M)
Compute the gradient of the operator wrt a parameter vector p and store it in the matrix
y
.
y
should have been previously initialised using the output of Self::sens_sparsity.
The default implementation of this method computes the gradient using Self::sens_mul_inplace,
but it can be overriden for more efficient implementations.Source§fn _default_sens_inplace(&self, t: Self::T, y: &mut Self::M)
fn _default_sens_inplace(&self, t: Self::T, y: &mut Self::M)
Default implementation of the gradient computation (this is the default for Self::sens_inplace).
Source§fn sens(&self, t: Self::T) -> Self::M
fn sens(&self, t: Self::T) -> Self::M
Compute the gradient of the operator wrt a parameter vector p and return it.
See Self::sens_inplace for a non-allocating version.
fn sens_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§impl<M, I, J> ConstantOpSensAdjoint for ParameterisedOp<'_, ConstantClosureWithAdjoint<M, I, J>>
impl<M, I, J> ConstantOpSensAdjoint for ParameterisedOp<'_, ConstantClosureWithAdjoint<M, I, J>>
Source§fn sens_transpose_mul_inplace(&self, t: Self::T, v: &Self::V, y: &mut Self::V)
fn sens_transpose_mul_inplace(&self, t: Self::T, v: &Self::V, y: &mut Self::V)
Compute the product of the transpose of the gradient of F wrt a parameter vector p with a given vector
-J_p^T(x, t) * v
.
Note that the vector v is of size nstates() and the result is of size nparam().Source§fn sens_adjoint(&self, t: Self::T) -> Self::M
fn sens_adjoint(&self, t: Self::T) -> Self::M
Compute the negative transpose of the gradient of the operator wrt a parameter vector p and return it.
See Self::sens_adjoint_inplace for a non-allocating version.
Source§fn sens_adjoint_inplace(&self, t: Self::T, y: &mut Self::M)
fn sens_adjoint_inplace(&self, t: Self::T, y: &mut Self::M)
Compute the negative transpose of the gradient of the operator wrt a parameter vector p and store it in the matrix
y
.
y
should have been previously initialised using the output of Self::sens_adjoint_sparsity.
The default implementation of this method computes the gradient using Self::sens_transpose_mul_inplace,
but it can be overriden for more efficient implementations.Source§fn _default_sens_adjoint_inplace(&self, t: Self::T, y: &mut Self::M)
fn _default_sens_adjoint_inplace(&self, t: Self::T, y: &mut Self::M)
Default implementation of the gradient computation (this is the default for Self::sens_adjoint_inplace).
fn sens_adjoint_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§impl<M, F> LinearOp for ParameterisedOp<'_, LinearClosure<M, F>>
impl<M, F> LinearOp for ParameterisedOp<'_, LinearClosure<M, F>>
Source§fn gemv_inplace(&self, x: &M::V, t: M::T, beta: M::T, y: &mut M::V)
fn gemv_inplace(&self, x: &M::V, t: M::T, beta: M::T, y: &mut M::V)
Compute the operator via a GEMV operation (i.e.
y = A(t) * x + beta * y
)Source§fn matrix_inplace(&self, t: Self::T, y: &mut Self::M)
fn matrix_inplace(&self, t: Self::T, y: &mut Self::M)
Compute the matrix representation of the operator
A(t)
and store it in the matrix y
.
The default implementation of this method computes the matrix using Self::gemv_inplace,
but it can be overriden for more efficient implementations.fn sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§fn call_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V)
fn call_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V)
Compute the operator
y = A(t) * x
at a given state and time, the default implementation uses Self::gemv_inplace.Source§fn matrix(&self, t: Self::T) -> Self::M
fn matrix(&self, t: Self::T) -> Self::M
Compute the matrix representation of the operator
A(t)
and return it.
See Self::matrix_inplace for a non-allocating version.Source§fn _default_matrix_inplace(&self, t: Self::T, y: &mut Self::M)
fn _default_matrix_inplace(&self, t: Self::T, y: &mut Self::M)
Default implementation of the matrix computation, see Self::matrix_inplace.
Source§impl<M, F, G> LinearOp for ParameterisedOp<'_, LinearClosureWithAdjoint<M, F, G>>
impl<M, F, G> LinearOp for ParameterisedOp<'_, LinearClosureWithAdjoint<M, F, G>>
Source§fn gemv_inplace(&self, x: &M::V, t: M::T, beta: M::T, y: &mut M::V)
fn gemv_inplace(&self, x: &M::V, t: M::T, beta: M::T, y: &mut M::V)
Compute the operator via a GEMV operation (i.e.
y = A(t) * x + beta * y
)Source§fn matrix_inplace(&self, t: Self::T, y: &mut Self::M)
fn matrix_inplace(&self, t: Self::T, y: &mut Self::M)
Compute the matrix representation of the operator
A(t)
and store it in the matrix y
.
The default implementation of this method computes the matrix using Self::gemv_inplace,
but it can be overriden for more efficient implementations.fn sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§fn call_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V)
fn call_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V)
Compute the operator
y = A(t) * x
at a given state and time, the default implementation uses Self::gemv_inplace.Source§fn matrix(&self, t: Self::T) -> Self::M
fn matrix(&self, t: Self::T) -> Self::M
Compute the matrix representation of the operator
A(t)
and return it.
See Self::matrix_inplace for a non-allocating version.Source§fn _default_matrix_inplace(&self, t: Self::T, y: &mut Self::M)
fn _default_matrix_inplace(&self, t: Self::T, y: &mut Self::M)
Default implementation of the matrix computation, see Self::matrix_inplace.
Source§impl<M: Matrix> LinearOp for ParameterisedOp<'_, UnitCallable<M>>
impl<M: Matrix> LinearOp for ParameterisedOp<'_, UnitCallable<M>>
Source§fn gemv_inplace(&self, x: &Self::V, _t: Self::T, beta: Self::T, y: &mut Self::V)
fn gemv_inplace(&self, x: &Self::V, _t: Self::T, beta: Self::T, y: &mut Self::V)
Compute the operator via a GEMV operation (i.e.
y = A(t) * x + beta * y
)Source§fn call_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V)
fn call_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V)
Compute the operator
y = A(t) * x
at a given state and time, the default implementation uses Self::gemv_inplace.Source§fn matrix(&self, t: Self::T) -> Self::M
fn matrix(&self, t: Self::T) -> Self::M
Compute the matrix representation of the operator
A(t)
and return it.
See Self::matrix_inplace for a non-allocating version.Source§fn matrix_inplace(&self, t: Self::T, y: &mut Self::M)
fn matrix_inplace(&self, t: Self::T, y: &mut Self::M)
Compute the matrix representation of the operator
A(t)
and store it in the matrix y
.
The default implementation of this method computes the matrix using Self::gemv_inplace,
but it can be overriden for more efficient implementations.Source§fn _default_matrix_inplace(&self, t: Self::T, y: &mut Self::M)
fn _default_matrix_inplace(&self, t: Self::T, y: &mut Self::M)
Default implementation of the matrix computation, see Self::matrix_inplace.
fn sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§impl<M: Matrix> LinearOpSens for ParameterisedOp<'_, UnitCallable<M>>
impl<M: Matrix> LinearOpSens for ParameterisedOp<'_, UnitCallable<M>>
Source§fn sens_mul_inplace(
&self,
_x: &Self::V,
_t: Self::T,
_v: &Self::V,
y: &mut Self::V,
)
fn sens_mul_inplace( &self, _x: &Self::V, _t: Self::T, _v: &Self::V, y: &mut Self::V, )
Compute the product of the gradient of F wrt a parameter vector p with a given vector
J_p(t) * x * v
.
Note that the vector v is of size nparams() and the result is of size nstates().
Default implementation returns zero and panics if nparams() is not zero.Source§fn sens_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
fn sens_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
Compute the product of the partial gradient of F wrt a parameter vector p with a given vector
\parial F/\partial p(x, t) * v
, and return the result.
Use [Self::sens_mul_inplace]
to for a non-allocating version.Source§fn sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Compute the gradient of the operator wrt a parameter vector p and store it in the matrix
y
.
y
should have been previously initialised using the output of Self::sens_sparsity.
The default implementation of this method computes the gradient using Self::sens_mul_inplace,
but it can be overriden for more efficient implementations.Source§fn _default_sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn _default_sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Default implementation of the gradient computation (this is the default for Self::sens_inplace).
Source§fn sens(&self, x: &Self::V, t: Self::T) -> Self::M
fn sens(&self, x: &Self::V, t: Self::T) -> Self::M
Compute the gradient of the operator wrt a parameter vector p and return it.
See Self::sens_inplace for a non-allocating version.
fn sens_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§impl<M, F, G> LinearOpTranspose for ParameterisedOp<'_, LinearClosureWithAdjoint<M, F, G>>
impl<M, F, G> LinearOpTranspose for ParameterisedOp<'_, LinearClosureWithAdjoint<M, F, G>>
Source§fn gemv_transpose_inplace(
&self,
x: &Self::V,
t: Self::T,
beta: Self::T,
y: &mut Self::V,
)
fn gemv_transpose_inplace( &self, x: &Self::V, t: Self::T, beta: Self::T, y: &mut Self::V, )
Compute the transpose of the operator via a GEMV operation (i.e.
y = A(t)^T * x + beta * y
)Source§fn transpose_inplace(&self, t: Self::T, y: &mut Self::M)
fn transpose_inplace(&self, t: Self::T, y: &mut Self::M)
Compute the matrix representation of the transpose of the operator
A(t)^T
and store it in the matrix y
.
The default implementation of this method computes the matrix using Self::gemv_transpose_inplace,
but it can be overriden for more efficient implementations.fn transpose_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§fn call_transpose_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V)
fn call_transpose_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V)
Compute the transpose of the operator
y = A(t)^T * x
at a given state and time, the default implementation uses Self::gemv_transpose_inplace.Source§fn _default_transpose_inplace(&self, t: Self::T, y: &mut Self::M)
fn _default_transpose_inplace(&self, t: Self::T, y: &mut Self::M)
Default implementation of the tranpose computation, see Self::transpose_inplace.
Source§impl<M: Matrix> LinearOpTranspose for ParameterisedOp<'_, UnitCallable<M>>
impl<M: Matrix> LinearOpTranspose for ParameterisedOp<'_, UnitCallable<M>>
Source§fn gemv_transpose_inplace(
&self,
x: &Self::V,
_t: Self::T,
beta: Self::T,
y: &mut Self::V,
)
fn gemv_transpose_inplace( &self, x: &Self::V, _t: Self::T, beta: Self::T, y: &mut Self::V, )
Compute the transpose of the operator via a GEMV operation (i.e.
y = A(t)^T * x + beta * y
)Source§fn call_transpose_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V)
fn call_transpose_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V)
Compute the transpose of the operator
y = A(t)^T * x
at a given state and time, the default implementation uses Self::gemv_transpose_inplace.Source§fn transpose_inplace(&self, t: Self::T, y: &mut Self::M)
fn transpose_inplace(&self, t: Self::T, y: &mut Self::M)
Compute the matrix representation of the transpose of the operator
A(t)^T
and store it in the matrix y
.
The default implementation of this method computes the matrix using Self::gemv_transpose_inplace,
but it can be overriden for more efficient implementations.Source§fn _default_transpose_inplace(&self, t: Self::T, y: &mut Self::M)
fn _default_transpose_inplace(&self, t: Self::T, y: &mut Self::M)
Default implementation of the tranpose computation, see Self::transpose_inplace.
fn transpose_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§impl<M, F, G> NonLinearOp for ParameterisedOp<'_, Closure<M, F, G>>
impl<M, F, G> NonLinearOp for ParameterisedOp<'_, Closure<M, F, G>>
Source§impl<M, F> NonLinearOp for ParameterisedOp<'_, ClosureNoJac<M, F>>
impl<M, F> NonLinearOp for ParameterisedOp<'_, ClosureNoJac<M, F>>
Source§impl<M, F, G, H, I> NonLinearOp for ParameterisedOp<'_, ClosureWithAdjoint<M, F, G, H, I>>
impl<M, F, G, H, I> NonLinearOp for ParameterisedOp<'_, ClosureWithAdjoint<M, F, G, H, I>>
Source§impl<M, F, G, H> NonLinearOp for ParameterisedOp<'_, ClosureWithSens<M, F, G, H>>
impl<M, F, G, H> NonLinearOp for ParameterisedOp<'_, ClosureWithSens<M, F, G, H>>
Source§impl<M: Matrix> NonLinearOp for ParameterisedOp<'_, UnitCallable<M>>
impl<M: Matrix> NonLinearOp for ParameterisedOp<'_, UnitCallable<M>>
Source§impl<M, F, G, H, I> NonLinearOpAdjoint for ParameterisedOp<'_, ClosureWithAdjoint<M, F, G, H, I>>
impl<M, F, G, H, I> NonLinearOpAdjoint for ParameterisedOp<'_, ClosureWithAdjoint<M, F, G, H, I>>
Source§fn jac_transpose_mul_inplace(
&self,
x: &Self::V,
t: Self::T,
v: &Self::V,
y: &mut Self::V,
)
fn jac_transpose_mul_inplace( &self, x: &Self::V, t: Self::T, v: &Self::V, y: &mut Self::V, )
Compute the product of the transpose of the Jacobian with a given vector
-J(x, t)^T * v
.
The default implementation fails with a panic, as this method is not implemented by default
and should be implemented by the user if needed.Source§fn adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Compute the Adjoint matrix
-J^T(x, t)
of the operator and store it in the matrix y
.
y
should have been previously initialised using the output of Self::adjoint_sparsity
.
The default implementation of this method computes the Jacobian using Self::jac_transpose_mul_inplace,
but it can be overriden for more efficient implementations.Source§fn adjoint_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
fn adjoint_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Return sparsity information (if available)
Source§fn _default_adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn _default_adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Default implementation of the Adjoint computation (this is the default for Self::adjoint_inplace).
Source§impl<M: Matrix> NonLinearOpAdjoint for ParameterisedOp<'_, UnitCallable<M>>
impl<M: Matrix> NonLinearOpAdjoint for ParameterisedOp<'_, UnitCallable<M>>
Source§fn jac_transpose_mul_inplace(
&self,
_x: &Self::V,
_t: Self::T,
v: &Self::V,
y: &mut Self::V,
)
fn jac_transpose_mul_inplace( &self, _x: &Self::V, _t: Self::T, v: &Self::V, y: &mut Self::V, )
Compute the product of the transpose of the Jacobian with a given vector
-J(x, t)^T * v
.
The default implementation fails with a panic, as this method is not implemented by default
and should be implemented by the user if needed.Source§fn adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Compute the Adjoint matrix
-J^T(x, t)
of the operator and store it in the matrix y
.
y
should have been previously initialised using the output of Self::adjoint_sparsity
.
The default implementation of this method computes the Jacobian using Self::jac_transpose_mul_inplace,
but it can be overriden for more efficient implementations.Source§fn _default_adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn _default_adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Default implementation of the Adjoint computation (this is the default for Self::adjoint_inplace).
Source§impl<M, F, G> NonLinearOpJacobian for ParameterisedOp<'_, Closure<M, F, G>>
impl<M, F, G> NonLinearOpJacobian for ParameterisedOp<'_, Closure<M, F, G>>
Source§fn jac_mul_inplace(&self, x: &M::V, t: M::T, v: &M::V, y: &mut M::V)
fn jac_mul_inplace(&self, x: &M::V, t: M::T, v: &M::V, y: &mut M::V)
Compute the product of the Jacobian with a given vector
J(x, t) * v
.Source§fn jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Compute the Jacobian matrix
J(x, t)
of the operator and store it in the matrix y
.
y
should have been previously initialised using the output of Self::jacobian_sparsity.
The default implementation of this method computes the Jacobian using Self::jac_mul_inplace,
but it can be overriden for more efficient implementations.Source§fn jacobian_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
fn jacobian_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Return sparsity information (if available)
Source§fn jac_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
fn jac_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
Compute the product of the Jacobian with a given vector
J(x, t) * v
, and return the result.
Use [Self::jac_mul_inplace]
to for a non-allocating version.Source§fn jacobian(&self, x: &Self::V, t: Self::T) -> Self::M
fn jacobian(&self, x: &Self::V, t: Self::T) -> Self::M
Compute the Jacobian matrix
J(x, t)
of the operator and return it.
See Self::jacobian_inplace for a non-allocating version.Source§fn _default_jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn _default_jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Default implementation of the Jacobian computation (this is the default for Self::jacobian_inplace).
Source§impl<M, F, G, H, I> NonLinearOpJacobian for ParameterisedOp<'_, ClosureWithAdjoint<M, F, G, H, I>>
impl<M, F, G, H, I> NonLinearOpJacobian for ParameterisedOp<'_, ClosureWithAdjoint<M, F, G, H, I>>
Source§fn jac_mul_inplace(&self, x: &M::V, t: M::T, v: &M::V, y: &mut M::V)
fn jac_mul_inplace(&self, x: &M::V, t: M::T, v: &M::V, y: &mut M::V)
Compute the product of the Jacobian with a given vector
J(x, t) * v
.Source§fn jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Compute the Jacobian matrix
J(x, t)
of the operator and store it in the matrix y
.
y
should have been previously initialised using the output of Self::jacobian_sparsity.
The default implementation of this method computes the Jacobian using Self::jac_mul_inplace,
but it can be overriden for more efficient implementations.Source§fn jacobian_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
fn jacobian_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Return sparsity information (if available)
Source§fn jac_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
fn jac_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
Compute the product of the Jacobian with a given vector
J(x, t) * v
, and return the result.
Use [Self::jac_mul_inplace]
to for a non-allocating version.Source§fn jacobian(&self, x: &Self::V, t: Self::T) -> Self::M
fn jacobian(&self, x: &Self::V, t: Self::T) -> Self::M
Compute the Jacobian matrix
J(x, t)
of the operator and return it.
See Self::jacobian_inplace for a non-allocating version.Source§fn _default_jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn _default_jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Default implementation of the Jacobian computation (this is the default for Self::jacobian_inplace).
Source§impl<M, F, G, H> NonLinearOpJacobian for ParameterisedOp<'_, ClosureWithSens<M, F, G, H>>
impl<M, F, G, H> NonLinearOpJacobian for ParameterisedOp<'_, ClosureWithSens<M, F, G, H>>
Source§fn jac_mul_inplace(&self, x: &M::V, t: M::T, v: &M::V, y: &mut M::V)
fn jac_mul_inplace(&self, x: &M::V, t: M::T, v: &M::V, y: &mut M::V)
Compute the product of the Jacobian with a given vector
J(x, t) * v
.Source§fn jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Compute the Jacobian matrix
J(x, t)
of the operator and store it in the matrix y
.
y
should have been previously initialised using the output of Self::jacobian_sparsity.
The default implementation of this method computes the Jacobian using Self::jac_mul_inplace,
but it can be overriden for more efficient implementations.Source§fn jacobian_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
fn jacobian_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Return sparsity information (if available)
Source§fn jac_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
fn jac_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
Compute the product of the Jacobian with a given vector
J(x, t) * v
, and return the result.
Use [Self::jac_mul_inplace]
to for a non-allocating version.Source§fn jacobian(&self, x: &Self::V, t: Self::T) -> Self::M
fn jacobian(&self, x: &Self::V, t: Self::T) -> Self::M
Compute the Jacobian matrix
J(x, t)
of the operator and return it.
See Self::jacobian_inplace for a non-allocating version.Source§fn _default_jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn _default_jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Default implementation of the Jacobian computation (this is the default for Self::jacobian_inplace).
Source§impl<M: Matrix> NonLinearOpJacobian for ParameterisedOp<'_, UnitCallable<M>>
impl<M: Matrix> NonLinearOpJacobian for ParameterisedOp<'_, UnitCallable<M>>
Source§fn jac_mul_inplace(
&self,
_x: &Self::V,
_t: Self::T,
v: &Self::V,
y: &mut Self::V,
)
fn jac_mul_inplace( &self, _x: &Self::V, _t: Self::T, v: &Self::V, y: &mut Self::V, )
Compute the product of the Jacobian with a given vector
J(x, t) * v
.Source§fn jac_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
fn jac_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
Compute the product of the Jacobian with a given vector
J(x, t) * v
, and return the result.
Use [Self::jac_mul_inplace]
to for a non-allocating version.Source§fn jacobian(&self, x: &Self::V, t: Self::T) -> Self::M
fn jacobian(&self, x: &Self::V, t: Self::T) -> Self::M
Compute the Jacobian matrix
J(x, t)
of the operator and return it.
See Self::jacobian_inplace for a non-allocating version.Source§fn jacobian_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
fn jacobian_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Return sparsity information (if available)
Source§fn jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Compute the Jacobian matrix
J(x, t)
of the operator and store it in the matrix y
.
y
should have been previously initialised using the output of Self::jacobian_sparsity.
The default implementation of this method computes the Jacobian using Self::jac_mul_inplace,
but it can be overriden for more efficient implementations.Source§fn _default_jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn _default_jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Default implementation of the Jacobian computation (this is the default for Self::jacobian_inplace).
Source§impl<M, F, G, H> NonLinearOpSens for ParameterisedOp<'_, ClosureWithSens<M, F, G, H>>
impl<M, F, G, H> NonLinearOpSens for ParameterisedOp<'_, ClosureWithSens<M, F, G, H>>
Source§fn sens_mul_inplace(
&self,
x: &Self::V,
t: Self::T,
v: &Self::V,
y: &mut Self::V,
)
fn sens_mul_inplace( &self, x: &Self::V, t: Self::T, v: &Self::V, y: &mut Self::V, )
Compute the product of the gradient of F wrt a parameter vector p with a given vector
J_p(x, t) * v
.
Note that the vector v is of size nparams() and the result is of size nstates().Source§fn sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Compute the gradient of the operator wrt a parameter vector p and store it in the matrix
y
.
y
should have been previously initialised using the output of Self::sens_sparsity.
The default implementation of this method computes the gradient using Self::sens_mul_inplace,
but it can be overriden for more efficient implementations.fn sens_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§fn sens_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
fn sens_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
Compute the product of the partial gradient of F wrt a parameter vector p with a given vector
\parial F/\partial p(x, t) * v
, and return the result.
Use [Self::sens_mul_inplace]
to for a non-allocating version.Source§fn _default_sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn _default_sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Default implementation of the gradient computation (this is the default for Self::sens_inplace).
Source§impl<M: Matrix> NonLinearOpSens for ParameterisedOp<'_, UnitCallable<M>>
impl<M: Matrix> NonLinearOpSens for ParameterisedOp<'_, UnitCallable<M>>
Source§fn sens_mul_inplace(
&self,
_x: &Self::V,
_t: Self::T,
_v: &Self::V,
y: &mut Self::V,
)
fn sens_mul_inplace( &self, _x: &Self::V, _t: Self::T, _v: &Self::V, y: &mut Self::V, )
Compute the product of the gradient of F wrt a parameter vector p with a given vector
J_p(x, t) * v
.
Note that the vector v is of size nparams() and the result is of size nstates().Source§fn sens_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
fn sens_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V
Compute the product of the partial gradient of F wrt a parameter vector p with a given vector
\parial F/\partial p(x, t) * v
, and return the result.
Use [Self::sens_mul_inplace]
to for a non-allocating version.Source§fn sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Compute the gradient of the operator wrt a parameter vector p and store it in the matrix
y
.
y
should have been previously initialised using the output of Self::sens_sparsity.
The default implementation of this method computes the gradient using Self::sens_mul_inplace,
but it can be overriden for more efficient implementations.Source§fn _default_sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn _default_sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Default implementation of the gradient computation (this is the default for Self::sens_inplace).
Source§fn sens(&self, x: &Self::V, t: Self::T) -> Self::M
fn sens(&self, x: &Self::V, t: Self::T) -> Self::M
Compute the gradient of the operator wrt a parameter vector p and return it.
See Self::sens_inplace for a non-allocating version.
fn sens_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§impl<M, F, G, H, I> NonLinearOpSensAdjoint for ParameterisedOp<'_, ClosureWithAdjoint<M, F, G, H, I>>
impl<M, F, G, H, I> NonLinearOpSensAdjoint for ParameterisedOp<'_, ClosureWithAdjoint<M, F, G, H, I>>
Source§fn sens_transpose_mul_inplace(
&self,
_x: &Self::V,
_t: Self::T,
_v: &Self::V,
y: &mut Self::V,
)
fn sens_transpose_mul_inplace( &self, _x: &Self::V, _t: Self::T, _v: &Self::V, y: &mut Self::V, )
Compute the product of the negative tramspose of the gradient of F wrt a parameter vector p with a given vector
-J_p(x, t)^T * v
.Source§fn sens_adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn sens_adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Compute the negative transpose of the gradient of the operator wrt a parameter vector p and store it in the matrix
y
.
y
should have been previously initialised using the output of Self::sens_adjoint_sparsity.
The default implementation of this method computes the gradient using Self::sens_transpose_mul_inplace,
but it can be overriden for more efficient implementations.fn sens_adjoint_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§fn sens_adjoint(&self, x: &Self::V, t: Self::T) -> Self::M
fn sens_adjoint(&self, x: &Self::V, t: Self::T) -> Self::M
Compute the negative transpose of the gradient of the operator wrt a parameter vector p and return it.
See Self::sens_adjoint_inplace for a non-allocating version.
Source§fn _default_sens_adjoint_inplace(
&self,
x: &Self::V,
t: Self::T,
y: &mut Self::M,
)
fn _default_sens_adjoint_inplace( &self, x: &Self::V, t: Self::T, y: &mut Self::M, )
Default implementation of the gradient computation (this is the default for Self::sens_adjoint_inplace).
Source§impl<M: Matrix> NonLinearOpSensAdjoint for ParameterisedOp<'_, UnitCallable<M>>
impl<M: Matrix> NonLinearOpSensAdjoint for ParameterisedOp<'_, UnitCallable<M>>
Source§fn sens_transpose_mul_inplace(
&self,
_x: &Self::V,
_t: Self::T,
_v: &Self::V,
y: &mut Self::V,
)
fn sens_transpose_mul_inplace( &self, _x: &Self::V, _t: Self::T, _v: &Self::V, y: &mut Self::V, )
Compute the product of the negative tramspose of the gradient of F wrt a parameter vector p with a given vector
-J_p(x, t)^T * v
.Source§fn sens_adjoint(&self, x: &Self::V, t: Self::T) -> Self::M
fn sens_adjoint(&self, x: &Self::V, t: Self::T) -> Self::M
Compute the negative transpose of the gradient of the operator wrt a parameter vector p and return it.
See Self::sens_adjoint_inplace for a non-allocating version.
Source§fn sens_adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
fn sens_adjoint_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)
Compute the negative transpose of the gradient of the operator wrt a parameter vector p and store it in the matrix
y
.
y
should have been previously initialised using the output of Self::sens_adjoint_sparsity.
The default implementation of this method computes the gradient using Self::sens_transpose_mul_inplace,
but it can be overriden for more efficient implementations.Source§fn _default_sens_adjoint_inplace(
&self,
x: &Self::V,
t: Self::T,
y: &mut Self::M,
)
fn _default_sens_adjoint_inplace( &self, x: &Self::V, t: Self::T, y: &mut Self::M, )
Default implementation of the gradient computation (this is the default for Self::sens_adjoint_inplace).
fn sens_adjoint_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>
Source§impl<C: Op> Op for ParameterisedOp<'_, C>
impl<C: Op> Op for ParameterisedOp<'_, C>
Auto Trait Implementations§
impl<'a, C> Freeze for ParameterisedOp<'a, C>
impl<'a, C> RefUnwindSafe for ParameterisedOp<'a, C>
impl<'a, C> Send for ParameterisedOp<'a, C>
impl<'a, C> Sync for ParameterisedOp<'a, C>
impl<'a, C> Unpin for ParameterisedOp<'a, C>
impl<'a, C> UnwindSafe for ParameterisedOp<'a, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.