Not equal comparison for real columns
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(data_frame), | intent(in) | :: | df | |||
class(*), | intent(in) | :: | col | |||
real(kind=rk), | intent(in) | :: | value |
function ne_real(df, col, value) result(mask) type(data_frame), intent(in) :: df class(*), intent(in) :: col real(rk), intent(in) :: value type(boolean_mask) :: mask real(rk), dimension(:), allocatable :: col_data logical, dimension(:), allocatable :: result_mask integer :: col_index, i col_index = get_column_index(df, col) if (df % dtype(col_index) /= REAL_NUM) error stop "column is not real type" col_data = df_get_col_real(df, col_index) allocate (result_mask(size(col_data))) do i = 1, size(col_data) result_mask(i) = abs(col_data(i) - value) >= 1.0e-10_rk end do call mask % new(result_mask) deallocate (col_data, result_mask) end function ne_real