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

# ComputeCoefficientOfDetermination< 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 computing the Coefficient Of Determination

## 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 coefficient of determination 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. |
| | [ComputeCoefficientOfDetermination](#af5745209a41f6d94b036225fa56771e8) ([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 |

## Public Attributes

| Type | Name |
| - | - |
|  bool | [adjusted](#ac27cc4bbf7f11e28f3c749e0aa61ed5b) is true if the C.o.D. is "adjusted" (default) |
| [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. The [CoD](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_co_d.md) is computed for each of these quantities. |
| [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 CoefficientOfDetermination 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 CoefficientOfDetermination 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 *scalar\_data*, no error appears. For each field data quantity, a regression model is created. In this regression model, the support points are determined by taking ALL given scalar quantities. |

## Detailed Description

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

a struct which collects settings for computing the Coefficient Of Determination

**Template Parameters**

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

## Constructor & Destructor Documentation

### ComputeCoefficientOfDetermination()

```cpp theme={null}
ComputeCoefficientOfDetermination(
    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 for each of the n field quantities one creates a single regression model from what the C.o.D. can be comouted. The regression model contains the specified scalar quantities. (n\*1 new objects will be computed). As a default, the new C.o.D. field objects are appended to the field data quantities as individual designs. The design name is "cod\[scalar\_quantity\_ident]". If multiple scalar quantities are selected, then the default ident is "cod\[multiple]". |

## 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()

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

computes the coefficient of determination 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 |
