2%> This is the base
class for the ParaMonte sampler basic specifications.<br>
5%> This is a low-level
class that is not meant to be used by the user.<br>
8%> See the documentation of the
class constructor.<br>
11%> All
class attributes can be set after constructing an instance of this class.<br>
14%> See below
for information on the methods.<br>
17%> [ParaDRAM simulation specifications listing](\pmdoc_usage_sampling/paradram/specifications/)<br>
22%> \JoshuaOsborne, May 21 2024, 3:38 AM, University of Texas at Arlington<br>
23%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
24%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30 %> \specdram{description}
34 %> \specdram{domainaxisname}
36 %> \specdram{domainballavg}
38 %> \specdram{domainballcor}
40 %> \specdram{domainballcov}
42 %> \specdram{domainballstd}
44 %> \specdram{domaincubelimitlower}
45 domainCubeLimitLower = [];
46 %> \specdram{domaincubelimitupper}
47 domainCubeLimitUpper = [];
48 %> \specdram{domainerrcount}
50 %> \specdram{domainerrcountmax}
51 domainErrCountMax = [];
52 %> \specdram{outputchainfileformat}
53 outputChainFileFormat = [];
54 %> \specdram{outputcolumnwidth}
55 outputColumnWidth = [];
56 %> \specdram{outputfilename}
58 %> \specdram{outputstatus}
60 %> \specdram{outputprecision}
62 %> \specdram{outputreportperiod}
63 outputReportPeriod = [];
64 %> \specdram{outputrestartfileformat}
65 outputRestartFileFormat = [];
66 %> \specdram{outputsamplesize}
67 outputSampleSize = [];
68 %> \specdram{outputseparator}
70 %> \specdram{outputsplashmode}
71 outputSplashMode = [];
72 %> \specdram{parallelism}
74 %> \specdram{parallelismmpifinalizeenabled}
75 parallelismMpiFinalizeEnabled = [];
76 %> \specdram{parallelismnumthread}
77 parallelismNumThread = [];
78 %> \specdram{randomseed}
80 %> \specdram{targetacceptancerate}
81 targetAcceptanceRate = [];
84 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86 properties(Hidden, Access =
protected)
93 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
95 methods(Access = public)
98 %> Construct and return an
object of class [pm.sampling.
SpecBase](@ref
SpecBase).
100 %> \param[in] method : The input scalar MATLAB
string containing
101 %> the
name of the specific ParaMonte sampler
102 %> whose simulation specifications are to be
103 %> stored in the output of this constructor.<br>
104 %> \param[in] silent : The input scalar MATLAB logical.<br>
105 %> If ``true``, all descriptive messages on
106 %> the MATLAB command line will be suppressed.<br>
107 %> (**optional**, default = ``false``)
110 %> The output scalar
object of class [pm.sampling.
SpecBase](@ref
SpecBase).<br>
113 %> [ParaDRAM simulation specifications listing](\pmdoc_usage_sampling/paradram/specifications/)<br>
119 %> spec = pm.sampling.SpecBase([])
120 %> spec = pm.sampling.SpecBase([], [])
121 %> spec = pm.sampling.SpecBase(method)
122 %> spec = pm.sampling.SpecBase(method, [])
123 %> spec = pm.sampling.SpecBase([], silent)
124 %> spec = pm.sampling.SpecBase(method, silent)
131 %> \JoshuaOsborne, May 21 2024, 3:40 AM, University of Texas at Arlington<br>
132 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
133 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
134 function self =
SpecBase(method, silent)
145 self.method = method;
149 %
if isa(ndim,
"real") || isa(ndim,
"int32")
150 %
if rem(ndim, 1) == 0
158 % error ( newline ...
159 % +
"The specified input value for ``ndim`` (" +
string(ndim) +
") must be a whole number (integer)." + newline ...
160 % +
"The variable ``ndim`` represents the number of dimensions of the domain" + newline ...
161 % +
"of the object function that is to be explored." + newline ...
168 %> Return documentation help
for the input simulation specification
name.<br>
171 %> Otherwise,
return documentation help
for all simulation specifications
172 %>
if the input ``specification`` argument is missing.<br>
175 %> The underlying reason
for unifying documentation of
object attributes
176 %> within a single online page is to significantly reduce duplication and
177 %> work required
for generating and maintaining such documentation across
178 %> all supported programming language environments.<br>
180 %> \param[in] self : The input parent
object of
class [pm.sampling.SpecBase](@ref
SpecBase)
181 %>
which is **implicitly** passed to
this dynamic method (not by the user).<br>
182 %> \param[in] specification : The input scalar MATLAB
string containing the
183 %>
name of a simulation specification corresponding
184 %> an attribute of the parent
object.<br>
187 %> ``
weblink`` : The output scalar MATLAB
string containing the web address
188 %>
for the documentation of the requested simulation specification.<br>
194 %>
weblink = self.doc(specification)
200 %> pmpd.spec.doc() %
return help
for all specifications.
201 %> pmpd.spec.doc(
"outputFileName") %
return help
for the specification ``outputFileName``.
208 %> \JoshuaOsborne, May 21 2024, 3:42 AM, University of Texas at Arlington<br>
209 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
210 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
211 function
weblink = doc(self, specification)
214 weblink = pm.web.href(self.url);
216 if isstring(specification) || ischar(specification)
217 specList = properties(self);
218 specListLen = length(specList);
219 for i = 1 : specListLen
220 if strcmpi(specList{i}, specification)
221 specLower =
"#" + lower(specification);
222 weblink = pm.web.href(self.url + specLower);
227 +
"The input specification must be a string or char vector " + newline ...
228 +
"whose value is the name of one of the specification properties" + newline ...
229 +
"of the sampler as specified in the ``spec`` component." + newline ...
230 +
"Example usage:" + newline ...
232 + pm.io.tab +
"doc()" + newline ...
233 + pm.io.tab +
"doc(""chainSize"")" + newline ...
242 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
247 %> Ensure all specification properties of the parent
object are sensible.<br>
248 %> This is a dynamic method of the
class [pm.sampling.SpecBase](@ref
SpecBase).<br>
250 %> \param[inout] self : The input/output parent
object of
class [pm.sampling.SpecBase](@ref
SpecBase)
251 %>
which is **implicitly** passed to
this dynamic method (not by the user).<br>
252 %> \param[in] ndim : The input scalar MATLAB integer containing
253 %> the number of dimensions of the domain of the
254 %>
object function that is to be explored.<br>
257 %> ``entries`` : The output scalar MATLAB
string containing
258 %> the simulation specifications converted to
259 %> a Fortran-namelist-compatible entry.<br>
261 %> \interface{getEntriesNML}
264 %> entries = self.getEntriesNML(ndim)
268 %> \final{getEntriesNML}
271 %> \JoshuaOsborne, May 21 2024, 3:43 AM, University of Texas at Arlington<br>
272 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
273 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
274 function entries = getEntriesNML(self, ndim)
275 if isempty(self.outputFileName)
276 % First define ``outputFileName``
if it is empty.
277 self.outputFileName = fullfile(
string(pwd), pm.io.getFileName(self.method));
278 elseif pm.introspection.istype(self.outputFileName,
"string", 1)
279 if ~self.silent && contains(self.outputFileName,
" ")
280 warning ( newline ...
281 + "The specified simulation specification ``outputFileName`` contains whitespace characters(s)." + newline ...
282 + "Blanks are infamous for causing software crashes and failures." + newline ...
283 + "Best is to blanks and special characters in paths." + newline ...
287 if endsWith(self.outputFileName, "\") || endsWith(self.outputFileName, "/")
288 self.outputFileName = fullfile(
string(pm.sys.path.
abs(self.outputFileName, "lean")), pm.io.
getFileName(self.method));
292 if ~isempty(self.description ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("description ", self.description , "
string" , 1); end
293 if ~isempty(self.domain ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("domain ", self.domain , "
string" , 1); end
294 if ~isempty(self.domainAxisName ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("domainAxisName ", self.domainAxisName , "
string" , ndim); end
295 if ~isempty(self.domainBallAvg ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("domainBallAvg ", self.domainBallAvg , "real" , ndim); end
296 if ~isempty(self.domainBallCor ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("domainBallCor ", self.domainBallCor , "real" , ndim^2); end
297 if ~isempty(self.domainBallCov ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("domainBallCov ", self.domainBallCov , "real" , ndim^2); end
298 if ~isempty(self.domainBallStd ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("domainBallStd ", self.domainBallStd , "real" , ndim); end
299 if ~isempty(self.domainCubeLimitLower ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("domainCubeLimitLower ", self.domainCubeLimitLower , "real" , ndim); end
300 if ~isempty(self.domainCubeLimitUpper ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("domainCubeLimitUpper ", self.domainCubeLimitUpper , "real" , ndim); end
301 if ~isempty(self.domainErrCount ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("domainErrCount ", self.domainErrCount , "integer", 1); end
302 if ~isempty(self.domainErrCountMax ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("domainErrCountMax ", self.domainErrCountMax , "integer", 1); end
303 if ~isempty(self.outputChainFileFormat ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("outputChainFileFormat ", self.outputChainFileFormat , "
string" , 1); end
304 if ~isempty(self.outputColumnWidth ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("outputColumnWidth ", self.outputColumnWidth , "integer", 1); end
305 if ~isempty(self.outputFileName ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("outputFileName ", self.outputFileName , "
string" , 1); end
306 if ~isempty(self.outputStatus ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("outputStatus ", self.outputStatus , "
string" , 1); end
307 if ~isempty(self.outputPrecision ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("outputPrecision ", self.outputPrecision , "integer", 1); end
308 if ~isempty(self.outputReportPeriod ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("outputReportPeriod ", self.outputReportPeriod , "integer", 1); end
309 if ~isempty(self.outputRestartFileFormat ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("outputRestartFileFormat ", self.outputRestartFileFormat , "
string" , 1); end
310 if ~isempty(self.outputSampleSize ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("outputSampleSize ", self.outputSampleSize , "integer", 1); end
311 if ~isempty(self.outputSeparator ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("outputSeparator ", self.outputSeparator , "
string" , 1); end
312 if ~isempty(self.outputSplashMode ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("outputSplashMode ", self.outputSplashMode , "
string" , 1); end
313 if ~isempty(self.parallelism ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("parallelism ", self.parallelism , "
string" , 1); end
314 if ~isempty(self.parallelismMpiFinalizeEnabled ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("parallelismMpiFinalizeEnabled", self.parallelismMpiFinalizeEnabled , "logical", 1); end
315 if ~isempty(self.parallelismNumThread ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("parallelismNumThread ", self.parallelismNumThread , "integer", 1); end
316 if ~isempty(self.randomSeed ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("randomSeed ", self.randomSeed , "integer", 1); end
317 if ~isempty(self.targetAcceptanceRate ); entries = entries + self.nmlsep + pm.introspection.
getEntryNML("targetAcceptanceRate ", self.targetAcceptanceRate , "real" , 2); end
319 % % These methods have been implemented to override the default 'handle' class methods,
320 % % so that they will not pop-up after pressing 'Tab' button.
321 % function addlistener (self) end
322 % function delete (self) end
323 % function findobj (self) end
324 % function findprop (self) end
325 % function valid (self) end
326 % function listener (self) end
327 % function notify (self) end
function name(in vendor)
Return the MPI library name as used in naming the ParaMonte MATLAB shared library directories.
function abs(in path, in style)
Return the Get absolute canonical path of a file or folder.
This is the base class for generating subclass of MATLAB handle superclass whose annoying methods are...
This is the base class for the ParaMonte sampler basic specifications.
Property outputReportPeriod
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property description
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property domainBallCor
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
function getEntriesNML(in self, in ndim)
Ensure all specification properties of the parent object are sensible. This is a dynamic method of t...
Property outputSeparator
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property outputColumnWidth
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property outputChainFileFormat
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
function SpecBase(in method, in silent)
Construct and return an object of class pm.sampling.SpecBase.
Property domainErrCount
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property parallelismMpiFinalizeEnabled
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property domainBallCov
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
function doc(in self, in specification)
Return documentation help for the input simulation specification name.
Property outputFileName
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property domainCubeLimitLower
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property parallelismNumThread
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property domainBallAvg
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property targetAcceptanceRate
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property parallelism
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property domainCubeLimitUpper
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property domainBallStd
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property domainAxisName
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property outputSampleSize
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property outputStatus
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property outputSplashMode
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property outputPrecision
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property outputRestartFileFormat
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property domainErrCountMax
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property domain
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
Property randomSeed
See the generic documentation at: https://www.cdslab.org/paramonte/generic/2/usage/sampling/paradram/...
function getEntryNML(in varname, in varval, in vartype, in varsize)
Return a Fortran-namelist-compatible conversion of the input varval.
function getFileName(in prefix)
Return a scalar MATLAB string containing a file name based on the current date and time.
function weblink(in silent)
Return a scalar MATLAB string containing the download weblink to latest ParaMonte MATLAB library vers...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...