    

 ## On this page

  

 

 # ComputeRelativeError&lt; TYPE &gt; Class Template Reference

 Last update: 16.07.2025 

Computes the relative accuracy between two quantities given using ![$ \epsilon = \frac{x_{\mbox{other}}}{x_{\mbox{ref}}} $](/sites/default/files/migrate-content/osp3d_script/form_9.png) If set, the relative error is computed using ![$ \epsilon = \frac{x_{\mbox{other}}-x_{\mbox{ref}}}{max_i |x_{\mbox{ref}}|_i } $](/sites/default/files/migrate-content/osp3d_script/form_10.png). [More...](class_compute_relative_error.xhtml#details)

## <a id="pub-types" name="pub-types"></a>Public Types

enum [eType](class_compute_relative_error.xhtml#a12f8ec8f0e7a4584b9fe481bb53fa60e) { [ACCURACY](class_compute_relative_error.xhtml#a12f8ec8f0e7a4584b9fe481bb53fa60ea099d39fb970cfb7d422a9742d608bbc3) = 0, [UNSIGNED\_ERROR](class_compute_relative_error.xhtml#a12f8ec8f0e7a4584b9fe481bb53fa60ea30cb2ef9f904d87ebbd15a4244d6892f), [SIGNED\_ERROR](class_compute_relative_error.xhtml#a12f8ec8f0e7a4584b9fe481bb53fa60eabb8dbeab89d2a5313873605f5cdf5a13), [DIFF](class_compute_relative_error.xhtml#a12f8ec8f0e7a4584b9fe481bb53fa60eaa5d305f703cfce63b982a4cba74f64ec) } the type of error function [More...](class_compute_relative_error.xhtml#a12f8ec8f0e7a4584b9fe481bb53fa60e)  
 ## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

<a id="a47c34ec1e578c2ce27cf1c5fcd0d1704"></a> **check** ([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b)) <a id="ab08e112d95fe611e7eb25491c354d115"></a> **compute** ([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b))  [ComputeRelativeError](class_compute_relative_error.xhtml#adc93cac1c027c5fb8a720d580ec3f2fa) (string [output\_quantity\_ident](class_compute_relative_error.xhtml#a17a0b08032f8c37e624459b892cc3beb), [DataObjectContainer](class_data_object_container.xhtml) [reference](class_compute_relative_error.xhtml#aa765c055b5f09bff957e2529c4b728fe), [DataObjectContainer](class_data_object_container.xhtml) [other](class_compute_relative_error.xhtml#ac73a7eae6d39beb3f741dadfd254bf55)) Collects all data to compute the relative accuracy between the objects reference and other. [More...](#adc93cac1c027c5fb8a720d580ec3f2fa)  
  [ComputeRelativeError](class_compute_relative_error.xhtml#a8e986e5aceb797c81f17a3f8c2b93697) (string [output\_quantity\_ident](class_compute_relative_error.xhtml#a17a0b08032f8c37e624459b892cc3beb), string reference\_ident, string other\_ident, [Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b)) Collects all data to compute the relative accuracy between the objects reference and other. [More...](#a8e986e5aceb797c81f17a3f8c2b93697)  
 ## <a id="pub-attribs" name="pub-attribs"></a>Public Attributes

<a id="a5691769acfd1bf8c400d92e360066619"></a>[eType](class_compute_relative_error.xhtml#a12f8ec8f0e7a4584b9fe481bb53fa60e) [error\_type](class_compute_relative_error.xhtml#a5691769acfd1bf8c400d92e360066619) If false, the error is computed, else the relative accuracy.   
 <a id="a80ad12816b0c0674c578048eb2fd0afe"></a>bool [interpolate\_missing\_items](class_compute_relative_error.xhtml#a80ad12816b0c0674c578048eb2fd0afe) If set to true, one uses the interpolated (filled) missing field vector item.   
 <a id="ac73a7eae6d39beb3f741dadfd254bf55"></a>[DataObjectContainer](class_data_object_container.xhtml) [other](class_compute_relative_error.xhtml#ac73a7eae6d39beb3f741dadfd254bf55) Defines the quantity ident to be chosen as reference value.   
 <a id="a17a0b08032f8c37e624459b892cc3beb"></a>string [output\_quantity\_ident](class_compute_relative_error.xhtml#a17a0b08032f8c37e624459b892cc3beb) Defines the name of the new quantity ident.   
 <a id="ade25e60bd85c8b4abd4f5b416cae0eb9"></a>bool [overwrite\_existing](class_compute_relative_error.xhtml#ade25e60bd85c8b4abd4f5b416cae0eb9) Set to true if alredy existing data objects need to be replaced.   
 <a id="aa765c055b5f09bff957e2529c4b728fe"></a>[DataObjectContainer](class_data_object_container.xhtml) [reference](class_compute_relative_error.xhtml#aa765c055b5f09bff957e2529c4b728fe) Defines the quantity ident to be chosen as reference value.   
 <a id="details" name="details"></a>## Detailed Description

### template&lt;dataobject\_types TYPE&gt;  
class ComputeRelativeError&lt; TYPE &gt;

Computes the relative accuracy between two quantities given using ![$ \epsilon = \frac{x_{\mbox{other}}}{x_{\mbox{ref}}} $](/sites/default/files/migrate-content/osp3d_script/form_9.png) If set, the relative error is computed using ![$ \epsilon = \frac{x_{\mbox{other}}-x_{\mbox{ref}}}{max_i |x_{\mbox{ref}}|_i } $](/sites/default/files/migrate-content/osp3d_script/form_10.png).

Template Parameters TYPE

## Member Enumeration Documentation

<a id="a12f8ec8f0e7a4584b9fe481bb53fa60e"></a>## [◆ ](#a12f8ec8f0e7a4584b9fe481bb53fa60e)eType

 enum [eType](class_compute_relative_error.xhtml#a12f8ec8f0e7a4584b9fe481bb53fa60e)

the type of error function

Enumerator<a id="a12f8ec8f0e7a4584b9fe481bb53fa60ea099d39fb970cfb7d422a9742d608bbc3"></a>ACCURACY compute accuracy in %

<a id="a12f8ec8f0e7a4584b9fe481bb53fa60ea30cb2ef9f904d87ebbd15a4244d6892f"></a>UNSIGNED\_ERROR compute relative error in %

<a id="a12f8ec8f0e7a4584b9fe481bb53fa60eabb8dbeab89d2a5313873605f5cdf5a13"></a>SIGNED\_ERROR compute relative error in % with a sign indicating the direction

<a id="a12f8ec8f0e7a4584b9fe481bb53fa60eaa5d305f703cfce63b982a4cba74f64ec"></a>DIFF compute abs. error as difference





## Constructor &amp; Destructor Documentation

<a id="adc93cac1c027c5fb8a720d580ec3f2fa"></a>## [◆ ](#adc93cac1c027c5fb8a720d580ec3f2fa)ComputeRelativeError() \[1/2\]

 [ComputeRelativeError](class_compute_relative_error.xhtml)  ( string  *output\_quantity\_ident*,    [DataObjectContainer](class_data_object_container.xhtml)  *reference*,    [DataObjectContainer](class_data_object_container.xhtml)  *other*   ) 

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

Parameters output\_quantity\_identThe quantiy ident of the new data object referenceThe reference data object; the divisor. otherThe other data object, the divident. 



<a id="a8e986e5aceb797c81f17a3f8c2b93697"></a>## [◆ ](#a8e986e5aceb797c81f17a3f8c2b93697)ComputeRelativeError() \[2/2\]

 [ComputeRelativeError](class_compute_relative_error.xhtml)  ( string  *output\_quantity\_ident*,    string  *reference\_ident*,    string  *other\_ident*,    [Structure](class_structure.xhtml)  *database*   ) 

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

Parameters output\_quantity\_identThe quantiy ident of the new data object reference\_identThe ident of the reference data object, the divisor. other\_identThe ident of the other data object, the divident. databaseThe database used to filter the reference as well as the other data object from.