diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 000000000..b7b858437 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/conf.py b/doc/conf.py new file mode 100644 index 000000000..11b8ea260 --- /dev/null +++ b/doc/conf.py @@ -0,0 +1,33 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +with open('../VERSION') as version_file: + version = version_file.read().strip() + +project = 'stdlib' +copyright = '2024, stdlib contributors' +author = 'stdlib contributors' +release = version + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'myst_parser', # enable markdown files for sphinx +] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'pydata_sphinx_theme' +html_static_path = ['_static'] diff --git a/doc/index.md b/doc/index.md deleted file mode 100644 index 4ea7dbb54..000000000 --- a/doc/index.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Contributing and specs ---- - -@warning -This page is currently under construction! - -@todo -Improve the title of this FORD "pages" section, and -improve the organization of pages -to separate end-user, high-level documentation and examples from developer documentation and specs. diff --git a/doc/index.rst b/doc/index.rst new file mode 100644 index 000000000..f52700c71 --- /dev/null +++ b/doc/index.rst @@ -0,0 +1,23 @@ +.. stdlib documentation master file, created by + sphinx-quickstart on Sat May 11 17:18:44 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + + +.. include:: ../README.md + :parser: myst_parser.sphinx_ + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + ../README + specs/index + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/doc/make.bat b/doc/make.bat new file mode 100644 index 000000000..9a9487ba1 --- /dev/null +++ b/doc/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=%~dp0 +set BUILDDIR=build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 000000000..ea88fc557 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,3 @@ +sphinx +myst_parser +pydata_sphinx_theme \ No newline at end of file diff --git a/doc/specs/index.md b/doc/specs/index.md deleted file mode 100644 index de3eb8f38..000000000 --- a/doc/specs/index.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Specifications (specs) ---- - -# Fortran stdlib Specifications (specs) - -This is an index/directory of the specifications (specs) for each new module/feature as described in the -[workflow document](../Workflow.html). - -[TOC] - -## Experimental Features & Modules - - - [ansi](./stdlib_ansi.html) - Terminal color and style escape sequences - - [array](./stdlib_array.html) - Procedures for index manipulation and array handling - - [ascii](./stdlib_ascii.html) - Procedures for handling ASCII characters - - [constants](./stdlib_constants.html) - Constants - - [bitsets](./stdlib_bitsets.html) - Bitset data types and procedures - - [error](./stdlib_error.html) - Catching and handling errors - - [hash](./stdlib_hash_procedures.html) - Hashing integer - vectors or character strings - - [hashmaps](./stdlib_hashmaps.html) - Hash maps/tables - - [io](./stdlib_io.html) - Input/output helper & convenience - - [kinds](./stdlib_kinds.html) - Kind parameters - - [linalg](./stdlib_linalg.html) - Linear Algebra - - [linalg_state_type](./stdlib_linalg_state_type.html) - Linear Algebra state and error handling - - [logger](./stdlib_logger.html) - Runtime logging system - - [math](./stdlib_math.html) - General purpose mathematical functions - - [optval](./stdlib_optval.html) - Fallback value for optional arguments - - [quadrature](./stdlib_quadrature.html) - Numerical integration - - [random](./stdlib_random.html) - Probability Distributions random number generator - - [sorting](./stdlib_sorting.html) - Sorting of rank one arrays - - [stats](./stdlib_stats.html) - Descriptive Statistics - - [stats_distributions_uniform](./stdlib_stats_distribution_uniform.html) - Uniform Probability Distribution - - [stats_distributions_normal](./stdlib_stats_distribution_normal.html) - Normal Probability Distribution - - [stats_distributions_exponential](./stdlib_stats_distribution_exponential.html) - Exponential Probability Distribution - - [string\_type](./stdlib_string_type.html) - Basic string support - - [stringlist_type](./stdlib_stringlist_type.html) - 1-Dimensional list of strings - - [strings](./stdlib_strings.html) - String handling and manipulation routines - - [version](./stdlib_version.html) - Version information - -## Released/Stable Features & Modules - - - (None yet) diff --git a/doc/specs/index.rst b/doc/specs/index.rst new file mode 100644 index 000000000..444c4b554 --- /dev/null +++ b/doc/specs/index.rst @@ -0,0 +1,42 @@ +Fortran stdlib Specifications (specs) +===================================== + +This is an index/directory of the specifications (specs) for each new module/feature as described in the +[workflow document](../Workflow.html). + +Experimental Features & Modules +=============================== + +.. toctree:: + :maxdepth: 1 + :caption: Contents: + + stdlib_ansi + stdlib_array + stdlib_ascii + stdlib_bitsets + stdlib_constants + stdlib_error + stdlib_hash_prcedures + stdlib_hashmaps + stdlib_io + stdlib_kinds + stdlib_linalg + stdlib_linalg_state_type + stdlib_logger + stdlib_math + stdlib_optval + stdlib_quadrature + stdlib_random + stdlib_selection + stdlib_sorting + stdlib_specialfunctions_gamma + stdlib_specialfunctions + stdlib_stats_distribution_exponential + stdlib_stats_distribution_uniform + stdlib_stats + stdlib_str2num + stdlib_string_type + stdlib_stringlist_type + stdlib_strings + stdlib_version diff --git a/doc/specs/stdlib_ansi.md b/doc/specs/stdlib_ansi.md index dc55828e2..423bed883 100644 --- a/doc/specs/stdlib_ansi.md +++ b/doc/specs/stdlib_ansi.md @@ -1,12 +1,5 @@ ---- -title: terminal colors -... - - -# The `stdlib_ansi` module - -[TOC] - +# `stdlib_ansi` + ## Introduction Support terminal escape sequences to produce styled and colored terminal output. diff --git a/doc/specs/stdlib_array.md b/doc/specs/stdlib_array.md index e10a95aff..9e115186f 100644 --- a/doc/specs/stdlib_array.md +++ b/doc/specs/stdlib_array.md @@ -1,11 +1,5 @@ ---- -title: array ---- - -# The `stdlib_array` module - -[TOC] - +# `stdlib_array` + ## Introduction Module for index manipulation and array handling tasks. @@ -45,8 +39,8 @@ Returns an array of default integer size, with a maximum length of `size(array)` #### Examples -```fortran -{!example/array/example_trueloc.f90!} +```{literalinclude} ../../example/array/example_trueloc.f90 +:language: Fortran ``` @@ -82,6 +76,6 @@ Returns an array of default integer size, with a maximum length of `size(array)` #### Examples -```fortran -{!example/array/example_falseloc.f90!} -``` +```{literalinclude} ../../example/array/example_falseloc.f90 +:language: Fortran +``` \ No newline at end of file diff --git a/doc/specs/stdlib_ascii.md b/doc/specs/stdlib_ascii.md index 6a1d997df..02db20607 100644 --- a/doc/specs/stdlib_ascii.md +++ b/doc/specs/stdlib_ascii.md @@ -1,11 +1,5 @@ ---- -title: ascii ---- - -# The `stdlib_ascii` module - -[TOC] - +# `stdlib_ascii` + ## Introduction The `stdlib_ascii` module provides procedures for handling and manipulating @@ -50,9 +44,9 @@ The result is an intrinsic character type of the same length as `string`. #### Example -```fortran -{!example/ascii/example_ascii_to_lower.f90!} -``` +```{literalinclude} ../../example/ascii/example_ascii_to_lower.f90 +:language: Fortran +``` ### `to_upper` @@ -82,8 +76,8 @@ The result is an intrinsic character type of the same length as `string`. #### Example -```fortran -{!example/ascii/example_ascii_to_upper.f90!} +```{literalinclude} ../../example/ascii/example_ascii_to_upper.f90 +:language: Fortran ``` ### `to_title` @@ -119,8 +113,8 @@ The result is an intrinsic character type of the same length as `string`. #### Example -```fortran -{!example/ascii/example_ascii_to_title.f90!} +```{literalinclude} ../../example/ascii/example_ascii_to_title.f90 +:language: Fortran ``` ### `to_sentence` @@ -154,8 +148,8 @@ The result is an intrinsic character type of the same length as `string`. #### Example -```fortran -{!example/ascii/example_ascii_to_sentence.f90!} +```{literalinclude} ../../example/ascii/example_ascii_to_sentence.f90 +:language: Fortran ``` ### `reverse` @@ -186,6 +180,6 @@ The result is an intrinsic character type of the same length as `string`. #### Example -```fortran -{!example/ascii/example_ascii_reverse.f90!} -``` +```{literalinclude} ../../example/ascii/example_ascii_reverse.f90 +:language: Fortran +``` \ No newline at end of file diff --git a/doc/specs/stdlib_bitsets.md b/doc/specs/stdlib_bitsets.md index f1e55aeb1..f880f7f59 100644 --- a/doc/specs/stdlib_bitsets.md +++ b/doc/specs/stdlib_bitsets.md @@ -1,11 +1,5 @@ ---- -title: bitsets ---- - -# The `stdlib_bitsets` module - -[TOC] - +# `stdlib_bitsets` + ## Introduction The `stdlib_bitsets` module implements bitset types. A bitset is a @@ -60,7 +54,7 @@ bits. The other constants that are error codes are summarized below: |`write_failure`|Failure on a `write` statement| -## The `stdlib_bitsets` derived types +## `stdlib_bitsets` derived types The `stdlib_bitsets` module defines three derived types, `bitset_type`, `bitset_64`, and `bitset_large`. `bitset_type` is an abstract @@ -204,8 +198,8 @@ is mapped to a set bit, and `.false.` is mapped to an unset bit. #### Example -```fortran -{!example/bitsets/example_bitsets_assignment.f90!} +```{literalinclude} ../../bitsets/example_bitsets_assignment.f90 +:language: Fortran ``` ### Table of the non-member comparison operations @@ -258,8 +252,8 @@ otherwise it is `.false.`. #### Example -```fortran -{!example/bitsets/example_bitsets_all.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_all.f90 +:language: Fortran ``` ### `and` - bitwise `and` of the bits of two bitsets @@ -295,8 +289,8 @@ number of bits as `set1`. #### Example -```fortran -{!example/bitsets/example_bitsets_and.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_and.f90 +:language: Fortran ``` ### `and_not` - Bitwise `and` of one bitset with the negation of another @@ -333,8 +327,8 @@ number of bits as `set1`, otherwise the result is undefined. #### Example -```fortran -{!example/bitsets/example_bitsets_and_not.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_and_not.f90 +:language: Fortran ``` ### `any` - determine whether any bits are set @@ -367,8 +361,8 @@ is `.false.`. #### Example -```fortran -{!example/bitsets/example_bitsets_any.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_any.f90 +:language: Fortran ``` ### `bit_count` - return the number of bits that are set @@ -401,8 +395,8 @@ equal to the number of bits that are set in `self`. #### Example -```fortran -{!example/bitsets/example_bitsets_bit_count.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_bit_count.f90 +:language: Fortran ``` #### `bits` - returns the number of bits @@ -435,8 +429,8 @@ the number of defined bits in `self`. #### Example -```fortran -{!example/bitsets/example_bitsets_bits.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_bits.f90 +:language: Fortran ``` ### `clear` - clears a sequence of one or more bits @@ -486,8 +480,8 @@ an `intent(in)` argument. #### Example -```fortran -{!example/bitsets/example_bitsets_clear.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_clear.f90 +:language: Fortran ``` ### `extract` - create a new bitset from a range in an old bitset @@ -537,8 +531,8 @@ an `intent(out)` argument. If present it shall have one of the values: #### Example -```fortran -{!example/bitsets/example_bitsets_extract.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_extract.f90 +:language: Fortran ``` ### `flip` - flip the values of a sequence of one or more bits @@ -589,8 +583,8 @@ an `intent(in)` argument. #### Example -```fortran -{!example/bitsets/example_bitsets_flip.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_flip.f90 +:language: Fortran ``` ### `from_string` - initializes a bitset from a binary literal @@ -639,8 +633,8 @@ codes: #### Example -```fortran -{!example/bitsets/example_bitsets_from_string.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_from_string.f90 +:language: Fortran ``` ### `init` - `bitset_type` initialization routines @@ -688,8 +682,8 @@ stop code. It can have any of the following error codes: #### Example -```fortran -{!example/bitsets/example_bitsets_init.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_init.f90 +:language: Fortran ``` ### `input` - reads a bitset from an unformatted file @@ -741,8 +735,8 @@ values for this `status` are: #### Example -```fortran -{!example/bitsets/example_bitsets_input.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_input.f90 +:language: Fortran ``` ### `none` - determines whether no bits are set @@ -776,8 +770,8 @@ The result is `.true.` if no bits in `self` are set, otherwise it is #### Example -```fortran -{!example/bitsets/example_bitsets_none.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_none.f90 +:language: Fortran ``` ### `not` - Performs the logical complement on a bitset @@ -806,8 +800,8 @@ complement of their values on input. #### Example -```fortran -{!example/bitsets/example_bitsets_not.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_not.f90 +:language: Fortran ``` ### `or` - Bitwise OR of the bits of two bitsets @@ -843,8 +837,8 @@ otherwise the results are undefined. #### Example -```fortran -{!example/bitsets/example_bitsets_or.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_or.f90 +:language: Fortran ``` ### `output` - Writes a binary representation of a bitset to a file @@ -886,8 +880,8 @@ code. The two code values have the meaning: #### Example -```fortran -{!example/bitsets/example_bitsets_output.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_output.f90 +:language: Fortran ``` ### `read_bitset` - initializes `self` with the value of a *bitset_literal* @@ -967,8 +961,8 @@ as its error code. The possible error codes are: #### Example -```fortran -{!example/bitsets/example_bitsets_read_bitset.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_read_bitset.f90 +:language: Fortran ``` ### `set` - sets a sequence of one or more bits to 1 @@ -1021,8 +1015,8 @@ Elemental subroutine #### Example -```fortran -{!example/bitsets/example_bitsets_set.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_set.f90 +:language: Fortran ``` ### `test` - determine whether a bit is set @@ -1061,8 +1055,8 @@ otherwise it is `.false.`. If `pos` is outside the range #### Example -```fortran -{!example/bitsets/example_bitsets_test.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_test.f90 +:language: Fortran ``` ### `to_string` - represent a bitset as a binary literal @@ -1105,8 +1099,8 @@ the stop code. The values have the following meanings: #### Example -```fortran -{!example/bitsets/example_bitsets_to_string.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_to_string.f90 +:language: Fortran ``` ### `value` - determine the value of a bit @@ -1144,8 +1138,8 @@ is zero. #### Example -```fortran -{!example/bitsets/example_bitsets_value.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_value.f90 +:language: Fortran ``` ### `write_bitset` - writes a *bitset-literal* @@ -1211,8 +1205,8 @@ the following error code values: #### Example -```fortran -{!example/bitsets/example_bitsets_write_bitset.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_write_bitset.f90 +:language: Fortran ``` ### `xor` - bitwise exclusive `or` @@ -1248,8 +1242,8 @@ samee number of bits, otherwise the result is undefined. #### Example -```fortran -{!example/bitsets/example_bitsets_xor.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_xor.f90 +:language: Fortran ``` ## Specification of the `stdlib_bitsets` operators @@ -1294,8 +1288,8 @@ to the same value, otherwise the result is `.false.`. #### Example -```fortran -{!example/bitsets/example_bitsets_equality.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_equality.f90 +:language: Fortran ``` ### `/=` - compare two bitsets to determine whether any bits differ in value @@ -1338,8 +1332,8 @@ the result is `.false.`. #### Example -```fortran -{!example/bitsets/example_bitsets_inequality.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_inequality.f90 +:language: Fortran ``` ### `>=` - compare two bitsets to determine whether the first is greater than or equal to the second @@ -1385,8 +1379,8 @@ or the highest order different bit is set to 1 in `set1` and to 0 in #### Example -```fortran -{!example/bitsets/example_bitsets_ge.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_ge.f90 +:language: Fortran ``` ### `>` - compare two bitsets to determine whether the first is greater than the other @@ -1432,8 +1426,8 @@ highest order different bit is set to 1 in `set1` and to 0 in `set2`, #### Example -```fortran -{!example/bitsets/example_bitsets_gt.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_gt.f90 +:language: Fortran ``` ### `<=` - compare two bitsets to determine whether the first is less than or equal to the other @@ -1479,8 +1473,8 @@ or the highest order different bit is set to 0 in `set1` and to 1 in #### Example -```fortran -{!example/bitsets/example_bitsets_le.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_le.f90 +:language: Fortran ``` ### `<` - compare two bitsets to determine whether the first is less than the other @@ -1526,6 +1520,6 @@ highest order different bit is set to 0 in `set1` and to 1 in `set2`, #### Example -```fortran -{!example/bitsets/example_bitsets_lt.f90!} +```{literalinclude} ../../example/bitsets/example_bitsets_lt.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_constants.md b/doc/specs/stdlib_constants.md index c12f29ea1..af4ef0689 100644 --- a/doc/specs/stdlib_constants.md +++ b/doc/specs/stdlib_constants.md @@ -1,8 +1,4 @@ ---- -title: constants ---- - -[TOC] +# `stdlib_constants` ## Introduction @@ -73,6 +69,6 @@ Returns a scalar of `real` type which is either the value or the uncertainty of ## Example -```fortran -{!example/constants/example_constants.f90!} +```{literalinclude} ../../example/constants/example_constants.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_error.md b/doc/specs/stdlib_error.md index af57d3875..cca0b84e3 100644 --- a/doc/specs/stdlib_error.md +++ b/doc/specs/stdlib_error.md @@ -1,11 +1,5 @@ ---- -title: error ---- - -# The `stdlib_error` module - -[TOC] - +# `stdlib_error` + ## Introduction Catching and handling errors. @@ -52,17 +46,17 @@ If `condition` is `.false.`, and: #### Examples -```fortran -{!example/error/example_check1.f90!} +```{literalinclude} ../../example/error/example_check1.f90 +:language: Fortran ``` -```fortran -{!example/error/example_check2.f90!} +```{literalinclude} ../../example/error/example_check2.f90 +:language: Fortran ``` -```fortran -{!example/error/example_check3.f90!} +```{literalinclude} ../../example/error/example_check3.f90 +:language: Fortran ``` -```fortran -{!example/error/example_check4.f90!} +```{literalinclude} ../../example/error/example_check4.f90 +:language: Fortran ``` ### `error_stop` - aborts the program @@ -93,12 +87,12 @@ Aborts the program with printing the message `msg` to `stderr` and a nonzero exi Without error code: -```fortran -{!example/error/example_error_stop1.f90!} +```{literalinclude} ../../example/error/example_error_stop1.f90 +:language: Fortran ``` With error code: -```fortran -{!example/error/example_error_stop2.f90!} +```{literalinclude} ../../example/error/example_error_stop2.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_hash_procedures.md b/doc/specs/stdlib_hash_procedures.md index 64256213e..5f398e752 100644 --- a/doc/specs/stdlib_hash_procedures.md +++ b/doc/specs/stdlib_hash_procedures.md @@ -1,11 +1,5 @@ ---- -title: hash ---- - -# The `stdlib_hash_32bit` and `stdlib_hash_64bit` modules - -[TOC] - +# `stdlib_hash_32bit` and `stdlib_hash_64bit` + ## Overview of hash procedures The comparison of lexical entities or other objects for equality @@ -465,7 +459,7 @@ has one bad seed only when reduced to a 32-bit output. Its only potential problem is undefined behavior if the key is misaligned. -## The `stdlib_hash_32bit` module +## `stdlib_hash_32bit` module ### Overview of the module @@ -542,8 +536,8 @@ E. Knuth. It multiplies the `key` by the odd valued approximation to ##### Example -```fortran -{!example/hash_procedures/example_fibonacci_hash.f90!} +```{literalinclude} ../../example/hash_procedures/example_fibonacci_hash.f90 +:language: Fortran ``` #### `fnv_1_hash`- calculates a hash code from a key @@ -596,8 +590,8 @@ function for character strings. ##### Example -```fortran -{!example/hash_procedures/example_fnv_1_hash.f90!} +```{literalinclude} ../../example/hash_procedures/example_fnv_1_hash.f90 +:language: Fortran ``` @@ -650,8 +644,8 @@ function for character strings. ##### Example -```fortran -{!example/hash_procedures/example_fnv_1a_hash.f90!} +```{literalinclude} ../../example/hash_procedures/example_fnv_1a_hash.f90 +:language: Fortran ``` @@ -817,8 +811,8 @@ function for character strings. ##### Example -```fortran -{!example/hash_procedures/example_nmhash32.f90!} +```{literalinclude} ../../example/hash_procedures/example_nmhash32.f90 +:language: Fortran ``` @@ -869,8 +863,8 @@ function for character strings. ##### Example -```fortran -{!example/hash_procedures/example_nmhash32x.f90!} +```{literalinclude} ../../example/hash_procedures/example_nmhash32x.f90 +:language: Fortran ``` #### `odd_random_integer` - returns an odd integer @@ -952,8 +946,8 @@ It multiplies the `key` by `seed`, and returns the ##### Example -```fortran -{!example/hash_procedures/example_universal_mult_hash.f90!} +```{literalinclude} ../../example/hash_procedures/example_universal_mult_hash.f90 +:language: Fortran ``` #### `water_hash`- calculates a hash code from a key and a seed @@ -1010,11 +1004,11 @@ function for character strings. ##### Example -```fortran -{!example/hash_procedures/example_water_hash.f90!} +```{literalinclude} ../../example/hash_procedures/example_water_hash.f90 +:language: Fortran ``` -## The `stdlib_hash_64bit` module +## `stdlib_hash_64bit` module ### Overview of the module @@ -1101,8 +1095,8 @@ E. Knuth. It multiplies the `key` by the odd valued approximation to ##### Example -```fortran -{!example/hash_procedures/example_fibonacci_hash_64.f90!} +```{literalinclude} ../../example/hash_procedures/example_fibonacci_hash_64.f90 +:language: Fortran ``` #### `FNV_1`- calculates a hash code from a key @@ -1155,8 +1149,8 @@ function for character strings. ##### Example -```fortran -{!example/hash_procedures/example_fnv_1_hash_64.f90!} +```{literalinclude} ../../example/hash_procedures/example_fnv_1_hash_64.f90 +:language: Fortran ``` @@ -1209,8 +1203,8 @@ function for character strings. ##### Example -```fortran -{!example/hash_procedures/example_fnv_1a_hash_64.f90!} +```{literalinclude} ../../example/hash_procedures/example_fnv_1a_hash_64.f90 +:language: Fortran ``` @@ -1369,8 +1363,8 @@ function for character strings. ##### Example -```fortran -{!example/hash_procedures/example_pengy_hash.f90!} +```{literalinclude} ../../example/hash_procedures/example_pengy_hash.f90 +:language: Fortran ``` @@ -1419,8 +1413,8 @@ and has no known bad seeds. ##### Example -```fortran -{!example/hash_procedures/example_spooky_hash.f90!} +```{literalinclude} ../../example/hash_procedures/example_spooky_hash.f90 +:language: Fortran ``` #### `universal_mult_hash` - maps an integer to a smaller number of bits @@ -1468,8 +1462,8 @@ It multiplies the `key` by `seed`, and returns the ##### Example -```fortran -{!example/hash_procedures/example_universal_mult_hash_64.f90!} +```{literalinclude} ../../example/hash_procedures/example_universal_mult_hash_64.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_hashmaps.md b/doc/specs/stdlib_hashmaps.md index 94b42413f..4e9ca4e0b 100644 --- a/doc/specs/stdlib_hashmaps.md +++ b/doc/specs/stdlib_hashmaps.md @@ -1,11 +1,5 @@ ---- -title: Hash maps ---- - -# The `stdlib_hashmap_wrappers`, and `stdlib_hashmaps` modules - -[TOC] - +# `stdlib_hashmap_wrappers`, and `stdlib_hashmaps` + ## Overview of hash maps A hash map (hash table) is a data structure that maps *keys* to @@ -93,7 +87,7 @@ type `other_type`. The maps allow the addition, removal, and lookup of entries, and the inclusion of data in addition to the entry key. -## The `stdlib_hashmap_wrappers` module +## `stdlib_hashmap_wrappers` module The `stdlib_hashmap_wrappers` module provides data types to represent keys and associated data stored in a module, but is also, a @@ -109,14 +103,14 @@ as a kind value,`int_hash`. It also defines two types, `key_type` and `other_type`, and associated procedures, for storing and manipulating keys and their associated data. -### The `stdlib_hashmap_wrappers`'s constant, `int_hash` +### `stdlib_hashmap_wrappers`'s constant, `int_hash` The constant `int_hash` is used to define the integer kind value for the returned hash codes and variables used to access them. It currently is imported from `stdlib_hash_32bit` where it has the value, `int32`. -### The `stdlib_hashmap_wrappers`' module's derived types +### `stdlib_hashmap_wrappers`' module's derived types The `stdlib_hashmap_wrappers` module defines two derived types: `key_type`, and `other_type`. The `key_type` is intended to be used @@ -228,8 +222,8 @@ is an `intent(out)` argument. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_copy_key.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_copy_key.f90 +:language: Fortran ``` #### `copy_other` - Returns a copy of the other data @@ -260,8 +254,8 @@ is an `intent(out)` argument. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_copy_other.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_copy_other.f90 +:language: Fortran ``` @@ -326,8 +320,8 @@ expected to be minor compared to its faster hashing rate. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_fnv_1_hasher.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_fnv_1_hasher.f90 +:language: Fortran ``` @@ -378,8 +372,8 @@ expected to be minor compared to its faster hashing rate. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_fnv_1a_hasher.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_fnv_1a_hasher.f90 +:language: Fortran ``` #### `free_key` - frees the memory associated with a key @@ -408,8 +402,8 @@ is an `intent(out)` argument. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_free_key.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_free_key.f90 +:language: Fortran ``` #### `free_other` - frees the memory associated with other data @@ -438,8 +432,8 @@ is an `intent(out)` argument. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_free_other.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_free_other.f90 +:language: Fortran ``` @@ -482,8 +476,8 @@ shall be an allocatable of `class(*)`. It is an `intent(out)` argument. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_get.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_get.f90 +:language: Fortran ``` @@ -526,8 +520,8 @@ pointers intended for use as a hash function for the hash maps. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_hasher_fun.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_hasher_fun.f90 +:language: Fortran ``` #### `operator(==)` - Compares two keys for equality @@ -566,8 +560,8 @@ The result is `.true.` if the keys are equal, otherwise `.falss.`. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_equal_keys.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_equal_keys.f90 +:language: Fortran ``` #### `seeded_nmhash32_hasher`- calculates a hash code from a key @@ -616,8 +610,8 @@ This code passes the SMHasher tests. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_seeded_nmhash32_hasher.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_seeded_nmhash32_hasher.f90 +:language: Fortran ``` #### `seeded_nmhash32x_hasher`- calculates a hash code from a key @@ -665,8 +659,8 @@ This code passes the SMHasher tests. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_seeded_nmhash32x_hasher.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_seeded_nmhash32x_hasher.f90 +:language: Fortran ``` #### `seeded_water_hasher`- calculates a hash code from a key @@ -715,8 +709,8 @@ This code passes the SMHasher tests. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_seeded_water_hasher.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_seeded_water_hasher.f90 +:language: Fortran ``` @@ -765,12 +759,12 @@ value to an `int8` vector. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_set.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_set.f90 +:language: Fortran ``` -## The `stdlib_hashmaps` module +## `stdlib_hashmaps` module The `stdlib_hashmaps` module defines three public data types, associated procedures and constants that implement two simple hash map @@ -798,7 +792,7 @@ key field as well as the base `key` type. So for `key_test`, for the key field and so on. Procedures other than `key_key_test` will call the `set` function to generate a key type and pass to `key_key_test`. -### The `stdlib_hashmaps` module's public constants +### `stdlib_hashmaps` module's public constants The module defines several categories of public constants. Some are used to parameterize the empirical slot expansion code. Others @@ -852,7 +846,7 @@ failed. Finally the `array_size_error` indicates that on table creation `slots_bits` is less than `default_bits` or greater than `max_bits`. -### The `stdlib_hashmaps` module's derived types +### `stdlib_hashmaps` module's derived types The `stdlib_hashmaps` module defines three public derived types and seven private types used in the implementation of the public @@ -1259,8 +1253,8 @@ The result will be the number of procedure calls on the hash map. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_calls.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_calls.f90 +:language: Fortran ``` @@ -1297,8 +1291,8 @@ The result will be the number of entries in the hash map. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_entries.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_entries.f90 +:language: Fortran ``` @@ -1332,8 +1326,8 @@ Subroutine ##### Example -```fortran -{!example/hashmaps/example_hashmaps_get_all_keys.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_get_all_keys.f90 +:language: Fortran ``` @@ -1380,8 +1374,8 @@ undefined. associated with a `key`: -```fortran -{!example/hashmaps/example_hashmaps_get_other_data.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_get_other_data.f90 +:language: Fortran ``` @@ -1443,8 +1437,8 @@ has the value `alloc_fault`. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_init.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_init.f90 +:language: Fortran ``` @@ -1485,8 +1479,8 @@ presence in the `map` is being examined. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_key_test.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_key_test.f90 +:language: Fortran ``` @@ -1525,8 +1519,8 @@ number of slots in the hash map. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_loading.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_loading.f90 +:language: Fortran ``` #### `map_entry` - inserts an entry into the hash map @@ -1575,8 +1569,8 @@ is ignored. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_map_entry.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_map_entry.f90 +:language: Fortran ``` #### `map_probes` - returns the number of hash map probes @@ -1614,8 +1608,8 @@ rehashing. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_probes.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_probes.f90 +:language: Fortran ``` #### `num_slots` - returns the number of hash map slots. @@ -1652,8 +1646,8 @@ The result is the number of slots in `map`. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_num_slots.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_num_slots.f90 +:language: Fortran ``` @@ -1687,8 +1681,8 @@ It is the hash method to be used by `map`. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_rehash.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_rehash.f90 +:language: Fortran ``` #### `remove` - removes an entry from the hash map @@ -1728,8 +1722,8 @@ absent, the procedure returns with no entry with the given key. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_remove.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_remove.f90 +:language: Fortran ``` #### `set_other_data` - replaces the other data for an entry @@ -1775,8 +1769,8 @@ not exist and nothing was done. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_set_other_data.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_set_other_data.f90 +:language: Fortran ``` #### `slots_bits` - returns the number of bits used to address the hash map slots @@ -1813,8 +1807,8 @@ The result is the number of bits used in addressing the slots in `map`. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_slots_bits.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_slots_bits.f90 +:language: Fortran ``` @@ -1854,6 +1848,6 @@ from their slot index the map. ##### Example -```fortran -{!example/hashmaps/example_hashmaps_total_depth.f90!} +```{literalinclude} ../../example/hashmaps/example_hashmaps_total_depth.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_io.md b/doc/specs/stdlib_io.md index 8c868802a..c34a6fb77 100644 --- a/doc/specs/stdlib_io.md +++ b/doc/specs/stdlib_io.md @@ -1,11 +1,5 @@ ---- -title: io ---- - -# IO - -[TOC] - +# `stdlib_io` + ## `loadtxt` - load a 2D array from a text file ### Status @@ -39,8 +33,8 @@ Returns an allocated rank-2 `array` with the content of `filename`. ### Example -```fortran -{!example/io/example_loadtxt.f90!} +```{literalinclude} ../../example/io/example_loadtxt.f90 +:language: Fortran ``` @@ -89,8 +83,8 @@ The result is a scalar of type `integer`. ### Example -```fortran -{!example/io/example_open.f90!} +```{literalinclude} ../../example/io/example_open.f90 +:language: Fortran ``` @@ -119,8 +113,8 @@ Provides a text file called `filename` that contains the rank-2 `array`. ### Example -```fortran -{!example/io/example_savetxt.f90!} +```{literalinclude} ../../example/io/example_savetxt.f90 +:language: Fortran ``` @@ -160,8 +154,8 @@ Returns an allocated `array` with the content of `filename` in case of success. ### Example -```fortran -{!example/io/example_loadnpy.f90!} +```{literalinclude} ../../example/io/example_loadnpy.f90 +:language: Fortran ``` @@ -201,8 +195,8 @@ Provides a npy file called `filename` that contains the rank-2 `array`. ### Example -```fortran -{!example/io/example_savenpy.f90!} +```{literalinclude} ../../example/io/example_savenpy.f90 +:language: Fortran ``` ## `getline` @@ -240,8 +234,8 @@ Read a whole line from a formatted unit into a string variable ### Example -```fortran -{!example/io/example_getline.f90!} +```{literalinclude} ../../example/io/example_getline.f90 +:language: Fortran ``` ## Formatting constants @@ -257,6 +251,6 @@ Provides formats for all kinds as defined in the `stdlib_kinds` module. ### Example -```fortran -{!example/io/example_fmt_constants.f90!} +```{literalinclude} ../../example/io/example_fmt_constants.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_kinds.md b/doc/specs/stdlib_kinds.md index 4ccd6c250..4cc07dabc 100644 --- a/doc/specs/stdlib_kinds.md +++ b/doc/specs/stdlib_kinds.md @@ -1,11 +1,5 @@ ---- -title: kinds ---- - -# The `stdlib_kinds` module - -[TOC] - +# `stdlib_kinds` + ## Introduction The `stdlib_kinds` module provides kind parameters for the Fortran intrinsic data types, diff --git a/doc/specs/stdlib_linalg.md b/doc/specs/stdlib_linalg.md index 01a19e624..ab35005af 100644 --- a/doc/specs/stdlib_linalg.md +++ b/doc/specs/stdlib_linalg.md @@ -1,12 +1,6 @@ ---- -title: linalg ---- +# `stdlib_linalg` -# Linear Algebra - -[TOC] - -The `stdlib` linear algebra library provides high-level APIs for dealing with common linear algebra operations. +Linear Algebra : The `stdlib` linear algebra library provides high-level APIs for dealing with common linear algebra operations. ## BLAS and LAPACK @@ -109,12 +103,12 @@ and `y` (extended-precision complex numbers). ### Example -```fortran -{!example/linalg/example_blas_gemv.f90!} +```{literalinclude} ../../example/linalg/example_blas_gemv.f90 +:language: Fortran ``` -```fortran -{!example/linalg/example_lapack_getrf.f90!} +```{literalinclude} ../../example/linalg/example_lapack_getrf.f90 +:language: Fortran ``` ### Licensing @@ -207,24 +201,24 @@ Returns a diagonal array or a vector with the extracted diagonal elements. ### Example -```fortran -{!example/linalg/example_diag1.f90!} +```{literalinclude} ../../example/linalg/example_diag1.f90 +:language: Fortran ``` -```fortran -{!example/linalg/example_diag2.f90!} +```{literalinclude} ../../example/linalg/example_diag2.f90 +:language: Fortran ``` -```fortran -{!example/linalg/example_diag3.f90!} +```{literalinclude} ../../example/linalg/example_diag3.f90 +:language: Fortran ``` -```fortran -{!example/linalg/example_diag4.f90!} +```{literalinclude} ../../example/linalg/example_diag4.f90 +:language: Fortran ``` -```fortran -{!example/linalg/example_diag5.f90!} +```{literalinclude} ../../example/linalg/example_diag5.f90 +:language: Fortran ``` ## `eye` - Construct the identity matrix @@ -270,12 +264,12 @@ A = eye(2,2)/2.0 !! A == diag([0.5, 0.5]) ### Example -```fortran -{!example/linalg/example_eye1.f90!} +```{literalinclude} ../../example/linalg/example_eye1.f90 +:language: Fortran ``` -```fortran -{!example/linalg/example_eye2.f90!} +```{literalinclude} ../../example/linalg/example_eye2.f90 +:language: Fortran ``` ## `trace` - Trace of a matrix @@ -301,8 +295,8 @@ Trace of a matrix (rank-2 array) Returns the trace of the matrix, i.e. the sum of diagonal elements. ### Example -```fortran -{!example/linalg/example_trace.f90!} +```{literalinclude} ../../example/linalg/example_trace.f90 +:language: Fortran ``` ## `outer_product` - Computes the outer product of two vectors @@ -331,8 +325,8 @@ Returns a rank-2 array equal to `u v^T` (where `u, v` are considered column vect ### Example -```fortran -{!example/linalg/example_outer_product.f90!} +```{literalinclude} ../../example/linalg/example_outer_product.f90 +:language: Fortran ``` ## `kronecker_product` - Computes the Kronecker product of two rank-2 arrays @@ -361,8 +355,8 @@ Returns a rank-2 array equal to `A \otimes B`. The shape of the returned array i ### Example -```fortran -{!example/linalg/example_kronecker_product.f90!} +```{literalinclude} ../../example/linalg/example_kronecker_product.f90 +:language: Fortran ``` @@ -392,8 +386,8 @@ Returns a rank-1 and size-3 array which is perpendicular to both `a` and `b`. ### Example -```fortran -{!example/linalg/example_cross_product.f90!} +```{literalinclude} ../../example/linalg/example_cross_product.f90 +:language: Fortran ``` ## `is_square` - Checks if a matrix is square @@ -420,8 +414,8 @@ Returns a `logical` scalar that is `.true.` if the input matrix is square, and ` ### Example -```fortran -{!example/linalg/example_is_square.f90!} +```{literalinclude} ../../example/linalg/example_is_square.f90 +:language: Fortran ``` ## `is_diagonal` - Checks if a matrix is diagonal @@ -449,8 +443,8 @@ Note that nonsquare matrices may be diagonal, so long as `a_ij = 0` when `i /= j ### Example -```fortran -{!example/linalg/example_is_diagonal.f90!} +```{literalinclude} ../../example/linalg/example_is_diagonal.f90 +:language: Fortran ``` ## `is_symmetric` - Checks if a matrix is symmetric @@ -477,8 +471,8 @@ Returns a `logical` scalar that is `.true.` if the input matrix is symmetric, an ### Example -```fortran -{!example/linalg/example_is_symmetric.f90!} +```{literalinclude} ../../example/linalg/example_is_symmetric.f90 +:language: Fortran ``` ## `is_skew_symmetric` - Checks if a matrix is skew-symmetric @@ -505,8 +499,8 @@ Returns a `logical` scalar that is `.true.` if the input matrix is skew-symmetri ### Example -```fortran -{!example/linalg/example_is_skew_symmetric.f90!} +```{literalinclude} ../../example/linalg/example_is_skew_symmetric.f90 +:language: Fortran ``` ## `is_hermitian` - Checks if a matrix is Hermitian @@ -533,8 +527,8 @@ Returns a `logical` scalar that is `.true.` if the input matrix is Hermitian, an ### Example -```fortran -{!example/linalg/example_is_hermitian.f90!} +```{literalinclude} ../../example/linalg/example_is_hermitian.f90 +:language: Fortran ``` ## `is_triangular` - Checks if a matrix is triangular @@ -565,8 +559,8 @@ Specifically, upper triangular matrices satisfy `a_ij = 0` when `j < i`, and low ### Example -```fortran -{!example/linalg/example_is_triangular.f90!} +```{literalinclude} ../../example/linalg/example_is_triangular.f90 +:language: Fortran ``` ## `is_hessenberg` - Checks if a matrix is hessenberg @@ -597,8 +591,8 @@ Specifically, upper Hessenberg matrices satisfy `a_ij = 0` when `j < i-1`, and l ### Example -```fortran -{!example/linalg/example_is_hessenberg.f90!} +```{literalinclude} ../../example/linalg/example_is_hessenberg.f90 +:language: Fortran ``` ## `solve` - Solves a linear matrix equation or a linear system of equations. @@ -645,10 +639,12 @@ If `err` is not present, exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_solve1.f90!} +```{literalinclude} ../../example/linalg/example_solve1.f90 +:language: Fortran +``` -{!example/linalg/example_solve2.f90!} +```{literalinclude} ../../example/linalg/example_solve2.f90 +:language: Fortran ``` ## `solve_lu` - Solves a linear matrix equation or a linear system of equations (subroutine interface). @@ -700,8 +696,8 @@ If `err` is not present, exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_solve3.f90!} +```{literalinclude} ../../example/linalg/example_solve3.f90 +:language: Fortran ``` ## `lstsq` - Computes the least squares solution to a linear matrix equation. @@ -744,8 +740,8 @@ Exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_lstsq1.f90!} +```{literalinclude} ../../example/linalg/example_lstsq1.f90 +:language: Fortran ``` ## `solve_lstsq` - Compute the least squares solution to a linear matrix equation (subroutine interface). @@ -798,8 +794,8 @@ Exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_lstsq2.f90!} +```{literalinclude} ../../example/linalg/example_lstsq2.f90 +:language: Fortran ``` ## `lstsq_space` - Compute internal working space requirements for the least squares solver. @@ -864,8 +860,8 @@ Exceptions are returned to the `err` argument if provided; an `error stop` is tr ### Example -```fortran -{!example/linalg/example_determinant.f90!} +```{literalinclude} ../../example/linalg/example_determinant.f90 +:language: Fortran ``` ## `.det.` - Determinant operator of a square matrix @@ -898,8 +894,8 @@ Exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_determinant2.f90!} +```{literalinclude} ../../example/linalg/example_determinant2.f90 +:language: Fortran ``` ## `qr` - Compute the QR factorization of a matrix @@ -947,8 +943,8 @@ If the state argument `err` is not present, exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_qr.f90!} +```{literalinclude} ../../example/linalg/example_qr.f90 +:language: Fortran ``` ## `qr_space` - Compute internal working space requirements for the QR factorization. @@ -975,8 +971,8 @@ This subroutine computes the internal working space requirements for the QR fact ### Example -```fortran -{!example/linalg/example_qr_space.f90!} +```{literalinclude} ../../example/linalg/example_qr_space.f90 +:language: Fortran ``` ## `eig` - Eigenvalues and Eigenvectors of a Square Matrix @@ -1020,8 +1016,8 @@ If `err` is not present, exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_eig.f90!} +```{literalinclude} ../../example/linalg/example_eig.f90 +:language: Fortran ``` ## `eigh` - Eigenvalues and Eigenvectors of a Real symmetric or Complex Hermitian Square Matrix @@ -1069,8 +1065,8 @@ If `err` is not present, exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_eigh.f90!} +```{literalinclude} ../../example/linalg/example_eigh.f90 +:language: Fortran ``` ## `eigvals` - Eigenvalues of a Square Matrix @@ -1107,8 +1103,8 @@ If `err` is not present, exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_eigvals.f90!} +```{literalinclude} ../../example/linalg/example_eigvals.f90 +:language: Fortran ``` ## `eigvalsh` - Eigenvalues of a Real Symmetric or Complex Hermitian Square Matrix @@ -1148,8 +1144,8 @@ If `err` is not present, exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_eigvalsh.f90!} +```{literalinclude} ../../example/linalg/example_eigvalsh.f90 +:language: Fortran ``` ## `svd` - Compute the singular value decomposition of a rank-2 array (matrix). @@ -1203,8 +1199,8 @@ Exceptions trigger an `error stop`, unless argument `err` is present. ### Example -```fortran -{!example/linalg/example_svd.f90!} +```{literalinclude} ../../example/linalg/example_svd.f90 +:language: Fortran ``` ## `svdvals` - Compute the singular values of a rank-2 array (matrix). @@ -1240,8 +1236,8 @@ Exceptions trigger an `error stop`, unless argument `err` is present. ### Example -```fortran -{!example/linalg/example_svdvals.f90!} +```{literalinclude} ../../example/linalg/example_svdvals.f90 +:language: Fortran ``` @@ -1293,8 +1289,8 @@ Exceptions trigger an `error stop`, unless argument `err` is present. ### Example -```fortran -{!example/linalg/example_cholesky.f90!} +```{literalinclude} ../../example/linalg/example_cholesky.f90 +:language: Fortran ``` ## `chol` - Compute the Cholesky factorization of a rank-2 square array (matrix) @@ -1334,8 +1330,8 @@ Exceptions trigger an `error stop`, unless argument `err` is present. ### Example -```fortran -{!example/linalg/example_chol.f90!} +```{literalinclude} ../../example/linalg/example_chol.f90 +:language: Fortran ``` @@ -1370,8 +1366,8 @@ interfaces. ### Example -```fortran -{!example/linalg/example_inverse_operator.f90!} +```{literalinclude} ../../example/linalg/example_inverse_operator.f90 +:language: Fortran ``` ## `invert` - Inversion of a square matrix @@ -1415,12 +1411,12 @@ If `err` is not present, exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_inverse_inplace.f90!} +```{literalinclude} ../../example/linalg/example_inverse_inplace.f90 +:language: Fortran ``` -```fortran -{!example/linalg/example_inverse_subroutine.f90!} +```{literalinclude} ../../example/linalg/example_inverse_subroutine.f90 +:language: Fortran ``` ## `inv` - Inverse of a square matrix. @@ -1455,7 +1451,7 @@ If `err` is not present, exceptions trigger an `error stop`. ### Example -```fortran -{!example/linalg/example_inverse_function.f90!} +```{literalinclude} ../../example/linalg/example_inverse_function.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_linalg_state_type.md b/doc/specs/stdlib_linalg_state_type.md index 54070fe4b..b72e67e89 100644 --- a/doc/specs/stdlib_linalg_state_type.md +++ b/doc/specs/stdlib_linalg_state_type.md @@ -1,11 +1,7 @@ ---- -title: linalg_state_type ---- - -# Linear Algebra -- State and Error Handling Module - -[TOC] +# `stdlib_linalg_state` +Linear Algebra : State and Error Handling Module + ## Introduction The `stdlib_linalg_state` module provides a derived type holding information on the @@ -46,8 +42,8 @@ Experimental #### Example -```fortran -{!example/linalg/example_state1.f90!} +```{literalinclude} ../../example/linalg/example_state1.f90 +:language: Fortran ``` ## Error flags provided diff --git a/doc/specs/stdlib_logger.md b/doc/specs/stdlib_logger.md index e681824a8..f044bde7c 100644 --- a/doc/specs/stdlib_logger.md +++ b/doc/specs/stdlib_logger.md @@ -1,10 +1,5 @@ ---- -title: logger ---- -# Loggers - -[TOC] - +# `stdlib_logger` + ## Introduction This module defines a derived type, its methods, a variable, and @@ -47,7 +42,7 @@ is empty then the messages go to the `output_unit` of the intrinsic module `iso_fortran_env`. -## The `stdlib_logger` constants +## `stdlib_logger` constants The module defines nine distinct public integer constants for reporting errors in the `stat` arguments of some of the module's @@ -104,7 +99,7 @@ significant events encountered during the execution of a program. | `time_stamp` | Logical | Flag to precede output by a time stamp | `.true.` | | `units` | Integer | Count of the number of active output units | 0 | -## The `stdlib_logger` variable +## `stdlib_logger` variable The module defines one public variable, `global_logger`, of type `logger_type`. As might be guessed from its name, `global_logger` is @@ -194,8 +189,8 @@ an `intent(in)` argument. It shall be the name of the file to be opened. #### Example -```fortran -{!example/logger/example_global_logger.f90!} +```{literalinclude} ../../example/logger/example_global_logger.f90 +:language: Fortran ``` ### `add_log_unit` - add a unit to the array `self % log_units` @@ -250,8 +245,8 @@ to `unit`. #### Example -```fortran -{!example/logger/example_add_log_unit.f90!} +```{literalinclude} ../../example/logger/example_add_log_unit.f90 +:language: Fortran ``` ### `configuration` - report a logger's configuration @@ -377,8 +372,8 @@ Pure subroutine #### Example -```fortran -{!example/logger/example_configure.f90!} +```{literalinclude} ../../example/logger/example_configure.f90 +:language: Fortran ``` ### `log_debug` - Writes the string `message` to `self % log_units` @@ -667,8 +662,8 @@ Subroutine #### Example -```fortran -{!example/logger/example_log_io_error.f90!} +```{literalinclude} ../../example/logger/example_log_io_error.f90 +:language: Fortran ``` ### `log_message` - write the string `message` to `self % log_units` @@ -816,8 +811,8 @@ Subroutine #### Example -```fortran -{!example/logger/example_log_text_error.f90!} +```{literalinclude} ../../example/logger/example_log_text_error.f90 +:language: Fortran ``` ### `log_units_assigned` - returns the number of active I/O units diff --git a/doc/specs/stdlib_math.md b/doc/specs/stdlib_math.md index cfd632456..f2144d8cb 100644 --- a/doc/specs/stdlib_math.md +++ b/doc/specs/stdlib_math.md @@ -1,11 +1,5 @@ ---- -title: math ---- - -# The `stdlib_math` module - -[TOC] - +# `stdlib_math` + ## Introduction `stdlib_math` module provides general purpose mathematical functions. @@ -50,15 +44,15 @@ The output is a scalar of `type` and `kind` same as to that of the arguments. ##### Example 1: Here inputs are of type `integer` and kind `int32` -```fortran -{!example/math/example_clip_integer.f90!} +```{literalinclude} ../../example/math/example_clip_integer.f90 +:language: Fortran ``` ##### Example 2: Here inputs are of type `real` and kind `sp` -```fortran -{!example/math/example_clip_real.f90!} +```{literalinclude} ../../example/math/example_clip_real.f90 +:language: Fortran ``` @@ -129,8 +123,8 @@ Returns an integer of the same `kind` as that of the arguments. ##### Example 1: -```fortran -{!example/math/example_gcd.f90!} +```{literalinclude} ../../example/math/example_gcd.f90 +:language: Fortran ``` ### `linspace` - Create a linearly spaced rank one array @@ -172,15 +166,15 @@ If `start`/`end` are `integer` types, the `result` will default to a `real(dp)` ##### Example 1: Here inputs are of type `complex` and kind `dp` -```fortran -{!example/math/example_linspace_complex.f90!} +```{literalinclude} ../../example/math/example_linspace_complex.f90 +:language: Fortran ``` ##### Example 2: Here inputs are of type `integer` and kind `int16`, with the result defaulting to `real(dp)`. -```fortran -{!example/math/example_linspace_int16.f90!} +```{literalinclude} ../../example/math/example_linspace_int16.f90 +:language: Fortran ``` ### `logspace` - Create a logarithmically spaced rank one array @@ -241,22 +235,22 @@ For function calls where the `base` is specified, the `type` and `kind` of the r ##### Example 1: Here inputs are of type `complex` and kind `dp`. `n` and `base` is not specified and thus default to 50 and 10, respectively. -```fortran -{!example/math/example_logspace_complex.f90!} +```{literalinclude} ../../example/math/example_logspace_complex.f90 +:language: Fortran ``` ##### Example 2: Here inputs are of type `integer` and default kind. `base` is not specified and thus defaults to 10. -```fortran -{!example/math/example_logspace_int.f90!} +```{literalinclude} ../../example/math/example_logspace_int.f90 +:language: Fortran ``` ##### Example 3: Here `start`/`end` are of type `real` and double precision. `base` is type `complex` and also double precision. -```fortran -{!example/math/example_logspace_rstart_cbase.f90!} +```{literalinclude} ../../example/math/example_logspace_rstart_cbase.f90 +:language: Fortran ``` ### `arange` function @@ -305,8 +299,8 @@ For `real` type arguments, the length of the result vector is `floor((end - star #### Example -```fortran -{!example/math/example_math_arange.f90!} +```{literalinclude} ../../example/math/example_math_arange.f90 +:language: Fortran ``` ### `arg` function @@ -341,8 +335,8 @@ Notes: Although the angle of the complex number `0` is undefined, `arg((0,0))` r #### Example -```fortran -{!example/math/example_math_arg.f90!} +```{literalinclude} ../../example/math/example_math_arg.f90 +:language: Fortran ``` ### `argd` function @@ -377,8 +371,8 @@ Notes: Although the angle of the complex number `0` is undefined, `argd((0,0))` #### Example -```fortran -{!example/math/example_math_argd.f90!} +```{literalinclude} ../../example/math/example_math_argd.f90 +:language: Fortran ``` ### `argpi` function @@ -413,8 +407,8 @@ Notes: Although the angle of the complex number `0` is undefined, `argpi((0,0))` #### Example -```fortran -{!example/math/example_math_argpi.f90!} +```{literalinclude} ../../example/math/example_math_argpi.f90 +:language: Fortran ``` ### `deg2rad` @@ -445,8 +439,8 @@ Returns the `real` phase angle in radians. #### Example -```fortran -{!example/math/example_math_deg2rad.f90!} +```{literalinclude} ../../example/math/example_math_deg2rad.f90 +:language: Fortran ``` ### `rad2deg` @@ -477,8 +471,8 @@ Returns the `real` phase angle in degrees. #### Example -```fortran -{!example/math/example_math_rad2deg.f90!} +```{literalinclude} ../../example/math/example_math_rad2deg.f90 +:language: Fortran ``` ### `is_close` function @@ -537,8 +531,8 @@ Returns a `logical` scalar/array. #### Example -```fortran -{!example/math/example_math_is_close.f90!} +```{literalinclude} ../../example/math/example_math_is_close.f90 +:language: Fortran ``` ### `all_close` function @@ -588,8 +582,8 @@ Returns a `logical` scalar. #### Example -```fortran -{!example/math/example_math_all_close.f90!} +```{literalinclude} ../../example/math/example_math_all_close.f90 +:language: Fortran ``` ### `diff` function @@ -650,8 +644,8 @@ When both `prepend` and `append` are not present, the result `y` has one fewer e #### Example -```fortran -{!example/math/example_diff.f90!} +```{literalinclude} ../../example/math/example_diff.f90 +:language: Fortran ``` ### `meshgrid` subroutine @@ -706,6 +700,6 @@ This argument is `intent(in)` and `optional`, and is equal to `stdlib_meshgrid_x #### Example -```fortran -{!example/math/example_meshgrid.f90!} +```{literalinclude} ../../example/math/example_meshgrid.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_optval.md b/doc/specs/stdlib_optval.md index 2cf7b6ef6..7fb317c85 100644 --- a/doc/specs/stdlib_optval.md +++ b/doc/specs/stdlib_optval.md @@ -1,11 +1,7 @@ ---- -title: optval ---- - -# Default values for optional arguments - -[TOC] +# `stdlib_optval` +Default values for optional arguments + ## `optval` - fallback value for optional arguments ### Status @@ -34,6 +30,6 @@ If `x` is present, the result is `x`, otherwise the result is `default`. ### Example -```fortran -{!example/optval/example_optval.f90!} +```{literalinclude} ../../example/optval/example_optval.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_quadrature.md b/doc/specs/stdlib_quadrature.md index a1b835fa9..f8cc0c2e1 100644 --- a/doc/specs/stdlib_quadrature.md +++ b/doc/specs/stdlib_quadrature.md @@ -1,11 +1,7 @@ ---- -title: quadrature ---- - -# Numerical integration - -[TOC] +# `stdlib_quadrature` +Numerical integration + ## `trapz` - integrate sampled values using trapezoidal rule ### Status @@ -38,8 +34,8 @@ If the size of `y` is zero or one, the result is zero. ### Example -```fortran -{!example/quadrature/example_trapz.f90!} +```{literalinclude} ../../example/quadrature/example_trapz.f90 +:language: Fortran ``` ## `trapz_weights` - trapezoidal rule weights for given abscissas @@ -68,8 +64,8 @@ If the size of `x` is one, then the sole element of the result is zero. ### Example -```fortran -{!example/quadrature/example_trapz_weights.f90!} +```{literalinclude} ../../example/quadrature/example_trapz_weights.f90 +:language: Fortran ``` ## `simps` - integrate sampled values using Simpson's rule @@ -110,8 +106,8 @@ If the size of `y` is two, the result is the same as if `trapz` had been called ### Example -```fortran -{!example/quadrature/example_simps.f90!} +```{literalinclude} ../../example/quadrature/example_simps.f90 +:language: Fortran ``` ## `simps_weights` - Simpson's rule weights for given abscissas @@ -146,8 +142,8 @@ If the size of `x` is two, then the result is the same as if `trapz_weights` had ### Example -```fortran -{!example/quadrature/example_simps_weights.f90!} +```{literalinclude} ../../example/quadrature/example_simps_weights.f90 +:language: Fortran ``` ## `gauss_legendre` - Gauss-Legendre quadrature (a.k.a. Gaussian quadrature) nodes and weights @@ -184,8 +180,8 @@ If not specified, the default integral is -1 to 1. ### Example -```fortran -{!example/quadrature/example_gauss_legendre.f90!} +```{literalinclude} ../../example/quadrature/example_gauss_legendre.f90 +:language: Fortran ``` ## `gauss_legendre_lobatto` - Gauss-Legendre-Lobatto quadrature nodes and weights @@ -222,6 +218,6 @@ If not specified, the default integral is -1 to 1. ### Example -```fortran -{!example/quadrature/example_gauss_legendre_lobatto.f90!} +```{literalinclude} ../../example/quadrature/example_gauss_legendre_lobatto.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_random.md b/doc/specs/stdlib_random.md index b35c0cd45..80cfe66c0 100644 --- a/doc/specs/stdlib_random.md +++ b/doc/specs/stdlib_random.md @@ -1,11 +1,7 @@ ---- -title: random ---- - -# Statistical Distributions -- Pseudorandom Number Generator Module - -[TOC] +# `stdlib_random` +Statistical Distributions: Pseudorandom Number Generator Module + ## `random_seed` - set or get a value of seed to the probability distribution pseudorandom number generator ### Status @@ -32,8 +28,8 @@ Return a scalar of type `integer`. ### Example -```fortran -{!example/random/example_random_seed.f90!} +```{literalinclude} ../../example/random/example_random_seed.f90 +:language: Fortran ``` ## `dist_rand` - Get a random integer with specified kind @@ -60,6 +56,6 @@ Return a scalar of type `integer`. ### Example -```fortran -{!example/random/example_dist_rand.f90!} +```{literalinclude} ../../example/random/example_dist_rand.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_selection.md b/doc/specs/stdlib_selection.md index 1c018b75e..166fc151c 100644 --- a/doc/specs/stdlib_selection.md +++ b/doc/specs/stdlib_selection.md @@ -1,11 +1,5 @@ ---- -title: selection ---- - -# The `stdlib_selection` module - -[TOC] - +# `stdlib_selection` + ## Overview of selection Suppose you wish to find the value of the k-th smallest entry in an array of size N, or @@ -106,8 +100,8 @@ code here to be released under stdlib's MIT license. ### Example -```fortran -{!example/selection/example_select.f90!} +```{literalinclude} ../../example/selection/example_select.f90 +:language: Fortran ``` ## `arg_select` - find the index of the k-th smallest value in an input array @@ -189,8 +183,8 @@ code here to be released under stdlib's MIT license. ### Example -```fortran -{!example/selection/example_arg_select.f90!} +```{literalinclude} ../../example/selection/example_arg_select.f90 +:language: Fortran ``` ## Comparison with using `sort` @@ -200,8 +194,8 @@ computing the median of an array, vs using `sort` from `stdlib`. In theory we should see a speed improvement with the selection routines which grows like LOG(size(`array`)). -```fortran -{!example/selection/selection_vs_sort.f90!} +```{literalinclude} ../../example/selection/selection_vs_sort.f90 +:language: Fortran ``` The results seem consistent with expectations when the `array` is large; the program prints: diff --git a/doc/specs/stdlib_sorting.md b/doc/specs/stdlib_sorting.md index 3a44d84f8..0293c8867 100644 --- a/doc/specs/stdlib_sorting.md +++ b/doc/specs/stdlib_sorting.md @@ -1,11 +1,5 @@ ---- -title: sorting ---- - -# The `stdlib_sorting` module - -[TOC] - +# `stdlib_sorting` + ## Overview of sorting The sorting of collections of data is useful in the analysis of those @@ -277,8 +271,8 @@ function `LGT`. ##### Example -```fortran -{!example/sorting/example_ord_sort.f90!} +```{literalinclude} ../../example/sorting/example_ord_sort.f90 +:language: Fortran ``` #### `sort` - sorts an input array @@ -332,8 +326,8 @@ element of `array` is a `NaN`. Sorting of `CHARACTER(*)` and ##### Example -```fortran -{!example/sorting/example_sort.f90!} +```{literalinclude} ../../example/sorting/example_sort.f90 +:language: Fortran ``` #### `radix_sort` - sorts an input array @@ -381,8 +375,8 @@ element of `array` is a `NaN`. ##### Example -```fortran -{!example/sorting/example_radix_sort.f90!} +```{literalinclude} ../../example/sorting/example_radix_sort.f90 +:language: Fortran ``` #### `sort_index` - creates an array of sorting indices for an input array, while also sorting the array. @@ -460,8 +454,8 @@ different on return Sorting a rank one array with `sort_index`: -```Fortran -{!example/sorting/example_sort_index.f90!} +```{literalinclude} ../../example/sorting/example_sort_index.f90 +:language: Fortran ``` Sorting a related rank one array: diff --git a/doc/specs/stdlib_specialfunctions.md b/doc/specs/stdlib_specialfunctions.md index d3153d91a..9c14eb703 100644 --- a/doc/specs/stdlib_specialfunctions.md +++ b/doc/specs/stdlib_specialfunctions.md @@ -1,11 +1,5 @@ ---- -title: specialfunctions ---- - -# Special functions - -[TOC] - +# `stdlib_specialfunctions` + ## `legendre` - Calculate Legendre polynomials ### Status diff --git a/doc/specs/stdlib_specialfunctions_gamma.md b/doc/specs/stdlib_specialfunctions_gamma.md index aa4da3c01..de37da117 100644 --- a/doc/specs/stdlib_specialfunctions_gamma.md +++ b/doc/specs/stdlib_specialfunctions_gamma.md @@ -1,11 +1,7 @@ ---- -title: specialfunctions_gamma ---- - -# Special functions gamma - -[TOC] +# `stdlib_specialfunctions_gamma` +Special functions gamma + ## `gamma` - Calculate the gamma function ### Status @@ -37,8 +33,8 @@ Elemental function The function returns a value with the same type and kind as input argument. ### Example -```fortran -{!example/specialfunctions_gamma/example_gamma.f90!} +```{literalinclude} ../../example/specialfunctions_gamma/example_gamma.f90 +:language: Fortran ``` ## `log_gamma` - Calculate the natural logarithm of the gamma function @@ -71,8 +67,8 @@ The function returns real single precision values for integer input arguments, w ### Example -```fortran -{!example/specialfunctions_gamma/example_log_gamma.f90!} +```{literalinclude} ../../example/specialfunctions_gamma/example_log_gamma.f90 +:language: Fortran ``` ## `log_factorial` - calculate the logarithm of a factorial @@ -102,8 +98,8 @@ Elemental function The function returns real type values with single precision. ### Example -```fortran -{!example/specialfunctions_gamma/example_log_factorial.f90!} +```{literalinclude} ../../example/specialfunctions_gamma/example_log_factorial.f90 +:language: Fortran ``` ## `lower_incomplete_gamma` - calculate lower incomplete gamma integral @@ -139,8 +135,8 @@ Elemental function The function returns a real type value with the same kind as argument x. ### Example -```fortran -{!example/specialfunctions_gamma/example_ligamma.f90!} +```{literalinclude} ../../example/specialfunctions_gamma/example_ligamma.f90 +:language: Fortran ``` ## `upper_incomplete_gamma` - calculate the upper incomplete gamma integral @@ -176,8 +172,8 @@ Elemental function The function returns a real type value with the same kind as argument x. ### Example -```fortran -{!example/specialfunctions_gamma/example_uigamma.f90!} +```{literalinclude} ../../example/specialfunctions_gamma/example_uigamma.f90 +:language: Fortran ``` ## `log_lower_incomplete_gamma` - calculate the natural logarithm of the lower incomplete gamma integral @@ -271,8 +267,8 @@ Elemental function The function returns a real type value with the same kind as argument x. ### Example -```fortran -{!example/specialfunctions_gamma/example_gamma_p.f90!} +```{literalinclude} ../../example/specialfunctions_gamma/example_gamma_p.f90 +:language: Fortran ``` ## `regularized_gamma_q` - calculate the gamma quotient Q @@ -308,6 +304,6 @@ Elemental function The function returns a real type value with the same kind as argument x. ### Example -```fortran -{!example/specialfunctions_gamma/example_gamma_q.f90!} +```{literalinclude} ../../example/specialfunctions_gamma/example_gamma_q.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_stats.md b/doc/specs/stdlib_stats.md index dbad5567e..f26b67e4e 100644 --- a/doc/specs/stdlib_stats.md +++ b/doc/specs/stdlib_stats.md @@ -1,11 +1,7 @@ ---- -title: stats ---- - -# Descriptive statistics - -[TOC] +# `stdlib_stats` +Descriptive statistics + ## `corr` - Pearson correlation of array elements ### Status @@ -51,8 +47,8 @@ If `mask` is specified, the result is the Pearson correlation of all elements of ### Example -```fortran -{!example/stats/example_corr.f90!} +```{literalinclude} ../../example/stats/example_corr.f90 +:language: Fortran ``` ## `cov` - covariance of array elements @@ -107,8 +103,8 @@ If `mask` is specified, the result is the covariance of all elements of `array` ### Example -```fortran -{!example/stats/example_cov.f90!} +```{literalinclude} ../../example/stats/example_cov.f90 +:language: Fortran ``` ## `mean` - mean of array elements @@ -150,8 +146,8 @@ If `mask` is specified, the result is the mean of all elements of `array` corres ### Example -```fortran -{!example/stats/example_mean.f90!} +```{literalinclude} ../../example/stats/example_mean.f90 +:language: Fortran ``` ## `median` - median of array elements @@ -215,8 +211,8 @@ If `mask` is specified, the result is the median of all elements of `array` corr ### Example -```fortran -{!example/stats/example_median.f90!} +```{literalinclude} ../../example/stats/example_median.f90 +:language: Fortran ``` ## `moment` - central moments of array elements @@ -279,8 +275,8 @@ If `mask` is specified, the result is the _k_-th (central) moment of all elemen ### Example -```fortran -{!example/stats/example_moment.f90!} +```{literalinclude} ../../example/stats/example_moment.f90 +:language: Fortran ``` ## `var` - variance of array elements @@ -337,6 +333,6 @@ If the variance is computed with only one single element, then the result is IEE ### Example -```fortran -{!example/stats/example_var.f90!} +```{literalinclude} ../../example/stats/example_var.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_stats_distribution_exponential.md b/doc/specs/stdlib_stats_distribution_exponential.md index b11ca6a6c..e536862cb 100644 --- a/doc/specs/stdlib_stats_distribution_exponential.md +++ b/doc/specs/stdlib_stats_distribution_exponential.md @@ -1,11 +1,7 @@ ---- -title: stats_distribution_exponential ---- - -# Statistical Distributions -- Exponential Distribution Module - -[TOC] +# `stdlib_stats_distribution_exponential` +Statistical Distributions : Exponential Distribution Module + ## `rvs_exp` - exponential distribution random variates ### Status @@ -49,8 +45,8 @@ If `lambda` is non-positive, the result is `NaN`. ### Example -```fortran -{!example/stats_distribution_exponential/example_exponential_rvs.f90!} +```{literalinclude} ../../example/stats_distribution_exponential/example_exponential_rvs.f90 +:language: Fortran ``` ## `pdf_exp` - exponential distribution probability density function @@ -92,8 +88,8 @@ The result is a scalar or an array, with a shape conformable to the arguments, a ### Example -```fortran -{!example/stats_distribution_exponential/example_exponential_pdf.f90!} +```{literalinclude} ../../example/stats_distribution_exponential/example_exponential_pdf.f90 +:language: Fortran ``` ## `cdf_exp` - exponential cumulative distribution function @@ -135,8 +131,8 @@ The result is a scalar or an array, with a shape conformable to the arguments, a ### Example -```fortran -{!example/stats_distribution_exponential/example_exponential_cdf.f90!} +```{literalinclude} ../../example/stats_distribution_exponential/example_exponential_cdf.f90 +:language: Fortran ``` [^1]: Marsaglia, George, and Wai Wan Tsang. "The ziggurat method for generating random variables." _Journal of statistical software_ 5 (2000): 1-7. diff --git a/doc/specs/stdlib_stats_distribution_normal.md b/doc/specs/stdlib_stats_distribution_normal.md index db32a3b60..5eac884aa 100644 --- a/doc/specs/stdlib_stats_distribution_normal.md +++ b/doc/specs/stdlib_stats_distribution_normal.md @@ -1,11 +1,7 @@ ---- -title: stats_distribution_normal ---- - -# Statistical Distributions -- Normal Distribution Module - -[TOC] +# `stdlib_stats_distribution_normal` +Statistical Distributions : Normal Distribution Module + ## `rvs_normal` - normal distribution random variates ### Status @@ -50,8 +46,8 @@ The result is a scalar or rank-1 array, with a size of `array_size`, and the sam ### Example -```fortran -{!example/stats_distribution_normal/example_normal_rvs.f90!} +```{literalinclude} ../../example/stats_distribution_normal/example_normal_rvs.f90 +:language: Fortran ``` ## `pdf_normal` - normal distribution probability density function @@ -94,8 +90,8 @@ The result is a scalar or an array, with a shape conformable to the arguments, a ### Example -```fortran -{!example/stats_distribution_normal/example_normal_pdf.f90!} +```{literalinclude} ../../example/stats_distribution_normal/example_normal_pdf.f90 +:language: Fortran ``` ## `cdf_normal` - normal distribution cumulative distribution function @@ -140,8 +136,8 @@ The result is a scalar or an array, with a shape conformable to the arguments, a ### Example -```fortran -{!example/stats_distribution_normal/example_normal_cdf.f90!} +```{literalinclude} ../../example/stats_distribution_normal/example_normal_cdf.f90 +:language: Fortran ``` [^1]: Marsaglia, George, and Wai Wan Tsang. "The ziggurat method for generating random variables." _Journal of statistical software_ 5 (2000): 1-7. diff --git a/doc/specs/stdlib_stats_distribution_uniform.md b/doc/specs/stdlib_stats_distribution_uniform.md index 33fdd6756..2b011ab55 100644 --- a/doc/specs/stdlib_stats_distribution_uniform.md +++ b/doc/specs/stdlib_stats_distribution_uniform.md @@ -1,11 +1,7 @@ ---- -title: stats_distribution_uniform ---- - -# Statistical Distributions -- Uniform Distribution Module - -[TOC] +# `stdlib_stats_distribution_uniform` +Statistical Distributions : Uniform Distribution Module + ## `shuffle` - Using Fisher-Yates algorithm to generate a random permutation of a list ### Status @@ -34,8 +30,8 @@ Return a randomized rank one array of the input type. ### Example -```fortran -{!example/stats_distribution_uniform/example_shuffle.f90!} +```{literalinclude} ../../example/stats_distribution_uniform/example_shuffle.f90 +:language: Fortran ``` ## `rvs_uniform` - uniform distribution random variates @@ -84,8 +80,8 @@ The result is a scalar or a rank one array with size of `array_size`, of type `i ### Example -```fortran -{!example/stats_distribution_uniform/example_uniform_rvs.f90!} +```{literalinclude} ../../example/stats_distribution_uniform/example_uniform_rvs.f90 +:language: Fortran ``` ## `pdf_uniform` - Uniform distribution probability density function @@ -132,8 +128,8 @@ The result is a scalar or an array, with a shape conformable to arguments, of ty ### Example -```fortran -{!example/stats_distribution_uniform/example_uniform_pdf.f90!} +```{literalinclude} ../../example/stats_distribution_uniform/example_uniform_pdf.f90 +:language: Fortran ``` ## `cdf_uniform` - Uniform distribution cumulative distribution function @@ -182,6 +178,6 @@ The result is a scalar or an array, with a shape conformable to arguments, of ty ### Example -```fortran -{!example/stats_distribution_uniform/example_uniform_cdf.f90!} +```{literalinclude} ../../example/stats_distribution_uniform/example_uniform_cdf.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_str2num.md b/doc/specs/stdlib_str2num.md index ef0485cb1..ac48e62d4 100644 --- a/doc/specs/stdlib_str2num.md +++ b/doc/specs/stdlib_str2num.md @@ -1,13 +1,7 @@ ---- -title: str2num ---- - -# The `stdlib_str2num` module +# `stdlib_str2num` This module proposes a function-style interface for string-to-number conversion. It also profits from Fortran's interfaces to implement precision-dependant algorithms to maximize runtime efficiency. - -[TOC] - + ## `to_num` - conversion of strings to numbers ### Status @@ -34,8 +28,8 @@ Return a scalar of numerical type (i.e., `integer`, or `real`). ### Example -```fortran -{!example/strings/example_string_to_number.f90!} +```{literalinclude} ../../example/strings/example_string_to_number.f90 +:language: Fortran ``` ## `to_num_from_stream` - conversion of a stream of values in a string to numbers @@ -64,8 +58,8 @@ Return a scalar of numerical type (i.e., `integer` or `real`). ### Example -```fortran -{!example/strings/example_stream_of_strings_to_numbers.f90!} +```{literalinclude} ../../example/strings/example_stream_of_strings_to_numbers.f90 +:language: Fortran ``` ## Note diff --git a/doc/specs/stdlib_string_type.md b/doc/specs/stdlib_string_type.md index e50d05f97..433a3f72f 100644 --- a/doc/specs/stdlib_string_type.md +++ b/doc/specs/stdlib_string_type.md @@ -1,11 +1,5 @@ ---- -title: string_type ---- - -# The `stdlib_string_type` module - -[TOC] - +# `stdlib_string_type` + ## Introduction The `stdlib_string_type` provides a derived type holding an arbitrary sequence @@ -66,8 +60,8 @@ The result is an instance of `string_type` with zero length. #### Example -```fortran -{!example/string_type/example_constructor_empty.f90!} +```{literalinclude} ../../example/string_type/example_constructor_empty.f90 +:language: Fortran ``` @@ -104,8 +98,8 @@ The result is an instance of `string_type`. #### Example -```fortran -{!example/string_type/example_constructor_scalar.f90!} +```{literalinclude} ../../example/string_type/example_constructor_scalar.f90 +:language: Fortran ``` @@ -138,8 +132,8 @@ The result is an instance of `string_type`. #### Example -```fortran -{!example/string_type/example_constructor_integer.f90!} +```{literalinclude} ../../example/string_type/example_constructor_integer.f90 +:language: Fortran ``` @@ -172,8 +166,8 @@ The result is an instance of `string_type`. #### Example -```fortran -{!example/string_type/example_constructor_logical.f90!} +```{literalinclude} ../../example/string_type/example_constructor_logical.f90 +:language: Fortran ``` @@ -201,8 +195,8 @@ Elemental subroutine, `assignment(=)`. #### Example -```fortran -{!example/string_type/example_constructor_character.f90!} +```{literalinclude} ../../example/string_type/example_constructor_character.f90 +:language: Fortran ``` @@ -235,8 +229,8 @@ The result is a default integer scalar value. #### Example -```fortran -{!example/string_type/example_len.f90!} +```{literalinclude} ../../example/string_type/example_len.f90 +:language: Fortran ``` @@ -270,8 +264,8 @@ The result is a default integer scalar value. #### Example -```fortran -{!example/string_type/example_len_trim.f90!} +```{literalinclude} ../../example/string_type/example_len_trim.f90 +:language: Fortran ``` @@ -305,8 +299,8 @@ The result is a scalar `string_type` value. #### Example -```fortran -{!example/string_type/example_trim.f90!} +```{literalinclude} ../../example/string_type/example_trim.f90 +:language: Fortran ``` @@ -340,8 +334,8 @@ The result is a scalar `string_type` value. #### Example -```fortran -{!example/string_type/example_adjustl.f90!} +```{literalinclude} ../../example/string_type/example_adjustl.f90 +:language: Fortran ``` @@ -375,8 +369,8 @@ The result is a scalar `string_type` value. #### Example -```fortran -{!example/string_type/example_adjustr.f90!} +```{literalinclude} ../../example/string_type/example_adjustr.f90 +:language: Fortran ``` @@ -411,8 +405,8 @@ The result is a scalar `string_type` value. #### Example -```fortran -{!example/string_type/example_repeat.f90!} +```{literalinclude} ../../example/string_type/example_repeat.f90 +:language: Fortran ``` @@ -445,8 +439,8 @@ The result is a scalar character value. #### Example -```fortran -{!example/string_type/example_char.f90!} +```{literalinclude} ../../example/string_type/example_char.f90 +:language: Fortran ``` @@ -480,8 +474,8 @@ The result is a scalar character value. #### Example -```fortran -{!example/string_type/example_char_position.f90!} +```{literalinclude} ../../example/string_type/example_char_position.f90 +:language: Fortran ``` @@ -516,8 +510,8 @@ The result is a scalar character value. #### Example -```fortran -{!example/string_type/example_char_range.f90!} +```{literalinclude} ../../example/string_type/example_char_range.f90 +:language: Fortran ``` @@ -553,8 +547,8 @@ The result is a default integer scalar value. #### Example -```fortran -{!example/string_type/example_ichar.f90!} +```{literalinclude} ../../example/string_type/example_ichar.f90 +:language: Fortran ``` @@ -590,8 +584,8 @@ The result is a default integer scalar value. #### Example -```fortran -{!example/string_type/example_iachar.f90!} +```{literalinclude} ../../example/string_type/example_iachar.f90 +:language: Fortran ``` @@ -630,8 +624,8 @@ The result is a default integer scalar value. #### Example -```fortran -{!example/string_type/example_index.f90!} +```{literalinclude} ../../example/string_type/example_index.f90 +:language: Fortran ``` @@ -670,8 +664,8 @@ The result is a default integer scalar value. #### Example -```fortran -{!example/string_type/example_scan.f90!} +```{literalinclude} ../../example/string_type/example_scan.f90 +:language: Fortran ``` @@ -710,8 +704,8 @@ The result is a default integer scalar value. #### Example -```fortran -{!example/string_type/example_verify.f90!} +```{literalinclude} ../../example/string_type/example_verify.f90 +:language: Fortran ``` @@ -749,8 +743,8 @@ The result is a default logical scalar value. #### Example -```fortran -{!example/string_type/example_lgt.f90!} +```{literalinclude} ../../example/string_type/example_lgt.f90 +:language: Fortran ``` @@ -788,8 +782,8 @@ The result is a default logical scalar value. #### Example -```fortran -{!example/string_type/example_llt.f90!} +```{literalinclude} ../../example/string_type/example_llt.f90 +:language: Fortran ``` @@ -828,8 +822,8 @@ The result is a default logical scalar value. #### Example -```fortran -{!example/string_type/example_lge.f90!} +```{literalinclude} ../../example/string_type/example_lge.f90 +:language: Fortran ``` @@ -868,8 +862,8 @@ The result is a default logical scalar value. #### Example -```fortran -{!example/string_type/example_lle.f90!} +```{literalinclude} ../../example/string_type/example_lle.f90 +:language: Fortran ``` @@ -903,8 +897,8 @@ The result is a scalar `string_type` value. #### Example -```fortran -{!example/string_type/example_to_lower.f90!} +```{literalinclude} ../../example/string_type/example_to_lower.f90 +:language: Fortran ``` @@ -938,8 +932,8 @@ The result is a scalar `string_type` value. #### Example -```fortran -{!example/string_type/example_to_upper.f90!} +```{literalinclude} ../../example/string_type/example_to_upper.f90 +:language: Fortran ``` @@ -978,8 +972,8 @@ The result is a scalar `string_type` value. #### Example -```fortran -{!example/string_type/example_to_title.f90!} +```{literalinclude} ../../example/string_type/example_to_title.f90 +:language: Fortran ``` @@ -1015,8 +1009,8 @@ The result is a scalar `string_type` value. #### Example -```fortran -{!example/string_type/example_to_sentence.f90!} +```{literalinclude} ../../example/string_type/example_to_sentence.f90 +:language: Fortran ``` @@ -1049,8 +1043,8 @@ The result is a scalar `string_type` value. #### Example -```fortran -{!example/string_type/example_reverse.f90!} +```{literalinclude} ../../example/string_type/example_reverse.f90 +:language: Fortran ``` @@ -1091,8 +1085,8 @@ The result is a default logical scalar value. #### Example -```fortran -{!example/string_type/example_gt.f90!} +```{literalinclude} ../../example/string_type/example_gt.f90 +:language: Fortran ``` @@ -1133,8 +1127,8 @@ The result is a default logical scalar value. #### Example -```fortran -{!example/string_type/example_lt.f90!} +```{literalinclude} ../../example/string_type/example_lt.f90 +:language: Fortran ``` @@ -1175,8 +1169,8 @@ The result is a default logical scalar value. #### Example -```fortran -{!example/string_type/example_ge.f90!} +```{literalinclude} ../../example/string_type/example_ge.f90 +:language: Fortran ``` @@ -1217,8 +1211,8 @@ The result is a default logical scalar value. #### Example -```fortran -{!example/string_type/example_le.f90!} +```{literalinclude} ../../example/string_type/example_le.f90 +:language: Fortran ``` @@ -1259,8 +1253,8 @@ The result is a default logical scalar value. #### Example -```fortran -{!example/string_type/example_eq.f90!} +```{literalinclude} ../../example/string_type/example_eq.f90 +:language: Fortran ``` @@ -1301,8 +1295,8 @@ The result is a default logical scalar value. #### Example -```fortran -{!example/string_type/example_ne.f90!} +```{literalinclude} ../../example/string_type/example_ne.f90 +:language: Fortran ``` @@ -1340,8 +1334,8 @@ The result is an instance of `string_type`. #### Example -```fortran -{!example/string_type/example_cont.f90!} +```{literalinclude} ../../example/string_type/example_cont.f90 +:language: Fortran ``` @@ -1377,8 +1371,8 @@ Unformatted user defined derived type output. #### Example -```fortran -{!example/string_type/example_uwrite.f90!} +```{literalinclude} ../../example/string_type/example_uwrite.f90 +:language: Fortran ``` @@ -1420,8 +1414,8 @@ Formatted user defined derived type output. #### Example -```fortran -{!example/string_type/example_fwrite.f90!} +```{literalinclude} ../../example/string_type/example_fwrite.f90 +:language: Fortran ``` @@ -1459,8 +1453,8 @@ Unformatted derived type input. #### Example -```fortran -{!example/string_type/example_uread.f90!} +```{literalinclude} ../../example/string_type/example_uread.f90 +:language: Fortran ``` @@ -1506,8 +1500,8 @@ Formatted derived type input. #### Example -```fortran -{!example/string_type/example_fread.f90!} +```{literalinclude} ../../example/string_type/example_fread.f90 +:language: Fortran ``` @@ -1543,6 +1537,6 @@ Pure subroutine (Elemental subroutine, only when both `from` and `to` are `type( #### Example -```fortran -{!example/string_type/example_move.f90!} +```{literalinclude} ../../example/string_type/example_move.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_stringlist_type.md b/doc/specs/stdlib_stringlist_type.md index 057a93a60..1b606728b 100644 --- a/doc/specs/stdlib_stringlist_type.md +++ b/doc/specs/stdlib_stringlist_type.md @@ -1,11 +1,7 @@ ---- -title: stringlist_type ---- - -# `stdlib_stringlist_type` module (1-D list of strings) - -[TOC] +# `stdlib_stringlist_type` +1-D list of strings + ## Introduction The `stdlib_stringlist_type` module provides with 2 derived types to deal with lists of strings. @@ -71,8 +67,8 @@ The result is of type `stringlist_index_type`. #### Example -```fortran -{!example/stringlist_type/example_stringlist_type_fidx_bidx.f90!} +```{literalinclude} ../../example/stringlist_type/example_stringlist_type_fidx_bidx.f90 +:language: Fortran ``` @@ -107,8 +103,8 @@ The result is an instance of type `stringlist_type`. #### Example -```fortran -{!example/stringlist_type/example_stringlist_type_constructor.f90!} +```{literalinclude} ../../example/stringlist_type/example_stringlist_type_constructor.f90 +:language: Fortran ``` @@ -141,8 +137,8 @@ Pure subroutine. #### Example -```fortran -{!example/stringlist_type/example_stringlist_type_insert_at.f90!} +```{literalinclude} ../../example/stringlist_type/example_stringlist_type_insert_at.f90 +:language: Fortran ``` @@ -176,8 +172,8 @@ The result is a string of type `string_type`. #### Example -```fortran -{!example/stringlist_type/example_stringlist_type_get.f90!} +```{literalinclude} ../../example/stringlist_type/example_stringlist_type_get.f90 +:language: Fortran ``` @@ -210,8 +206,8 @@ The result is of type `integer`. #### Example -```fortran -{!example/stringlist_type/example_stringlist_type_len.f90!} +```{literalinclude} ../../example/stringlist_type/example_stringlist_type_len.f90 +:language: Fortran ``` @@ -240,8 +236,8 @@ No arguments. #### Example -```fortran -{!example/stringlist_type/example_stringlist_type_clear.f90!} +```{literalinclude} ../../example/stringlist_type/example_stringlist_type_clear.f90 +:language: Fortran ``` @@ -282,8 +278,8 @@ The result is a default `logical` scalar value. #### Example -```fortran -{!example/stringlist_type/example_stringlist_type_equality_operator.f90!} +```{literalinclude} ../../example/stringlist_type/example_stringlist_type_equality_operator.f90 +:language: Fortran ``` @@ -324,8 +320,8 @@ The result is a default `logical` scalar value. #### Example -```fortran -{!example/stringlist_type/example_stringlist_type_inequality_operator.f90!} +```{literalinclude} ../../example/stringlist_type/example_stringlist_type_inequality_operator.f90 +:language: Fortran ``` @@ -364,6 +360,6 @@ The result is an instance of [[stdlib_stringlist_type(module):stringlist_type(ty #### Example -```fortran -{!example/stringlist_type/example_stringlist_type_concatenate_operator.f90!} +```{literalinclude} ../../example/stringlist_type/example_stringlist_type_concatenate_operator.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_strings.md b/doc/specs/stdlib_strings.md index 099aa5521..ff339b649 100644 --- a/doc/specs/stdlib_strings.md +++ b/doc/specs/stdlib_strings.md @@ -1,11 +1,5 @@ ---- -title: strings ---- - -# The `stdlib_strings` module - -[TOC] - +# `stdlib_strings` + ## Introduction The `stdlib_strings` module provides basic string handling and manipulation routines. @@ -44,8 +38,8 @@ The result is of the same type as `string`. #### Example -```fortran -{!example/strings/example_strip.f90!} +```{literalinclude} ../../example/strings/example_strip.f90 +:language: Fortran ``` @@ -83,8 +77,8 @@ The result is of the same type as `string`. #### Example -```fortran -{!example/strings/example_chomp.f90!} +```{literalinclude} ../../example/strings/example_chomp.f90 +:language: Fortran ``` @@ -120,8 +114,8 @@ The result is of scalar logical type. #### Example -```fortran -{!example/strings/example_starts_with.f90!} +```{literalinclude} ../../example/strings/example_starts_with.f90 +:language: Fortran ``` @@ -157,8 +151,8 @@ The result is of scalar logical type. #### Example -```fortran -{!example/strings/example_ends_with.f90!} +```{literalinclude} ../../example/strings/example_ends_with.f90 +:language: Fortran ``` @@ -212,8 +206,8 @@ The result is of the same type as `string`. #### Example -```fortran -{!example/strings/example_slice.f90!} +```{literalinclude} ../../example/strings/example_slice.f90 +:language: Fortran ``` @@ -257,8 +251,8 @@ The result is a scalar of integer type or an integer array of rank equal to the #### Example -```fortran -{!example/strings/example_find.f90!} +```{literalinclude} ../../example/strings/example_find.f90 +:language: Fortran ``` @@ -297,8 +291,8 @@ The result is of the same type as `string`. #### Example -```fortran -{!example/strings/example_replace_all.f90!} +```{literalinclude} ../../example/strings/example_replace_all.f90 +:language: Fortran ``` @@ -337,8 +331,8 @@ The result is of the same type as `string`. #### Example -```fortran -{!example/strings/example_padl.f90!} +```{literalinclude} ../../example/strings/example_padl.f90 +:language: Fortran ``` @@ -377,8 +371,8 @@ The result is of the same type as `string`. #### Example -```fortran -{!example/strings/example_padr.f90!} +```{literalinclude} ../../example/strings/example_padr.f90 +:language: Fortran ``` @@ -417,8 +411,8 @@ The result is a scalar of integer type or an integer array of rank equal to the #### Example -```fortran -{!example/strings/example_count.f90!} +```{literalinclude} ../../example/strings/example_count.f90 +:language: Fortran ``` @@ -455,8 +449,8 @@ The result is of the same type as `string`. #### Example -```fortran -{!example/strings/example_zfill.f90!} +```{literalinclude} ../../example/strings/example_zfill.f90 +:language: Fortran ``` @@ -495,6 +489,6 @@ The result is an `allocatable` length `character` scalar with up to `128` cached #### Example -```fortran -{!example/strings/example_to_string.f90!} +```{literalinclude} ../../example/strings/example_to_string.f90 +:language: Fortran ``` diff --git a/doc/specs/stdlib_version.md b/doc/specs/stdlib_version.md index 54b207e3d..a232548a7 100644 --- a/doc/specs/stdlib_version.md +++ b/doc/specs/stdlib_version.md @@ -1,11 +1,5 @@ ---- -title: version ---- - -# The `stdlib_version` module - -[TOC] - +# `stdlib_version` + ## Introduction The `stdlib_version` module contains the version of the standard library. @@ -53,6 +47,6 @@ Pure subroutine. #### Example -```fortran -{!example/version/example_version.f90!} +```{literalinclude} ../../example/version/example_version.f90 +:language: Fortran ```