2%> This is the base
class for generating objects
3%> that contain the contents of a given file.<br>
6%> This
class is meant to be primarily internally used
7%> by the ParaMonte library routines (e.g., samplers).<br>
10%> The ``handle`` superclass of
this class
11%> is critical
for the
class functionality.<br>
12%> See the documentation of the
class constructor.<br>
15%> See below
for information on
class attributes (properties).<br>
18%> See below
for information on the methods.<br>
23%> \JoshuaOsborne, May 21 2024, 6:03 PM, University of Texas at Arlington<br>
24%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
25%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
28 properties(Access =
public)
32 %> The scalar MATLAB logical (Boolean) indicator
which is ``
false`` by
default.<br>
33 %> If it is set to ``
true``, it will silence all output postprocessing messages.<br>
39 %> The scalar MATLAB
string containing the path to the file whose contents are read.<br>
48 %> The scalar ``Hidden`` MATLAB ``
struct`` returned by [pm.lib.weblinks](@ref
weblinks)
49 %> used internally
for displaying the ParaMonte library web links.<br>
52 %> This is an internal ``Hidden``
class attribute
53 %> that is inaccessible to the end users.<br>
59 %> The scalar ``Hidden`` MATLAB
object of
class [pm.timing.Spinner](@ref
Spinner)
60 %> used internally
for displaying the progress in file contents processing.<br>
63 %> This is an internal ``Hidden``
class attribute
64 %> that is inaccessible to the end users.<br>
70 %> The scalar ``Hidden`` MATLAB
object of
class [pm.timing.Timer](@ref
Timer)
71 %> used internally
for displaying the timing of the progress in file contents processing.<br>
74 %> This is an internal ``Hidden``
class attribute
75 %> that is inaccessible to the end users.<br>
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
83 methods(Access =
public)
86 %> Return a scalar
object of
class [pm.io.FileContents](@ref
FileContents).
89 %> This is the constructor of the
class [pm.io.FileContents](@ref
FileContents).<br>
90 %> It merely serves as the blueprint
for the IO subclasses
91 %> accessible to the end users.<br>
93 %> \param[in] file : The input scalar MATLAB
string
94 %> containing the path to an external file.
95 %> \param[in] silent : The input scalar MATLAB logical.<br>
96 %> If ``
true``, all descriptive messages will be suppressed.<br>
97 %> Setting
this option to ``
false`` is particularly
98 %> useful in MPI-
parallel simulations.<br>
99 %> (**optional**,
default = ``
false``)
102 %> ``self`` : The output scalar
object of
class [pm.io.FileContents](@ref
FileContents).
108 %> contents = pm.io.FileContents(file, [])
109 %> contents = pm.io.FileContents(file, silent)
116 %> \JoshuaOsborne, May 21 2024, 6:05 PM, University of Texas at Arlington<br>
117 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
118 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
127 self.silent = silent;
130 self.file =
string(file);
133 disp("reading file: """ + self.file + """");
135 self.timer = pm.timing.
Timer();
136 self.spinner = pm.timing.
Spinner();
142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
144 methods(Access = public, Hidden)
147 %> Display the input warning message about the line
148 %> number ``line`` of the file whose contents are read and return nothing.
152 %> The messaging within this routine occurs only if the ``silent`` attribute of the parent
object
153 %> is set to ``false`` at the time of constructing the parent
object of class [pm.io.
FileContents](@ref
FileContents).<br>
155 %> \param[inout] self : The **implicitly-passed** input argument representing the parent
object of the method.<br>
156 %> \param[in] line : The input scalar MATLAB
string or whole number,
157 %> representing the line number within the file about
which the warning message should be printed.<br>
158 %> (**optional**, default = ``"UNKNOWN"``)
159 %> \param[in] msg : The input scalar MATLAB
string containing a message to display on the MATLAB console.<br>
160 %> (**optional**, default = ``"done in " + sprintf("%.6f",
string(self.timer.del())) + " seconds."``)
165 %> fc = pm.io.FileContents(file)
166 %> fc.warn(line, msg)
176 %> \JoshuaOsborne, May 21 2024, 6:07 PM, University of Texas at Arlington<br>
177 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
178 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
179 function warn(self, line, msg)
188 msg =
string(msg) + newline;
197 warning ( newline ...
198 + "The structure of the input file:" + newline ...
200 + pm.io.
tab + self.file + newline ...
202 + "appears compromised around line: " + line + newline ...
204 + "The file parsing will proceed with no guarantee of success." + newline ...
211 %> Display the input final message and return nothing.
216 %> \param[inout] self : The **implicitly-passed** input/output argument representing the parent
object of the method.<br>
217 %> \param[in] msg : The input scalar MATLAB
string containing a
218 %> message to display on the MATLAB console.<br>
219 %> (**optional**, default = ``"done in " + sprintf("%.6f",
string(self.timer.del())) + " seconds."``)
220 %> \param[in] advance : The input scalar MATLAB ``logical``.<br>
221 %> If ``true``, an end of line character will be added at the end of the printed message.<br>
222 %> (**optional**, default = ``true``)
224 %> \interface{checkpoint}
227 %> fc = pm.io.FileContents(file)
228 %> fc.checkpoint(msg, advance)
229 %> fc.checkpoint([], advance)
230 %> fc.checkpoint([], [])
231 %> fc.checkpoint(msg)
237 %> \final{checkpoint}
240 %> \JoshuaOsborne, May 21 2024, 6:07 PM, University of Texas at Arlington<br>
241 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
242 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
243 function checkpoint(self, msg, advance)
255 msg =
"done in " + sprintf(
"%.6f",
string(self.timer.del())) +
" seconds.";
266 %%> Return a
copy of the specified ``field`` (component)
267 %%> of the parent
object of
class [pm.io.FileContents](@ref
FileContents).
270 %%> This method is an unfortunate result of the lack references in MATLAB.<br>
271 %%> The output of
this method is used by the visualization methods of
272 %%>
this class to repeatedly sync the internal
copy of ``df`` with
273 %%> the original ``df`` component of the parent
object.
275 %%> \param[inout] self : The **implicitly-passed** input argument representing the parent
object of the method.<br>
276 %%> \param[in] field : The input scalar MATLAB
string containing the
277 %%>
name of a field (component/attribute) of the parent
278 %%>
object whose value will have to be returned.<br>
281 %%> ``val`` : The output
object containing the value of the
282 %%> specified ``field`` of the parent
object.<br>
284 %%> \interface{getVal}
287 %%> fc = pm.io.FileContents(field)
288 %%> val = fc.getVal(field)
295 %%> \JoshuaOsborne, May 21 2024, 6:07 PM, University of Texas at Arlington<br>
296 %%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
297 %%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
298 %function val = getVal(self, field)
299 % val = self.(field);
function name(in vendor)
Return the MPI library name as used in naming the ParaMonte MATLAB shared library directories.
This is the base class for generating objects that contain the contents of a given file.
function checkpoint(in self, in msg, in advance)
Display the input final message and return nothing.
function FileContents(in file, in silent)
Return a scalar object of class pm.io.FileContents.
function warn(in self, in line, in msg)
Display the input warning message about the line number line of the file whose contents are read and ...
This is the base class for generating subclass of MATLAB handle superclass whose annoying methods are...
This is the base class for generating objects that can display the time spinner on the console.
This is the base class for generating objects that can time interval consecutively.
function copy(in from, in to, in field, in exclude)
Copy the contents of the struct/object from to the struct/object to recursively and without destroyin...
function lib()
Return a scalar MATLAB string containing the path to the lib directory of the ParaMonte library packa...
function parallel()
Return a scalar MATLAB logical that is true if and only if the current installation of MATLAB contain...
function tab()
Return a scalar MATLAB string containing 4 blank characters equivalent to a tab character.
function weblinks()
Return a structure containing tree of weblinks for the ParaMonte MATLAB library source file and docum...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...