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

# CoP Struct Reference

Part of [MOP quality measure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__quality__measure)

Reference implementation for a quality metric for [MOP](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_m_o_p.md) models.

## Public Member Functions

| Type | Name |
| - | - |
| | [CoP](#adca3e46224da11f75247ecb839723c86) ()=default Constructor. |
| | [CoP](#a4702894ea742a06b44535da67267b407) ([CoP](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_co_p.md))=default Copy-Constructor. |
| virtual number | [error](#a4a4f4dfb26f77b55280f37a0610dd5f9) ([ResidualsBase](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_residuals_base.md) residuals, uint64\_t output=0) override Computes the prediction error of the given residuals according to the input and its selected output. |
|  virtual bool | [expectsCrossValidation](#ad9917a97363feb7eeee81a1b47fc41fa) () override Return true if the quality measure expects to handle cross validated outputs. |
| virtual | [loadJson](#ae5700ae63985e3e6b30cb716ddb5fdd0) ([JsonValue](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_json_value.md) root) override Function to load the Serializables data from a [JsonValue](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_json_value.md). |
| virtual number | [measure](#a4b157842a805ad774da2ab43e530e3d4) ([ResidualsBase](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_residuals_base.md) residuals, uint64\_t output=0) override Computes the quality measure of the given residuals according to the input and its selected output. |
| [CoP](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_co_p.md) | [operator=](#a052c74a9131f44b75aca6bcd6f18828c) ([CoP](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_co_p.md))=default Copy-Assignment. |
| virtual [JsonValue](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_json_value.md) | [saveJson](#ab4587af0230811304c91f1c0aaa1c9ce) () override Function to save the Serializables data as a [JsonValue](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_json_value.md). |
|  virtual std::ostream | [write](#a77047bf810e52c1c56fa06464a9ecc3f) (std::ostream) override Write the qualityMeasures name out. |

## Detailed Description

Reference implementation for a quality metric for [MOP](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_m_o_p.md) models.

## Member Function Documentation

### error()

```cpp theme={null}
virtual number error(
    ResidualsBase residuals,
    uint64_t output = 0
)
```

`override` `virtual`

Computes the prediction error of the given residuals according to the input and its selected output.

**Parameters**

| Name | Description |
| - | - |
| residuals | The residuals to calculate the quality measure for |
| output | the selected output. |

**Returns**

A value that measures the deviation of the residualss approximation against the selected output.

Implements [QualityMeasureBase](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_quality_measure_base.md#ac8a977438da39c4eb58c837aecf65ab4).

### loadJson()

```cpp theme={null}
virtual loadJson(JsonValue root)
```

`override` `virtual`

Function to load the Serializables data from a [JsonValue](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_json_value.md).

**Parameters**

| Name | Description |
| - | - |
| root | The data of the serializable as [JsonValue](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_json_value.md) |

### measure()

```cpp theme={null}
virtual number measure(
    ResidualsBase residuals,
    uint64_t output = 0
)
```

`override` `virtual`

Computes the quality measure of the given residuals according to the input and its selected output.

**Parameters**

| Name | Description |
| - | - |
| residuals | The residuals to calculate the quality measure for |
| output | the selected output. |

**Returns**

A value that measures the deviation of the residualss approximation against the selected output.

Implements [QualityMeasureBase](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/struct_quality_measure_base.md#a8d0dfd88a4f82ebefd1210abe81a82d0).

### saveJson()

```cpp theme={null}
virtual JsonValue saveJson()
```

`override` `virtual`

Function to save the Serializables data as a [JsonValue](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_json_value.md).

**Returns**

The data of the serializable as [JsonValue](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_json_value.md)
