Provides an abstract type for a dynamic set data structures. This data structure is similar to a normal data_set structure, but new items can be added to the set. It is similar to the set type in Python.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dynamic_set), | intent(inout) | :: | this | |||
class(*), | intent(in) | :: | item | An item to add or remove from the set |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dynamic_set), | intent(inout) | :: | this | |||
class(*), | intent(in), | dimension(:) | :: | items | An array containing items to add or remove from the set |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dynamic_set), | intent(inout) | :: | this | |||
class(iterable), | intent(in) | :: | items | An iterable containing items to add or remove from the set |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dynamic_set), | intent(inout) | :: | this |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dynamic_set), | intent(inout) | :: | this |
A random item which has been removed from the set
procedure(single_sub), private, deferred :: add_single | Places the item in the set, if not already present |
procedure(multiple_sub), private, deferred :: add_multiple | Places each item in the array into the set, if not already present |
generic, public :: add => add_single, add_multiple | |
procedure(iter_sub), public, deferred :: add_iter | Places each item in the iterable into the set, if not already present. |
procedure(single_sub), private, deferred :: remove_single | Removes the item from the set, if present |
procedure(multiple_sub), private, deferred :: remove_multiple | Removes each item in the array from the set, if present |
generic, public :: remove => remove_single, remove_multiple | |
procedure(iter_sub), public, deferred :: remove_iter | Removes each item in the iterable from the set, if present |
procedure(pop_func), public, deferred :: pop | Removes a random item from the set and returns it |
procedure(clear_sub), public, deferred :: clear | Removes all items from the set |
An abstract data type for dynamic sets. These are much like mathematical sets, but differ from the parent data_set type in that items can be added to or removed from the set. To accomplish this, various additional methods are available. This data type is similar to the set type in Python.