ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_arrayMembership Module Reference

This module contains procedures and generic interfaces for assessing whether particular value(s) or any values or all values within a collection are members of another collection of values, or within a range of values that specifies a mathematical set.
More...

Data Types

interface  operator(.allin.)
  Generate and return .true. if all elements of the input array-like val are members of the input array-like object Set, otherwise, return .false.. More...
 
interface  operator(.allinrange.)
  Generate and return .true. if all elements of the input array-like object val are within a range specified by the input vector Set(1:2), otherwise, return .false.. More...
 
interface  operator(.anyin.)
  Generate and return .true. if any elements of the input array-like val are members of the input array-like object Set, otherwise, return .false.. More...
 
interface  operator(.anyinrange.)
  Generate and return .true. if any elements of the input array-like object val are within a range specified by the input vector Set(1:2), otherwise, return .false.. More...
 
interface  operator(.in.)
  Generate and return .true. if the input value val is a member of the input array-like object set, otherwise, return .false.. More...
 
interface  operator(.inrange.)
  Generate and return .true. if the input value val is within a range specified by the input array-like object set(1:2), otherwise, return .false.. More...
 

Variables

character(*, SK), parameter MODULE_NAME = "@pm_arrayMembership"
 

Detailed Description

This module contains procedures and generic interfaces for assessing whether particular value(s) or any values or all values within a collection are members of another collection of values, or within a range of values that specifies a mathematical set.

In mathematics, an element or member of a set is any one of the distinct objects that belong to that set.
The relation is an element of, also called set membership, is denoted by the symbol \(\in\).
Writing \(x\in A\) means that \(x\) is an element of \(A\).
Equivalent expressions are \(x\) is a member of \(A\), \(x\) belongs to \(A\), \(x\) is in \(A\) and \(x\) lies in \(A\).
The expressions \(A\) includes \(x\) and \(A\) contains \(x\) are also used to mean set membership, although it is more frequently used to mean instead \(x\) is a subset of \(A\).
Logician George Boolos strongly urged that contains be used for membership only, and includes for the subset relation only.
For the relation \(\in\), the converse relation \(\in^T\) may be written \(A\ni x\) meaning \(A\) contains or includes \(x\).
The negation of set membership is denoted by the symbol \(\notin\).
Writing \(x\notin A\) means that \(x\) is not an element of \(A\).

Note
The functionalities of the generic interfaces .allin. and .allinrange. of this module are similar to that of the set-theoretic subset operation \(\subset\).
In mathematics, set \(A\) is a subset of a set \(B\) if all elements of \(A\) are also elements of \(B\).
Then, \(B\) is then a superset of \(A\).
It is possible for \(A\) and \(B\) to be equal.
If they are unequal, then \(A\) is a proper subset of \(B\).
The relationship of one set being a subset of another is called inclusion (or sometimes containment).
The statement \(A\) is a subset of \(B\) may also be expressed as \(B\) includes (or contains) \(A\) or \(A\) is included (or contained) in \(B\).
A \(k\)-subset is a subset with \(k\) elements.
The functionalities of the generic interfaces .anyin. and .anyinrange. of this module are similar to testing whether the output of set-theoretic intersection operation \(A\cap B\) is non-empty.
In set theory, the intersection of two sets \(A\) and \(B\), denoted by \(A\cap B\) is the set containing any elements of \(A\) that also belong to \(B\) or equivalently, any elements of \(B\) that also belong to \(A\).
See also
operator(.in.)
operator(.allin.)
operator(.anyin.)
operator(.inrange.)
operator(.anyinrange.)
operator(.allinrange.)
operator(.divmul.)
operator(.subadd.)
getMinMax
setMinMax
pm_arraySearch
pm_arrayFind
Test:
test_pm_arrayMembership


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Fatemeh Bagheri, Wednesday 12:24 PM, August 11, 2021, Dallas, TX

Variable Documentation

◆ MODULE_NAME

character(*, SK), parameter pm_arrayMembership::MODULE_NAME = "@pm_arrayMembership"

Definition at line 80 of file pm_arrayMembership.F90.