# Function Class

> A function is a process.

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.4.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Function
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/llms.txt

```cpp
class Function
```

**Namespace:** `datalogics_interface`

**Derived classes:** [`ExponentialFunction`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/ExponentialFunction.md), [`PostScriptCalculatorFunction`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PostScriptCalculatorFunction.md)

## Description

A function is a process.

A function takes input values and manipulates them to create output values.

**Referenced by:** [`DeviceNColorSpace`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/DeviceNColorSpace.md), [`SeparationColorSpace`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/SeparationColorSpace.md)

## Constructors

### Function

```cpp
datalogics_interface::Function::Function(Function &&) noexcept
```

*constructor*

**Parameters**

- (unnamed) ([`Function &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Function.md))

### ~Function

```cpp
virtual datalogics_interface::Function::~Function()
```

*destructor*

## Methods

### apply

```cpp
std::vector< double > datalogics_interface::Function::apply(const std::vector< double > &args) const
```

**Parameters**

- `args` (`const std::vector< double > &`): input values for the function. The number of input values must agree with the number of inputs the function takes.

**Returns:** `std::vector< double >`

a list of the result values from the function

Apply the function to supplied input values

### get_domain

```cpp
std::vector< double > datalogics_interface::Function::get_domain() const
```

**Returns:** `std::vector< double >`

The domain of the function.

Contains 2 * m elements, where m is the number of inputs to the function. Each successive pair of elements gives the minimum and maximum values for one of the inputs. Input values to the function are clamped to these minimum and maximum values.

### get_n_inputs

```cpp
int datalogics_interface::Function::get_n_inputs() const
```

**Returns:** `int`

The number of inputs to the function.

### get_n_outputs

```cpp
int datalogics_interface::Function::get_n_outputs() const
```

**Returns:** `int`

The number of outputs from the function.

### operator=

```cpp
Function & datalogics_interface::Function::operator=(Function &&) noexcept
```

**Parameters**

- (unnamed) ([`Function &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Function.md))

**Returns:** [`Function &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Function.md)

### set_domain

```cpp
void datalogics_interface::Function::set_domain(const std::vector< double > &domain)
```

**Parameters**

- `domain` (`const std::vector< double > &`)

**Returns:** `void`

The domain of the function.

Contains 2 * m elements, where m is the number of inputs to the function. Each successive pair of elements gives the minimum and maximum values for one of the inputs. Input values to the function are clamped to these minimum and maximum values.

### to_string

```cpp
virtual std::string datalogics_interface::Function::to_string() const
```

**Returns:** `std::string`

A string representation of the function.

Convert the function to a displayable string.
