> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ComputeRelativeError< TYPE > Class Template Reference

Part of [Statistics](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__statistics)

Computes the relative accuracy between two quantities given using ![\epsilon = \frac\{x\_\{\mbox\{other}}}\{x\_\{\mbox\{ref}}}](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/optislang/optislang-3d-postprocessing-script-api/form_9.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=8bff8518867ea65b26a6f559be341c51) If set, the relative error is computed using ![\epsilon = \frac\{x\_\{\mbox\{other}}-x\_\{\mbox\{ref}}}\{max\_i |x\_\{\mbox\{ref}}|\_i }](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/optislang/optislang-3d-postprocessing-script-api/form_10.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=9bb045187d5f26a9d80808d41a149a76).

## Public Types

| Type | Name |
| - | - |
| enum | [eType](#a12f8ec8f0e7a4584b9fe481bb53fa60e) \{ [ACCURACY](#a12f8ec8f0e7a4584b9fe481bb53fa60ea099d39fb970cfb7d422a9742d608bbc3) = 0, [UNSIGNED\_ERROR](#a12f8ec8f0e7a4584b9fe481bb53fa60ea30cb2ef9f904d87ebbd15a4244d6892f), [SIGNED\_ERROR](#a12f8ec8f0e7a4584b9fe481bb53fa60eabb8dbeab89d2a5313873605f5cdf5a13), [DIFF](#a12f8ec8f0e7a4584b9fe481bb53fa60eaa5d305f703cfce63b982a4cba74f64ec) } the type of error function |

## Public Member Functions

| Type | Name |
| - | - |
| | **check** ([Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b)) |
| | **compute** ([Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b)) |
| | [ComputeRelativeError](#adc93cac1c027c5fb8a720d580ec3f2fa) (string [output\_quantity\_ident](#a17a0b08032f8c37e624459b892cc3beb), [DataObjectContainer](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md) [reference](#aa765c055b5f09bff957e2529c4b728fe), [DataObjectContainer](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md) [other](#ac73a7eae6d39beb3f741dadfd254bf55)) Collects all data to compute the relative accuracy between the objects reference and other. |
| | [ComputeRelativeError](#a8e986e5aceb797c81f17a3f8c2b93697) (string [output\_quantity\_ident](#a17a0b08032f8c37e624459b892cc3beb), string reference\_ident, string other\_ident, [Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b)) Collects all data to compute the relative accuracy between the objects reference and other. |

## Public Attributes

| Type | Name |
| - | - |
| [eType](#a12f8ec8f0e7a4584b9fe481bb53fa60e) | [error\_type](#a5691769acfd1bf8c400d92e360066619) If false, the error is computed, else the relative accuracy. |
|  bool | [interpolate\_missing\_items](#a80ad12816b0c0674c578048eb2fd0afe) If set to true, one uses the interpolated (filled) missing field vector item. |
| [DataObjectContainer](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md) | [other](#ac73a7eae6d39beb3f741dadfd254bf55) Defines the quantity ident to be chosen as reference value. |
|  string | [output\_quantity\_ident](#a17a0b08032f8c37e624459b892cc3beb) Defines the name of the new quantity ident. |
|  bool | [overwrite\_existing](#ade25e60bd85c8b4abd4f5b416cae0eb9) Set to true if alredy existing data objects need to be replaced. |
| [DataObjectContainer](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md) | [reference](#aa765c055b5f09bff957e2529c4b728fe) Defines the quantity ident to be chosen as reference value. |

## Detailed Description

#### template\<dataobject\_types TYPE>  class ComputeRelativeError\< TYPE >

Computes the relative accuracy between two quantities given using ![\epsilon = \frac\{x\_\{\mbox\{other}}}\{x\_\{\mbox\{ref}}}](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/optislang/optislang-3d-postprocessing-script-api/form_9.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=8bff8518867ea65b26a6f559be341c51) If set, the relative error is computed using ![\epsilon = \frac\{x\_\{\mbox\{other}}-x\_\{\mbox\{ref}}}\{max\_i |x\_\{\mbox\{ref}}|\_i }](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/optislang/optislang-3d-postprocessing-script-api/form_10.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=9bb045187d5f26a9d80808d41a149a76).

**Template Parameters**

| Name | Description |
| - | - |
| TYPE | |

## Member Enumeration Documentation

### eType

```cpp theme={null}
enum eType
```

the type of error function

| Enumerator | |
| - | - |
| ACCURACY | compute accuracy in % |
| UNSIGNED\_ERROR | compute relative error in % |
| SIGNED\_ERROR | compute relative error in % with a sign indicating the direction |
| DIFF | compute abs. error as difference |

## Constructor & Destructor Documentation

### ComputeRelativeError() \[1/2]

```cpp theme={null}
ComputeRelativeError(
    string output_quantity_ident,
    DataObjectContainer reference,
    DataObjectContainer other
)
```

Collects all data to compute the relative accuracy between the objects reference and other.

**Parameters**

| Name | Description |
| - | - |
| output\_quantity\_ident | The quantiy ident of the new data object |
| reference | The reference data object; the divisor. |
| other | The other data object, the divident. |

### ComputeRelativeError() \[2/2]

```cpp theme={null}
ComputeRelativeError(
    string output_quantity_ident,
    string reference_ident,
    string other_ident,
    Structure database
)
```

Collects all data to compute the relative accuracy between the objects reference and other.

**Parameters**

| Name | Description |
| - | - |
| output\_quantity\_ident | The quantiy ident of the new data object |
| reference\_ident | The ident of the reference data object, the divisor. |
| other\_ident | The ident of the other data object, the divident. |
| database | The database used to filter the reference as well as the other data object from. |
