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.
96 %> \param[in] silent : The input scalar MATLAB logical.<br>
97 %> If ``
true``, all descriptive messages will be suppressed.<br>
98 %> Setting
this option to ``
false`` is particularly useful
100 %> (**optional**,
default = ``
false``)
103 %> ``self`` : The output scalar
object of
class [pm.io.FileContents](@ref
FileContents).
109 %> contents = pm.io.FileContents(file, [])
110 %> contents = pm.io.FileContents(file, silent)
117 %> \JoshuaOsborne, May 21 2024, 6:05 PM, University of Texas at Arlington<br>
118 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
119 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
128 self.silent = silent;
131 self.file =
string(file);
134 disp("reading file: """ + self.file + """");
136 self.timer = pm.timing.
Timer();
137 self.spinner = pm.timing.
Spinner();
143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
145 methods(Access = public, Hidden)
148 %> Display the input warning message about the line
149 %> number ``line`` of the file whose contents are read and return nothing.
153 %> The messaging within this routine occurs only if the ``silent`` attribute of the parent
object
154 %> is set to ``false`` at the time of constructing the parent
object of class [pm.io.
FileContents](@ref
FileContents).<br>
156 %> \param[inout] self : The **implicitly-passed** input argument representing the parent
object of the method.<br>
157 %> \param[in] line : The input scalar MATLAB
string or whole number,
158 %> representing the line number within the file about
which the warning message should be printed.<br>
159 %> (**optional**, default = ``"UNKNOWN"``)
160 %> \param[in] msg : The input scalar MATLAB
string containing a message to display on the MATLAB console.<br>
161 %> (**optional**, default = ``"done in " + sprintf("%.6f",
string(self.timer.del())) + " seconds."``)
166 %> fc = pm.io.FileContents(file)
167 %> fc.warn(line, msg)
177 %> \JoshuaOsborne, May 21 2024, 6:07 PM, University of Texas at Arlington<br>
178 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
179 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
180 function warn(self, line, msg)
189 msg =
string(msg) + newline;
198 warning ( newline ...
199 + "The structure of the input file:" + newline ...
201 + pm.io.
tab + self.file + newline ...
203 + "appears compromised around line: " + line + newline ...
205 + "The file parsing will proceed with no guarantee of success." + newline ...
212 %> Display the input final message and return nothing.
217 %> \param[inout] self : The **implicitly-passed** input/output argument representing the parent
object of the method.<br>
218 %> \param[in] msg : The input scalar MATLAB
string containing a
219 %> message to display on the MATLAB console.<br>
220 %> (**optional**, default = ``"done in " + sprintf("%.6f",
string(self.timer.del())) + " seconds."``)
222 %> \param[in] advance : The input scalar MATLAB ``logical``.<br>
223 %> If ``true``, an end of line character will be added at the end of the printed message.<br>
224 %> (**optional**, default = ``true``)
226 %> \interface{checkpoint}
229 %> fc = pm.io.FileContents(file)
230 %> fc.checkpoint(msg, advance)
231 %> fc.checkpoint([], advance)
232 %> fc.checkpoint([], [])
233 %> fc.checkpoint(msg)
239 %> \final{checkpoint}
242 %> \JoshuaOsborne, May 21 2024, 6:07 PM, University of Texas at Arlington<br>
243 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
244 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
245 function checkpoint(self, msg, advance)
257 msg =
"done in " + sprintf(
"%.6f",
string(self.timer.del())) +
" seconds.";
268 %%> Return a
copy of the specified ``field`` (component)
269 %%> of the parent
object of
class [pm.io.FileContents](@ref
FileContents).
272 %%> This method is an unfortunate result of the lack references in MATLAB.<br>
273 %%> The output of
this method is used by the visualization methods of
274 %%>
this class to repeatedly sync the internal
copy of ``df`` with
275 %%> the original ``df`` component of the parent
object.
277 %%> \param[inout] self : The **implicitly-passed** input argument representing the parent
object of the method.<br>
278 %%> \param[in] field : The input scalar MATLAB
string containing the
279 %%>
name of a field (component/attribute) of the parent
280 %%>
object whose value will have to be returned.<br>
283 %%> ``val`` : The output
object containing the value of the
284 %%> specified ``field`` of the parent
object.<br>
286 %%> \interface{getVal}
289 %%> fc = pm.io.FileContents(field)
290 %%> val = fc.getVal(field)
297 %%> \JoshuaOsborne, May 21 2024, 6:07 PM, University of Texas at Arlington<br>
298 %%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
299 %%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
300 %function val = getVal(self, field)
301 % 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...