Provides an abstract type for the set data structure. Such sets support similar operations to their mathematical counterparts. This class, and its descendents, have a comparable set of methods to those in the Python frozenset type.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_set), | intent(in) | :: | this | |||
class(data_set), | intent(in) | :: | other | A second set |
A set containing all elements found in this one and the other
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_set), | intent(in) | :: | this | |||
class(data_set), | intent(in) | :: | other | A second set |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_set), | intent(in) | :: | this | |||
class(data_set), | intent(in) | :: | other | A second set |
A set containing elements found in one, but not both, of this set or the other set
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_set), | intent(in) | :: | this | |||
class(data_set), | intent(in) | :: | other | A second set |
Whether the relationship between this
and other
is true
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_set), | intent(in) | :: | this |
.true.
if this set contains no items
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_set), | intent(in) | :: | this | |||
procedure(test_func) | :: | test | A test for which the values that pass will be returned in a new list |
Contains those items in this set for which test
returns
.true.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_set), | intent(in) | :: | this |
A list containing copies of all of the items in this set
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_set), | intent(in) | :: | this | |||
procedure(comparison_func) | :: | comparison | A procedure which evaluates whether a container object is less than, equal to, or greater than another |
The smallest item in the set, as determined by the
comparison
function
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_set), | intent(in) | :: | this | |||
procedure(comparison_func) | :: | comparison | A procedure which evaluates whether a container object is less than, equal to, or greater than another |
The largest item in the set, as determined by the
comparison
function
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_set), | intent(in) | :: | this | |||
class(*), | intent(in) | :: | item | The value which those in the set are being compared to |
||
procedure(subtraction_func) | :: | subtraction | A function determining the magnitude of the difference between two items |
The value from the set which, when passed to subtraction
with item
as the other argument, returns the smallest value
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(data_set), | intent(in) | :: | this | |||
procedure(addition_func) | :: | addition | A procedure performing addition between two container objects and returning the result in another container |
A container holding the sum of all of the items held within this set
procedure(union_func), public, deferred :: union | Returns a set containing the items held in this set and the passed set. |
generic, public :: operator(+) => union | Returns the union of the two sets |
procedure(intersect_func), public, deferred :: intersection | Returns a set containing only the items present in both this set and the argument |
procedure(diff_func), public, deferred :: difference | Returns a set containing the item present in this set but not present in the argument |
generic, public :: operator(-) => difference | Returns the difference between the two sets |
procedure(pure_diff_func), public, deferred :: symmetric_difference | Returns a set containing those items present either only in this set or only in the argument |
procedure(relation_func), public, deferred :: is_disjoint | True if none of the items in this set are present in the argument |
procedure(relation_func), public, deferred :: is_subset | True if every element in this set is also in the argument |
procedure(relation_func), public, deferred :: is_proper_subset | True if every element in this set is also in the argument and this set is not equal to the argument |
procedure(relation_func), public, deferred :: is_superset | True if every element in the argument is also present in this set. |
procedure(relation_func), public, deferred :: is_proper_superset | True if every element in the argument is also present in this set and the argument is not equal to this set. |
procedure(relation_func), public, deferred :: is_equal | True if this set and the argument contain only the same items. |
generic, public :: operator(<=) => is_subset | True if every element in this set is also in the argument |
generic, public :: operator(<) => is_proper_subset | True if every element in this set is also in the argument and this set is not equal to the argument |
generic, public :: operator(>=) => is_superset | True if every element in the argument is also present in this set. |
generic, public :: operator(>) => is_proper_superset | True if every element in the argument is also present in this set and the argument is not equal to this set. |
generic, public :: operator(==) => is_equal | True if this set and the argument contain only the same items. |
procedure(has_func), public, deferred :: has | True if the argument is present in the set |
procedure(empty_func), public, deferred :: is_empty | True if the set contains no items |
procedure(peek_func), public, deferred :: peek | Returns an item, at random, from the set |
procedure(filter_func), public, deferred :: filter | Returns a set containing all elements from this set for which
the provided test procedure returns |
procedure(enum_func), public, deferred :: enumerate | Returns an [array_list] containing all of the items present in this set. |
procedure(min_func), public, deferred :: min | Returns the smallest item in the set as determined using the provided comparison procedure |
procedure(max_func), public, deferred :: max | Returns the largest item in the set as determined using the provided comparison procedure |
procedure(nearest_func), public, deferred :: nearest | Returns the item in the set for which the provided subtraction procedure returns the smallest absolute value |
procedure(sum_func), public, deferred :: sum | Returns an item representing the sum as determined by iteratively applying the provided addition procedure to all items in the set |
An abstract type for set data structures. These sets support a similar selection of operations as do their mathematical counterparts. The collection of methods for this type waas inspired by those available for the frozenset type in Python.