IsComplexType

Function Usage

Checks whether the input data is of complex type, including Complex128, Complex64, and Complex32.

Prototype

bool IsComplexType(const DataType dtype)

Parameters

Parameter

Input/Output

Description

dtype

Input

Input data type.

Returns

If the input data type is complex number type, true is returned. Otherwise, false is returned.

Constraints

None

Examples

1
2
3
4
5
6
// If dtype is not a complex number, a return statement is executed.
void Func(const DataType dtype) {
    if (!IsComplexType(dtype)) {
        return;
    }
}