2%> This is the abstract
class for generating instances of objects
3%> that can contain basic attributes required
for tabular read-only
4%> access to a MATLAB ``table``-compatible data stored externally.<br>
7%> This
class is merely a convenience read-only wrapper
8%> to reference external tabular data as table.<br>
9%> This
class primarily exist to facilitate bypassing
10%> the lack of references and pointers in MATLAB.<br>
13%> See the constructor documentation
for example usage.<br>
21%> \JoshuaOsborne, May 21 2024, 4:45 PM, University of Texas at Arlington<br>
22%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
23%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
26 methods(Access =
public)
28 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 %> Generate an
return an
object of
class [pm.container.DataFrame](@ref
DataFrame)
32 %> from the input dataframe or its specified input reference.<br>
35 %> This is the constructor of the
class [pm.container.DataFrame](@ref
DataFrame).<br>
37 %> \param[in] dfref : The input MATLAB 2D matrix or table containing the target dataset
38 %> or function handle that takes no arguments and returns the dataset.<br>
39 %> Specifying a function handle is superior to specifying the dataset
40 %> directly, because the function handle will always allow the use of
41 %> the most updated
version of the user table or matrix.<br>
42 %> (**optional**.
default = ``table(zeros(0, 0))``)
45 %> ``self`` : The output scalar
object of
class [pm.container.DataFrame](@ref
DataFrame).<br>
55 %> \include{lineno} example/container/
DataFrame/main.m
57 %> \include{lineno} example/container/
DataFrame/main.out.m
62 %> \JoshuaOsborne, May 21 2024, 4:54 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>
70 dfref = table(zeros(0, 0));
72 self = self@pm.container.DataRef(dfref);
75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78 %> Generate and
return a table
copy of the dataframe contained in the
79 %> user-specified input ``dfref`` to the constructor of the parent
object.<br>
82 %> This
class method offers the only way to access the user-specified dataframe.<br>
83 %> The underlying logic behind the use of function to access the dataframe
84 %> originates from the lack of the
concept of references (pointers)
85 %> in the MATLAB computing language.<br>
87 %> \param[inout] self : The **implicitly-passed** input argument representing the parent object of the method.<br>
90 %> ``df`` : The output scalar MATLAB ``table`` a full
copy of the dataframe
91 %> contained in the user-specified input ``dfref`` passed
92 %> to the constructor of the parent object.<br>
98 %> df = pm.container.DataFrame.copy()
103 %> See the constructor documentation
for example usage.<br>
108 %> \JoshuaOsborne, May 21 2024, 4:54 PM, University of Texas at Arlington<br>
109 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
110 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
111 function df =
copy(self)
112 df =
copy@pm.container.DataRef(self);
114 df = array2table(df);
118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
121 %> Generate and
return the number of columns in the user-specified
122 %> dataframe ``dfref`` at the time of constructing the parent
object.<br>
125 %> This
class method is a handy shorthand for ``size(self.dfref, 2)``, particularly
126 %> useful
for specifying a range of indices of columns in visualization tasks.<br>
128 %> \param[inout] self : The **implicitly-passed** input argument representing the parent
object of the method.<br>
131 %> ``count`` : The output scalar MATLAB whole-number representing the number
132 %> of columns in the ``dfref`` component of the parent
object.
138 %> count = pm.container.DataFrame.ncol()
143 %> See the constructor documentation
for example usage.<br>
148 %> \JoshuaOsborne, May 21 2024, 5:00 PM, University of Texas at Arlington<br>
149 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
150 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
151 function count = ncol(self)
152 count = size(self.copy(), 2);
155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158 %> Generate and
return the number of rows in the user-specified
159 %> dataframe ``dfref`` at the time of constructing the parent
object.<br>
162 %> This
class method is a handy shorthand for ``size(self.dfref, 2)``,
163 %> particularly useful
for specifying a range of indices of rows to visualize.<br>
165 %> \param[inout] self : The **implicitly-passed** input argument representing the parent
object of the method.<br>
168 %> ``count`` : The output scalar MATLAB whole-number representing the number
169 %> of rows in the ``dfref`` component of the parent
object.<br>
174 %> count = pm.container.DataFrame.nrow()
179 %> See the constructor documentation
for example usage.<br>
184 %> \JoshuaOsborne, May 21 2024, 5:04 PM, University of Texas at Arlington<br>
185 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
186 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
187 function count = nrow(self)
188 count = size(self.copy(), 1);
191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
194 %> Generate and
return a natural logarithmically-spaced
195 %> range of indices from the row indices of the input
196 %> dataframe ``dfref`` to the parent
object.<br>
199 %> This method is a convenience wrapper
200 %> around function [pm.array.logrange](@ref
logrange).<br>
203 %> Beware of the different order of the input arguments
204 %> between
this method and [pm.array.logrange](@ref
logrange).<br>
206 %> \param[inout] self : The **implicitly-passed** input/output argument representing the parent
object of the method.<br>
207 %> \param[in] count : The input scalar MATLAB whole-number (integer)
208 %> representing the maximum size of the output range.<br>
209 %> Due to rounding operation involved in creating the
210 %> output range, it is impossible to prespecify the
211 %> output range size, only the maximum.<br>
212 %> (**optional**,
default = ``1000``)
214 %> \param[in] start : The input scalar MATLAB whole-number (integer)
215 %> representing the starting point of the output range.<br>
216 %> It must be a number in the range ``[1, size(self.dfref, 1)]``.
217 %> Otherwise, the value ``max(1, min(start, self.nrow()))`` will be used.<br>
218 %> (**optional**,
default = ``1``)
220 %> \param[in] stop : The input scalar MATLAB whole-number (integer)
221 %> representing the stopping point of the output range.<br>
222 %> It must be a number in the range ``[1, size(self.dfref, 1)]``.
223 %> Otherwise, the value ``max(start, min(stop, self.nrow()))`` will be used.<br>
224 %> (**optional**,
default = ``1``)
227 %> ``indices`` : The output vector of MATLAB real values containing
228 %> the set of naturally logarithmically-spaced integer
229 %> values in the specified input range.<br>
231 %> \interface{rowslog}
234 %> indices = pm.container.DataFrame()
235 %> indices = pm.container.DataFrame([])
237 %> indices = pm.container.DataFrame([], [])
238 %> indices = pm.container.DataFrame([], start)
239 %> indices = pm.container.DataFrame(count, [])
240 %> indices = pm.container.DataFrame(count, start)
242 %> indices = pm.container.DataFrame([], [], [])
243 %> indices = pm.container.DataFrame(count, [], [])
244 %> indices = pm.container.DataFrame([], start, [])
245 %> indices = pm.container.DataFrame([], [], stop)
246 %> indices = pm.container.DataFrame([], start, stop)
247 %> indices = pm.container.DataFrame(count, [], stop)
248 %> indices = pm.container.DataFrame(count, start, [])
249 %> indices = pm.container.DataFrame(count, start, stop)
254 %> See the constructor documentation
for example usage.<br>
259 %> \JoshuaOsborne, May 21 2024, 5:10 PM, University of Texas at Arlington<br>
260 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
261 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
262 function indices = rowslog(self, count, start, stop)
281 indices = pm.array.logrange(max(1, min(start, self.nrow())), max(start, min(stop, self.nrow())), count);
284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function version(in silent)
Return a scalar MATLAB string containing the latest available ParaMonte MATLAB version newer than the...
This is the abstract class for generating instances of objects that can contain basic attributes requ...
function copy(in self)
Generate and return a table copy of the dataframe contained in the user-specified input dfref to the ...
function DataFrame(in dfref)
Generate an return an object of class pm.container.DataFrame from the input dataframe or its specifie...
function nrow(in self)
Generate and return the number of rows in the user-specified dataframe dfref at the time of construct...
function rowslog(in self, in count, in start, in stop)
Generate and return a natural logarithmically-spaced range of indices from the row indices of the inp...
function ncol(in self)
Generate and return the number of columns in the user-specified dataframe dfref at the time of constr...
This is the abstract class for generating instances of objects that can contain basic attributes requ...
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 logrange(in start, in stop, in sizemax)
Return a set of maximum sizemax unique integer spacings almost linearly spaced in the natural logarit...