Boolean mask type for storing logical arrays
Used to create pandas-like boolean indexing masks that can be combined with logical operators and applied to data frames
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | private | :: | initialized | = | .false. | ||
logical, | private, | dimension(:), allocatable | :: | mask | |||
integer, | private | :: | size | = | 0 |
Destroy a boolean mask and free memory
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(boolean_mask), | intent(inout) | :: | this |
Get the logical array from the mask
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(boolean_mask), | intent(in) | :: | this |
Get the size of the mask
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(boolean_mask), | intent(in) | :: | this |
Check if mask is initialized
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(boolean_mask), | intent(in) | :: | this |
Initialize a boolean mask from a logical array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(boolean_mask), | intent(inout) | :: | this | |||
logical, | intent(in), | dimension(:) | :: | logical_array |
type :: boolean_mask private logical, dimension(:), allocatable :: mask integer :: size = 0 logical :: initialized = .false. contains private procedure, public :: new => mask_constructor procedure, public :: destroy => mask_destructor procedure, public :: get_mask => mask_get procedure, public :: get_size => mask_get_size procedure, public :: is_initialized => mask_is_initialized end type boolean_mask