Skip to main content

assert_adjoint_identity

Function assert_adjoint_identity 

Source
pub fn assert_adjoint_identity<OutputTangent, OutputCotangent, InputTangent, InputCotangent, OutputPairing, InputPairing>(
    jvp: &OutputTangent,
    output_cotangent: &OutputCotangent,
    input_tangent: &InputTangent,
    input_cotangent: &InputCotangent,
    output_pairing: OutputPairing,
    input_pairing: InputPairing,
    relative: f64,
    absolute: f64,
)
where OutputPairing: FnOnce(&OutputTangent, &OutputCotangent) -> f64, InputPairing: FnOnce(&InputTangent, &InputCotangent) -> f64,
Expand description

Checks the adjoint identity for arbitrary tangent and cotangent types.

The defining identity is <Jv, w>_output = <v, J*w>_input. The two pairing closures return real scalars and therefore also support complex spaces using a real pairing.