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

This module contains the derived types for generating allocatable containers of scalar, vector, matrix, or cube of integer, real, complex, logical, and string values of arbitrary kinds.
More...

Data Types

interface  assignment(=)
  Assign the contents of the input source to the output destin. More...
 
type  ccc_pdt
 This is the parameterized derived type for generating a container of a cube component of type complex of arbitrary kind. More...
 
type  ccc_type
 This is the derived type for generating a container of a cube component of type complex of default kind CK.
More...
 
type  cci_pdt
 This is the parameterized derived type for generating a container of a cube component of type integer of arbitrary kind. More...
 
type  cci_type
 This is the derived type for generating a container of a cube component of type integer of default kind IK.
More...
 
type  ccl_pdt
 This is the parameterized derived type for generating a container of a cube component of type logical of arbitrary kind. More...
 
type  ccl_type
 This is the derived type for generating a container of a cube component of type logical of default kind LK.
More...
 
type  ccp_type
 This is the derived type for generating a container of a cube component of type unlimited polymorphic.
More...
 
type  ccr_pdt
 This is the parameterized derived type for generating a container of a cube component of type real of arbitrary kind. More...
 
type  ccr_type
 This is the derived type for generating a container of a cube component of type real of default kind RK.
More...
 
type  ccs_pdt
 This is the parameterized derived type for generating a container of a cube component of type character of arbitrary kind of allocatable length. More...
 
type  ccs_type
 This is the derived type for generating a container of a cube component of type character of default kind SK of arbitrary length type parameter.
More...
 
type  cmc_pdt
 This is the parameterized derived type for generating a container of a matrix component of type complex of arbitrary kind. More...
 
type  cmc_type
 This is the derived type for generating a container of a matrix component of type complex of default kind CK.
More...
 
type  cmi_pdt
 This is the parameterized derived type for generating a container of a matrix component of type integer of arbitrary kind. More...
 
type  cmi_type
 This is the derived type for generating a container of a matrix component of type integer of default kind IK.
More...
 
type  cml_pdt
 This is the parameterized derived type for generating a container of a matrix component of type logical of arbitrary kind. More...
 
type  cml_type
 This is the derived type for generating a container of a matrix component of type logical of default kind LK.
More...
 
type  cmp_type
 This is the derived type for generating a container of a matrix component of type unlimited polymorphic.
More...
 
type  cmr_pdt
 This is the parameterized derived type for generating a container of a matrix component of type real of arbitrary kind. More...
 
type  cmr_type
 This is the derived type for generating a container of a matrix component of type real of default kind RK.
More...
 
type  cms_pdt
 This is the parameterized derived type for generating a container of a matrix component of type character of arbitrary kind of allocatable length. More...
 
type  cms_type
 This is the derived type for generating a container of a matrix component of type character of default kind SK of arbitrary length type parameter.
More...
 
type  csc_pdt
 This is the csc_pdt parameterized type for generating instances of container of scalar of complex objects of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128).
More...
 
type  csc_type
 This is the csc_type type for generating instances of container of scalar of logical objects.
More...
 
type  csi_pdt
 This is the csi_pdt parameterized type for generating instances of container of scalar of integer objects of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64).
More...
 
type  csi_type
 This is the csi_type type for generating instances of container of scalar of integer objects.
More...
 
type  csl_pdt
 This is the csl_pdt parameterized type for generating instances of container of scalar of logical objects of kind any supported by the processor (e.g., LK).
More...
 
type  csl_type
 This is the csl_type type for generating instances of container of scalar of logical objects.
More...
 
type  csp_type
 This is the csp_type type for generating instances of container of scalar unlimited polymorphic objects.
More...
 
type  csr_pdt
 This is the csr_pdt parameterized type for generating instances of container of scalar of real objects of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128).
More...
 
type  csr_type
 This is the csr_type type for generating instances of container of scalar of logical objects.
More...
 
type  css_pdt
 This is the css_pdt parameterized type for generating instances of container of scalar of string objects of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU).
More...
 
type  css_type
 This is the css_type type for generating instances of container of scalar of string objects.
More...
 
type  cvc_pdt
 This is the parameterized derived type for generating a container of an allocatable vector component of type complex of arbitrary kind. More...
 
type  cvc_type
 This is the derived type for generating a container of a vector component of type complex of default kind CK.
More...
 
type  cvi_pdt
 This is the parameterized derived type for generating a container of a vector component of type integer of arbitrary kind. More...
 
type  cvi_type
 This is the derived type for generating a container of a vector component of type integer of default kind IK.
More...
 
type  cvl_pdt
 This is the parameterized derived type for generating a container of an allocatable vector component of type logical of arbitrary kind. More...
 
type  cvl_type
 This is the derived type for generating a container of a vector component of type logical of default kind LK.
More...
 
type  cvp_type
 This is the derived type for generating a container of a vector component of type unlimited polymorphic.
More...
 
type  cvr_pdt
 This is the parameterized derived type for generating a container of an allocatable vector component of type real of arbitrary kind. More...
 
type  cvr_type
 This is the derived type for generating a container of a vector component of type real of default kind RK.
More...
 
type  cvs_pdt
 This is the parameterized derived type for generating a container of a vector component of type character of arbitrary kind of allocatable length. More...
 
