Engee documentation

MinMax

Searches for the minimum or maximum value.

blockType: MinMax

Path in the library:

/Basic/Math Operations/MinMax

Description

Block MinMax outputs either the minimum or maximum element(s) of the input signals. Whether the block outputs the minimum or maximum values is determined by the parameter value. Function.

Block MinMax ignores any input value that is equal to NaN, except when each input value is NaN. When all input values are equal NaN, the output is NaN, either as a scalar, or as the value of each element of the output vector.

Ports

Output

# OUT_1 — minimum or maximum values
scalar | vector | the matrix

Details

When the unit has one input port, the output is a scalar equal to the minimum or maximum element of the input signals.

When the unit has several input ports, the output is a signal having the same dimensions as the Input. Each output element is equal to the minimum or maximum of the corresponding input elements.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool, Fixed-point

Complex numbers support

I don’t

Input

# IN_1 — Input signal
scalar | vector | the matrix

Details

The input signal from which the unit outputs the maximum or minimum values.

  • When a block has one input port, the Input must be a scalar or a vector. The block outputs a scalar equal to the minimum or maximum element of the input vector.

  • When a block has several input ports, the dimension of the remaining ports is expanded to the maximum possible with the usage of broadcast operations. For example, if the Input signals have dimensions and , then using broadcast , the output will be an array of size . This process automatically expands arrays by dimensions equal to one in order to match the dimensions of the input data for calculations.

    Broadcast is the process of automatically bringing arrays to compatible sizes to perform operations. Broadcast works according to the rules of "distribution" in dimensions equal to one: if the arrays have mismatched sizes, but at least one of the dimensions is equal to 1, then the operation is performed, while the array is expanded by the corresponding dimension.

    The dimension of scalar input signals increases to the dimension of non-scalar input signals, which is also achieved using the broadcast operation. If a block has several Inputs, and one of them is scalar, broadcast automatically expands it to the same dimension as the rest of the input data. The unit outputs a signal having the same dimensions as the Input. Each output element is equal to the minimum or maximum of the corresponding input elements.

Dependencies

To support matrix input, it is necessary for the parameter Number of input ports set an integer greater than or equal to 1. All non-scalar input parameters must have the same dimensions.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool

Complex numbers support

I don’t

Parameters

Parameters

# Function — mathematical function
min | max

Details

Sets which of the functions (min or max), will be applied to the input signal.

Values

min | max

Default value

min

Program usage name

Function

Tunable

No

Evaluatable

No

# Number of input ports — number of input signals
Real number

Details

Specify the number of inputs.

Default value

1

Program usage name

Inputs

Tunable

No

Evaluatable

Yes

Main

# Require all inputs to have the same data type — The input data must have the same data type.
Logical

Details

Check this box so that all input data has the same data type.

Default value

false (switched off)

Program usage name

InputSameDT

Tunable

No

Evaluatable

No

# Output data type — type of output data
Inherit: auto | Same as first input | Float64 | Float32 | Float16 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int128 | UInt128 | Bool | Fixed-point

Details

Select the data type for the output data.

Values

Inherit: auto | Same as first input | Float64 | Float32 | Float16 | Int8 | UInt8 | Int16 | UInt16 | Int32 | UInt32 | Int64 | UInt64 | Int128 | UInt128 | Bool | Fixed-point

Default value

Inherit: auto

Program usage name

OutDataTypeStr

Tunable

No

Evaluatable

No

# Output fixed-point type — the output type of fixed-point numbers
Data type

Details

Specify the output type of fixed-point numbers.

Dependencies

To use this parameter, set for the parameter Output data type meaning Fixed-point.

Default value

fixdt(1, 16, 0)

Program usage name

OutDataTypeStrFixed

Tunable

No

Evaluatable

Yes

# Integer rounding mode — rounding mode for fixed point operations
Ceiling | Convergent | Floor | Nearest | Round | Zero

Details

Select the rounding mode for fixed-point operations. You can choose:

  • Ceiling — rounds up both positive and negative numbers (towards positive infinity).

  • Convergent — rounds the number to the nearest representable value. If the fractional part of the number ends in 5, the number is rounded to the nearest even integer.

  • Floor — rounds down both positive and negative numbers (towards negative infinity).

  • Nearest — rounds the number to the nearest representable value. If the fractional part of the number ends in 5, the number is rounded up (towards positive infinity).

  • Round — rounds the number to the nearest integer.

  • Zero — rounds the number towards zero.

The block parameters are always rounded to the nearest representable value.

Values

Ceiling | Convergent | Floor | Nearest | Round | Zero

Default value

Floor

Program usage name

RndMeth

Tunable

No

Evaluatable

No

# Saturate on integer overflow — method of action in case of overflow
Logical

Details

When this check box is selected, the value that goes beyond the type limits is reset to the maximum or minimum value that the selected data type can represent. Otherwise, overflow transfer occurs.

When this option is selected, saturation is applied to all internal operations in the block, not just to the output or result.

Default value

false (switched off)

Program usage name

SaturateOnIntegerOverflow

Tunable

No

Evaluatable

No

Additional options

C code generation: Yes