> ## 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.

# ComputeCorrelation< TYPE > Class Template Reference

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

a struct which collects settings for *computeCorrelation*

## Public Member Functions

| Type | Name |
| - | - |
| | [check](#a47c34ec1e578c2ce27cf1c5fcd0d1704) ([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)) checks the settings on plausibility It throws an exception if there is a problem with the settings. Important: It tries to find out all problems with these settings and then exits the routine. |
| | [compute](#ab08e112d95fe611e7eb25491c354d115) ([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)) computes the correlation of multiple sets of samples with another set of scalar samples If the selected designs for two correlated quantities are different, then the minimum common range of designs is detected and used for analysis. |
| | [ComputeCorrelation](#a773e498496fced65aeb2fdf0d7eabd86) ([DataObjectContainer](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md) the\_field\_data, [DataObjectContainer](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md) the\_scalar\_data) constructor which sets suitable defaults for all members |

## Static Public Member Functions

| Type | Name |
| - | - |
| static | [compute](#af6a8a462fbadda0123a0ea51e64534a0) ([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), [DataObjectVector](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_vector.md) data, [DataObjectVector](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_vector.md) [scalar\_data](#a0c1c80374ba4d28153ed219819d24612), string new\_quantity\_ident, string new\_design\_ident, bool [overwrite\_existing](#ade25e60bd85c8b4abd4f5b416cae0eb9)) computes the correlation of a single set of samples with another set of scalar samples |

## Public Attributes

| Type | Name |
| - | - |
| [DataObjectContainer](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md) | [field\_data](#af22724fd9c1e0dd42ec296e4784b9df8) field samples |
| [DataObjectContainer::string\_vector\_type](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md#ac293ea0e5c280f69a497ea20f20c60b9) | [field\_quantity\_idents](#ab01db6dea146fd2a35511af297363e7b) the feld quantities to be analyzed. If a quantity ident does not exist in *field\_data*, no error appears. |
| [DataObjectContainer::string\_vector\_type](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md#ac293ea0e5c280f69a497ea20f20c60b9) | [new\_design\_idents](#a92a339e93315b87782ce1744408c370d) the new design idents for each correlation object. The dimension and index space must fit the one of *field\_quantity\_idents* |
| [DataObjectContainer::string\_vector\_type](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md#ac293ea0e5c280f69a497ea20f20c60b9) | [new\_quantity\_idents](#a30b1bcf63b9bdc707fea30bd96d70447) the new quantity idents for each correlation object. The dimension and index space must fit the one of *field\_quantity\_idents* |
|  bool | [overwrite\_existing](#ade25e60bd85c8b4abd4f5b416cae0eb9) is true if already existing output data objects will be replaced. In this case, also all depending objects of the already existing one will be deleted. |
| [DataObjectContainer](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md) | [scalar\_data](#a0c1c80374ba4d28153ed219819d24612) scalar samples |
| [DataObjectContainer::string\_vector\_type](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_data_object_container.md#ac293ea0e5c280f69a497ea20f20c60b9) | [scalar\_quantity\_idents](#aeff6fae62a2847852dc0cc49fa48d31d) the scalar quantities to be analyzed. If a quantity ident does not exist in *field\_data*, no error appears. |

## Detailed Description

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

a struct which collects settings for *computeCorrelation*

**Template Parameters**

| Name | Description |
| - | - |
| TYPE | the field data type |

## Constructor & Destructor Documentation

### ComputeCorrelation()

```cpp theme={null}
ComputeCorrelation(
    DataObjectContainer the_field_data,
    DataObjectContainer the_scalar_data
)
```

constructor which sets suitable defaults for all members

**Parameters**

| Name | Description |
| - | - |
| the\_field\_data | the subset of field data to be token as input. |
| the\_scalar\_data | the subset of scalar data to be token as input. All quantity idents are extracted. Then all n field quantities is put into correlation with all m scalar quantities (n\*m new objects will be computed!). As a default, the new correlation field objects are appended to the field data quantities as individual designs. The design name is "correlation\[scalar\_quantity\_ident]". |

## Member Function Documentation

### check()

```cpp theme={null}
check(Structure database)
```

checks the settings on plausibility It throws an exception if there is a problem with the settings. Important: It tries to find out all problems with these settings and then exits the routine.

**Parameters**

| Name | Description |
| - | - |
| database | the SoS structure |

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

```cpp theme={null}
static compute(
    Structure database,
    DataObjectVector data,
    DataObjectVector scalar_data,
    string new_quantity_ident,
    string new_design_ident,
    bool overwrite_existing
)
```

`static`

computes the correlation of a single set of samples with another set of scalar samples

**Parameters**

| Name | Description |
| - | - |
| database | the output object is to be inserted in this object |
| data | a vector of field samples |
| scalar\_data | a vector of scalar samples |
| new\_quantity\_ident | the quantity ident of the new object |
| new\_design\_ident | the design ident of the new object |
| overwrite\_existing | defines if any result quantities may be overwritten |

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

```cpp theme={null}
compute(Structure database)
```

computes the correlation of multiple sets of samples with another set of scalar samples If the selected designs for two correlated quantities are different, then the minimum common range of designs is detected and used for analysis.

**Parameters**

| Name | Description |
| - | - |
| database | the output object where new objects are added to |
