2%> Return a scalar MATLAB
string containing
3%> the current ParaMonte
generic or MATLAB library
version numbers,
4%> or optionally, the major, minor, or the patch
version number.
6%> \param[in] lang : The input scalar MATLAB
string that can be either:<br>
8%> <li> the value ``
"generic"``, indicating
9%> the
generic library
version found in the
root directory of
10%> the [ParaMonte library repository](https:
11%> <li> the value ``
"matlab"``, indicating
12%> the MATLAB library
version found in the ``src/matlab`` subdirectory in
13%> the [ParaMonte library repository](https:
15%> The input
version must be in triplet format (e.g., ``
"1.2.3"``).<br>
16%> If the input value is empty ``[]``, the
default value is used.<br>
17%> (**optional**,
default = ``
"matlab"``)
18%> \param[in] type : The input scalar MATLAB
string that can be either:<br>
20%> <li> the value ``
"all"``, indicating
21%> the full
version number output in the format ``
"major.minor.patch"``.<br>
22%> <li> the value ``
"major"``, indicating
23%> the full
version number output in the format ``
"major"``.<br>
24%> <li> the value ``
"minor"``, indicating
25%> the full
version number output in the format ``
"minor"``.<br>
26%> <li> the value ``
"patch"``, indicating
27%> the full
version number output in the format ``
"patch"``.<br>
29%> If the input value is empty ``[]``, the
default value is used.<br>
30%> (**optional**,
default = ``
"all"``)
33%> ``vernum`` : The output scalar MATLAB
string containing the requested
34%> current
generic or language-specific ParaMonte library
version.<br>
39%> vernum = pm.lib.version()
40%> vernum = pm.lib.version([])
41%> vernum = pm.lib.version(lang)
43%> vernum = pm.lib.version([], [])
44%> vernum = pm.lib.version([], type)
45%> vernum = pm.lib.version(lang, [])
46%> vernum = pm.lib.version(lang, type)
51%> If the routine fails to
find the respective VERSION files within the local ParaMonte library,
52%> it will
return the value ``
"UNKNOWN"``
for the output ``vernum``.
57%> \include{lineno} example/
lib/
version/main.out.m
62%> \JoshuaOsborne, May 21 2024, 8:13 PM, University of Texas at Arlington<br>
63%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
64%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
74 type = string(lower(type));
79 lang = string(lower(lang));
84 % persistent vernum_persistent;
85 %
if isempty(vernum_persistent)
86 % vernum_persistent =
struct();
89 %
if ~isfield(vernum_persistent, lang)
91 % fid = fopen(fullfile(pm.lib.path.auxil(),
"VERSION." + lang +
".md"));
92 % vernum_persistent.(lang) =
string(strip(fgetl(fid)));
95 % vernum_persistent.(lang) =
"UNKNOWN";
99 % vernum = vernum_persistent.(lang);
102 version_file = fullfile(pm.lib.path.auxil(),
"VERSION." + lang +
".md");
103 fid = fopen(version_file);
104 vernum = string(strip(fgetl(fid)));
110 if ~strcmp(type,
"all")
111 triplet = strsplit(vernum, ".");
112 if strcmp(type, "major")
113 vernum =
string(triplet(1));
114 elseif strcmp(type, "minor") && numel(triplet) > 1
115 vernum =
string(triplet(2));
116 elseif strcmp(type, "patch") && numel(triplet) > 2
117 vernum =
string(triplet(3));
function version(in silent)
Return a scalar MATLAB string containing the latest available ParaMonte MATLAB version newer than the...
function find(in vendor)
Return a list of scalar MATLAB strings containing the paths to all detected mpiexec binaries installe...
function lib()
Return a scalar MATLAB string containing the path to the lib directory of the ParaMonte library packa...
function root()
Return a scalar MATLAB string containing the root directory of the ParaMonte library package.