type  cvs_type
 This is the derived type for generating a container of a vector component of type character of default kind SK of arbitrary length type parameter.
More...
 
interface  operator(/=)
  Generate and return the result of comparing the values of two input containers of scalar values using the /= operator. More...
 
interface  operator(<)
  Generate and return the result of comparing the values of two input containers of scalar values using the < operator. More...
 
interface  operator(<=)
  Generate and return the result of comparing the values of two input containers of scalar values using the <= operator. More...
 
interface  operator(==)
  Generate and return the result of comparing the values of the two input containers of scalar of arbitrary type and kind using the == operator. More...
 
interface  operator(>)
  Generate and return the result of comparing the values of two input containers of scalar values using the > operator. More...
 
interface  operator(>=)
  Generate and return the result of comparing the values of two input containers of scalar values using the >= operator. More...
 

Detailed Description

This module contains the derived types for generating allocatable containers of scalar, vector, matrix, or cube of integer, real, complex, logical, and string values of arbitrary kinds.

This module offer two broad categories of container derived types:

  1. containers that end with \(\ms{*_type}\) are derived type containers of intrinsic types of default kind: SK, IK, LK, CK, RK.
  2. containers that end with \(\ms{*_pdt}\) are parameterized derived type containers of intrinsic types of arbitrary kind.

Each of the above categories contains the following subcategories based on their component (val) rank:

  1. containers that end with \(\ms{*_type}\) are derived type containers of intrinsic types of default kind: SK, IK, LK, CK, RK.
  2. containers that end with \(\ms{*_pdt}\) are parameterized derived type containers of intrinsic types of arbitrary kind type parameter.

Naming convention

The containers of this module use a concise letter-based naming convention:

  1. The first letter in all container names \(\ms{c**_type}\) or \(\ms{c**_pdt}\) stands for container.
  2. The second letter in all container names \(\ms{*x*_type}\) or \(\ms{*x*_pdt}\) stands for the rank of the component of the container:
    1. The letter \(\ms{s}\) as in \(\ms{*s*_type}\) or \(\ms{*s*_pdt}\) stands for a scalar-component container (container%val).
    2. The letter \(\ms{v}\) as in \(\ms{*v*_type}\) or \(\ms{*v*_pdt}\) stands for a vector-component container (container%val(:)).
    3. The letter \(\ms{m}\) as in \(\ms{*m*_type}\) or \(\ms{*m*_pdt}\) stands for a matrix-component container (container%val(:,:)).
    4. The letter \(\ms{c}\) as in \(\ms{*c*_type}\) or \(\ms{*c*_pdt}\) stands for a cube-component container (container%val(:,:,:)).
  3. The third letter in all container names \(\ms{**x_type}\) or \(\ms{**x_pdt}\) stands for the type of the component of the container:
    1. The letter \(\ms{s}\) as in \(\ms{**s_type}\) or \(\ms{**s_pdt}\) stands for a string-component (character) container.
    2. The letter \(\ms{i}\) as in \(\ms{**i_type}\) or \(\ms{**i_pdt}\) stands for a integer-component container.
    3. The letter \(\ms{l}\) as in \(\ms{**l_type}\) or \(\ms{**l_pdt}\) stands for a logical-component container.
    4. The letter \(\ms{c}\) as in \(\ms{**c_type}\) or \(\ms{**c_pdt}\) stands for a complex-component container.
    5. The letter \(\ms{r}\) as in \(\ms{**r_type}\) or \(\ms{**r_pdt}\) stands for a real-component container.
  4. The final suffix \(\ms{***_type}\) and \(\ms{***_pdt}\) stand for the derived type and Parameterized Derived Type (PDT) containers.

For example:

  1. Read css_type as container of scalar of string (character) derived type (of default kind SK). This container is widely known as varying string or simply string in the Fortran community.
  2. Read css_pdt as container of scalar of string (character) derived type (of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU)). This container is widely known as varying string or simply string in the Fortran community.
  3. Read csi_type as container of scalar of integer derived type (of default kind IK).
  4. Read cvr_type as container of vector of real derived type (of default kind RK).

What is the use of containers?

Containers are essential for creating jagged arrays.
While string containers are the most popular container type in almost all languages, other container types and ranks offered by this module find heavy use in Machine Learning and Data Science or even simple computational tasks.

Warning
The elemental versions of the generic interfaces of this procedure are known to yield incorrect result if compiled by gfortran version 10-12.
The Intel Fortran compiler yields the correct elemental results.
Developer Remark:
Currently, only the scalar containers (matching names \(\ms{cs*_pdt}\) and \(\ms{cs*_type}\)) have custom elemental constructors.
The was no perceived usage and consensus on how to design custom constructors for containers of higher-rank components (e.g., vector, matrix, and cube containers).
See also
pm_kind
Todo:
Normal Priority: Currently, only the following containers are exemplified:
  1. css_pdt
  2. css_type

Examples for the following generic interfaces must be added:

  1. csi_pdt
  2. csl_pdt
  3. csc_pdt
  4. csr_pdt
  5. csi_type
  6. csl_type
  7. csc_type
  8. csr_type


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, Tuesday April 30, 2019, 12:58 PM, SEIR, UTA