ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
versionmm.m
Go to the documentation of this file.
1%> \brief
2%> Return a scalar MATLAB string containing
3%> the last version before the specified input ParaMonte MATLAB library version number.<br>
4%>
5%> \details
6%> The ParaMonte version number follows the
7%> [semantic versioning](https://semver.org/) style: ``major.minor.patch``.<br>
8%> The current (or the input version) is decremented by its patch version.<br>
9%> If the patch version is zero, it is decremented by its minor version.<br>
10%> If the patch version is zero, it is decremented by its major version.<br>
11%>
12%> \note
13%> The function name stands for ``version--``.<br>
14%>
15%> \param[in] current : The input scalar MATLAB string containing the
16%> current Semantic version of the library in
17%> triplet format (e.g., ``"1.2.3"``).<br>
18%> The current ParaMonte library version,
19%> if needed, can be obtained from
20%> [pm.lib.version](@ref version).<br>
21%>
22%> \return
23%> ``previous`` : The output scalar MATLAB string containing the
24%> decremented ParaMonte library version as described above.<br>
25%> The output version **may not necessarily exist**
26%> as an actual ParaMonte library version.<br>
27%>
28%> \interface{versionmm}
29%> \code{.m}
30%>
31%> previous = pm.lib.versionmm(current)
32%>
33%> \endcode
34%>
35%> \example{versionmm}
36%> \include{lineno} example/lib/versionmm/main.m
37%> \output{versionmm}
38%> \include{lineno} example/lib/versionmm/main.out.m
39%>
40%> \final{versionmm}
41%>
42%> \author
43%> \JoshuaOsborne, May 21 2024, 8:13 PM, University of Texas at Arlington<br>
44%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
45%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
46function previous = versionmm(current)
47 currentVerionTriplet = double(strsplit(current, "."));
48 previous = [];
49 index = 4;
50 while true
51 index = index - 1;
52 if index <= 0
53 return;
54 else
55 if currentVerionTriplet(index) > 0
56 previousVerionTriplet = currentVerionTriplet;
57 previousVerionTriplet(index) = previousVerionTriplet(index) - 1;
58 previous = join(string(previousVerionTriplet), ".");
59 return;
60 end
61 end
62 end
63end
function name(in vendor)
Return the MPI library name as used in naming the ParaMonte MATLAB shared libraries.
function index(in array)
Given array(1 : n), return the array index indx(1 : n) such that array(indx) is in ascending order.
function version(in silent)
Return a scalar MATLAB string containing the latest available ParaMonte MATLAB version newer than the...
function lib()
Return a scalar MATLAB string containing the path to the lib directory of the ParaMonte library packa...
function versionmm(in current)
Return a scalar MATLAB string containing the last version before the specified input ParaMonte MATLAB...