singleOrNull

fun ComplexFloatArray.singleOrNull(): ComplexFloat?
fun ComplexDoubleArray.singleOrNull(): ComplexDouble?

Returns single element, or null if the array is empty or has more than one element.


inline fun ComplexFloatArray.singleOrNull(predicate: (ComplexFloat) -> Boolean): ComplexFloat?
inline fun ComplexDoubleArray.singleOrNull(predicate: (ComplexDouble) -> Boolean): ComplexDouble?

Returns the single element matching the given predicate, or null if element was not found or more than one element was found.