Logical NOT operation on a mask
@param[in] mask Boolean mask to negate @return result_mask Negated mask
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(boolean_mask), | intent(in) | :: | mask |
function mask_not(mask) result(result_mask) type(boolean_mask), intent(in) :: mask type(boolean_mask) :: result_mask logical, dimension(:), allocatable :: arr, negated integer :: i arr = mask % get_mask() allocate (negated(size(arr))) do i = 1, size(arr) negated(i) = .not. arr(i) end do call result_mask % new(negated) deallocate (arr, negated) end function mask_not