data_set_mod Module

module~~data_set_mod~~UsesGraph module~data_set_mod data_set_mod module~countable_mod countable_mod module~countable_mod->module~data_set_mod module~ordered_mod ordered_mod module~countable_mod->module~ordered_mod module~abstract_container_mod abstract_container_mod module~abstract_container_mod->module~data_set_mod module~array_list_mod array_list_mod module~abstract_container_mod->module~array_list_mod module~iterable_mod iterable_mod module~abstract_container_mod->module~iterable_mod module~iterator_mod iterator_mod module~abstract_container_mod->module~iterator_mod module~list_mod list_mod module~abstract_container_mod->module~list_mod module~abstract_container_mod->module~ordered_mod module~deque_mod deque_mod module~abstract_container_mod->module~deque_mod module~array_list_mod->module~data_set_mod module~iterable_mod->module~countable_mod module~iterable_mod->module~ordered_mod module~iterator_mod->module~array_list_mod module~iterator_mod->module~iterable_mod module~iterator_mod->module~ordered_mod iso_fortran_env iso_fortran_env iso_fortran_env->module~abstract_container_mod module~list_mod->module~array_list_mod module~ordered_mod->module~array_list_mod module~queue_mod queue_mod module~ordered_mod->module~queue_mod module~deque_mod->module~list_mod module~queue_mod->module~deque_mod
Help

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.

Used By

module~~data_set_mod~~UsedByGraph module~data_set_mod data_set_mod module~dictionary_mod dictionary_mod module~data_set_mod->module~dictionary_mod module~dynamic_set_mod dynamic_set_mod module~data_set_mod->module~dynamic_set_mod module~multimap_mod multimap_mod module~dictionary_mod->module~multimap_mod module~map_mod map_mod module~dictionary_mod->module~map_mod module~multiset_mod multiset_mod module~dynamic_set_mod->module~multiset_mod module~map_mod->module~multimap_mod
Help

Abstract Interfaces

abstract interface

  • private pure function union_func(this, other)

    Arguments

    Type IntentOptional AttributesName
    class(data_set), intent(in) :: this
    class(data_set), intent(in) :: other

    A second set

    Return Value class(data_set), allocatable

    A set containing all elements found in this one and the other

abstract interface

  • private pure function intersect_func(this, other)

    Arguments

    Type IntentOptional AttributesName
    class(data_set), intent(in) :: this
    class(data_set), intent(in) :: other

    A second set

    Return Value integer

abstract interface

  • private pure function diff_func(this, other)

    Arguments

    Type IntentOptional AttributesName
    class(data_set), intent(in) :: this
    class(data_set), intent(in) :: other

    A second set

    Return Value class(data_set), allocatable

    A set containing elements found in this one and not the other

abstract interface

  • private pure function pure_diff_func(this, other)

    Arguments

    Type IntentOptional AttributesName
    class(data_set), intent(in) :: this
    class(data_set), intent(in) :: other

    A second set

    Return Value class(data_set), allocatable

    A set containing elements found in one, but not both, of this set or the other set

abstract interface

  • private pure function relation_func(this, other)

    Arguments

    Type IntentOptional AttributesName
    class(data_set), intent(in) :: this
    class(data_set), intent(in) :: other

    A second set

    Return Value logical

    Whether the relationship between this and other is true

abstract interface

  • private pure function has_func(this, item)

    Arguments

    Type IntentOptional AttributesName
    class(data_set), intent(in) :: this
    class(*), intent(in) :: item

    An item which may be contained in the set

    Return Value logical

    Whether item is present in this set

abstract interface

  • private pure function empty_func(this)

    Arguments

    Type IntentOptional AttributesName
    class(data_set), intent(in) :: this

    Return Value logical

    .true. if this set contains no items

abstract interface

  • private pure function peek_func(this)

    Arguments

    Type IntentOptional AttributesName
    class(data_set), intent(in) :: this

    Return Value class(container), allocatable

    An item contained within the set. Is unallocated if the set is empty.

abstract interface

  • private pure function filter_func(this, test)

    Arguments

    Type IntentOptional AttributesName
    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

    Return Value class(data_set), allocatable

    Contains those items in this set for which test returns .true.

abstract interface

  • private pure function enum_func(this)

    Arguments

    Type IntentOptional AttributesName
    class(data_set), intent(in) :: this

    Return Value type(array_list)

    A list containing copies of all of the items in this set

abstract interface

  • private pure function min_func(this, comparison)

    Arguments

    Type IntentOptional AttributesName
    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

    Return Value class(container), allocatable

    The smallest item in the set, as determined by the comparison function

abstract interface

  • private pure function max_func(this, comparison)

    Arguments

    Type IntentOptional AttributesName
    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

    Return Value class(container), allocatable

    The largest item in the set, as determined by the comparison function

abstract interface

  • private pure function nearest_func(this, item, subtraction)

    Arguments

    Type IntentOptional AttributesName
    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

    Return Value class(container), allocatable

    The value from the set which, when passed to subtraction with item as the other argument, returns the smallest value

abstract interface

  • private pure function sum_func(this, addition)

    Arguments

    Type IntentOptional AttributesName
    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

    Return Value class(container), allocatable

    A container holding the sum of all of the items held within this set


Derived Types

type, public, abstract, extends(countable) :: data_set

Type-Bound Procedures

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 .true.

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

Description

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.