Skip to main content
Version: 0.0.0

Description

Computes the Lp-norm of a field or a field container. When a second entry is provided, the residual (the difference between the first and second entry) is calculated along with the error as the Lp-norm of the difference. When a second input is not provided, the calculation is only completed for the first entry. The type of calculation performed is based on the specifications provided for pin 1, pin 2 defines the type of error norm (L1 vs L2), and pin 3 which entity to use as a reference

Inputs

This table lists the input pins for this operator. Input pins define the data that the operator requires to perform its operation. Some inputs are required, while others are optional and provide additional configuration. Each parameter is detailed in the sections that follow the table.

field_or_fields_container1 (Pin 0)

field or fields container - compulsory

normalization_type (Pin 1)

  • Required: No
  • Expected type(s): int32
type of normalization applied to the residuals and norm calculation (optional, defaut: absolute): 0 for absolute, 1 for relative to the first entry, 2 for normalized by the max of each field of the first entry or residuals depending on the reference field option, 3 for normalized by the max over all fields of the first entry or residuals depending on the reference field option

norm_calculation_type (Pin 2)

  • Required: No
  • Expected type(s): int32
type for norm calculation (optional, default: L2) - It is normalized depending on Pin2 selection 1 for L1, ie sum(abs(xi)), 2 for L2, ie sqrt(sum((xi^2))

field_reference (Pin 3)

  • Required: No
  • Expected type(s): int32
Field reference for the normalization step, default: 0 for entry 1, 1 for residuals - optional

field_or_fields_container2 (Pin 4)

field or fields container of same dimensionality as entry 1 - optional

Outputs

This table lists the output pins for this operator. Output pins provide the results of the operator’s computation and can be connected to inputs of other operators or retrieved for further processing. Each output is detailed in the sections that follow the table.

residuals (Pin 0)

0: normalized residuals (aka field 1 - field 2) as a field or field container, normalized depending on the normalization type

error (Pin 1)

1: error as a field or a field container depending on the entry’s type.

residuals_normalization_factor (Pin 2)

2: factor used for residual normalization

error_normalization_factor (Pin 3)

3: factor used for error norm normalization

Configurations

This operator supports configuration options that modify its behavior.

mutex

  • Expected type(s): bool
  • Default value: false
If this option is set to true, the shared memory is prevented from being simultaneously accessed by multiple threads.

permissive

  • Expected type(s): bool
  • Default value: true
If this option is set to true, warning checks (like unit or data sizes) won’t be done.

Scripting

This operator can be accessed through scripting interfaces using these identifiers. Category: math Plugin: core Scripting name: compute_residual_and_error Full name: math.compute_residual_and_error Internal name: error_norm_calc License: None

Examples

These examples demonstrate how to use this operator in different programming environments. Each example shows how to instantiate the operator, connect the required inputs, and retrieve the output.

Changelog

  • Version 0.0.0: Initial release.