There are a set of functions for obtaining data properties in MGL language. However most of them can be found using "suffixes". Suffix can get some numerical value of the data array (like its size, maximal or minimal value, the sum of elements and so on) as number. Later it can be used as usual number in command arguments. The suffixes start from point ‘.’ right after (without spaces) variable name or its sub-array. For example, a.nx
give the x-size of data a, b(1).max
give maximal value of second row of variable b, (c(:,0)^2).sum
give the sum of squares of elements in the first column of c and so on.
dat
¶mglDataA
: const char *
PrintInfo () const
¶mglDataA
: void
PrintInfo (FILE *
fp) const
¶const char *
mgl_data_info (HCDT
dat)
¶
mgl_data_info (long
dat, char *
out, int
len)
¶Gets or prints to file fp or as message (in MGL) information about the data (sizes, maximum/minimum, momentums and so on).
'txt'
¶Prints string txt as message.
val
¶Prints value of number val as message.
dat
¶'txt'
¶val
¶The same as info but immediately print to stdout.
dat
¶Prints all values of the data array dat as message.
val max
¶mglGraph
: void
Progress (int
val, int
max)
¶void
mgl_progress (int
val, int
max)
¶Display progress of something as filled horizontal bar with relative length val/max. Note, it work now only in console and in FLTK-based applications, including mgllab
and mglview
.
(dat)
.nx ¶(dat)
.ny ¶(dat)
.nz ¶mglDataA
: long
GetNx ()
¶mglDataA
: long
GetNy ()
¶mglDataA
: long
GetNz ()
¶long
mgl_data_get_nx (HCDT
dat)
¶long
mgl_data_get_ny (HCDT
dat)
¶long
mgl_data_get_nz (HCDT
dat)
¶Gets the x-, y-, z-size of the data.
(dat)
.max ¶mglDataA
: mreal
Maximal () const
¶mreal
mgl_data_max (HCDT
dat)
¶Gets maximal value of the data.
(dat)
.min ¶mglDataA
: mreal
Minimal () const
¶mreal
mgl_data_min (HMDT
dat) const
¶Gets minimal value of the data.
mglDataA
: mreal
Minimal (int
&i, int
&j, int
&k) const
¶mreal
mgl_data_min_int (HCDT
dat, int
*i, int
*j, int
*k)
¶Gets position of minimum to variables i, j, k and returns the minimal value.
mglDataA
: mreal
Maximal (int
&i, int
&j, int
&k) const
¶mreal
mgl_data_max_int (HCDT
dat, int
*i, int
*j, int
*k)
¶Gets position of maximum to variables i, j, k and returns the maximal value.
mglDataA
: mreal
Minimal (mreal
&x, mreal
&y, mreal
&z) const
¶mreal
mgl_data_min_real (HCDT
dat, mreal
*x, mreal
*y, mreal
*z)
¶Gets approximated (interpolated) position of minimum to variables x, y, z and returns the minimal value.
(dat)
.mx ¶(dat)
.my ¶(dat)
.mz ¶mglDataA
: mreal
Maximal (mreal
&x, mreal
&y, mreal
&z) const
¶mreal
mgl_data_max_real (HCDT
dat, mreal
*x, mreal
*y, mreal
*z)
¶Gets approximated (interpolated) position of maximum to variables x, y, z and returns the maximal value.
(dat)
.mxf ¶(dat)
.myf ¶(dat)
.mzf ¶(dat)
.mxl ¶(dat)
.myl ¶(dat)
.mzl ¶mglDataA
: long
Maximal (char
dir, long
from) const
¶mglDataA
: long
Maximal (char
dir, long
from, long
&p1, long
&p2) const
¶mreal
mgl_data_max_firstl (HCDT
dat, char
dir, long
from, long
*p1, long
*p2)
¶Get first starting from give position (or last one if from<0) maximum along direction dir, and save its orthogonal coordinates in p1, p2.
(dat)
.sum ¶(dat)
.ax ¶(dat)
.ay ¶(dat)
.az ¶(dat)
.aa ¶(dat)
.wx ¶(dat)
.wy ¶(dat)
.wz ¶(dat)
.wa ¶(dat)
.sx ¶(dat)
.sy ¶(dat)
.sz ¶(dat)
.sa ¶(dat)
.kx ¶(dat)
.ky ¶(dat)
.kz ¶(dat)
.ka ¶mglDataA
: mreal
Momentum (char
dir, mreal
&a, mreal
&w) const
¶mglDataA
: mreal
Momentum (char
dir, mreal
&m, mreal
&w, mreal
&s, mreal
&k) const
¶mreal
mgl_data_momentum_val (HCDT
dat, char
dir, mreal
*a, mreal
*w, mreal
*s, mreal
*k)
¶Gets zero-momentum (energy, I=\sum dat_i) and write first momentum (median, a = \sum \xi_i dat_i/I), second momentum (width, w^2 = \sum (\xi_i-a)^2 dat_i/I), third momentum (skewness, s = \sum (\xi_i-a)^3 dat_i/ I w^3) and fourth momentum (kurtosis, k = \sum (\xi_i-a)^4 dat_i / 3 I w^4) to variables. Here \xi is corresponding coordinate if dir is ‘'x'’, ‘'y'’ or ‘'z'’. Otherwise median is a = \sum dat_i/N, width is w^2 = \sum (dat_i-a)^2/N and so on.
(dat)
.fst ¶mglDataA
: mreal
Find (const char *
cond, int
&i, int
&j, int
&k) const
¶mreal
mgl_data_first (HCDT
dat, const char *
cond, int
*i, int
*j, int
*k)
¶Find position (after specified in i, j, k) of first nonzero value of formula cond. Function return the data value at found position.
(dat)
.lst ¶mglDataA
: mreal
Last (const char *
cond, int
&i, int
&j, int
&k) const
¶mreal
mgl_data_last (HCDT
dat, const char *
cond, int
*i, int
*j, int
*k)
¶Find position (before specified in i, j, k) of last nonzero value of formula cond. Function return the data value at found position.
mglDataA
: int
Find (const char *
cond, char
dir, int
i=0
, int
j=0
, int
k=0
) const
¶mreal
mgl_data_find (HCDT
dat, const char *
cond, int
i, int
j, int
k)
¶Return position of first in direction dir nonzero value of formula cond. The search is started from point {i,j,k}.
mglDataA
: bool
FindAny (const char *
cond) const
¶mreal
mgl_data_find_any (HCDT
dat, const char *
cond)
¶Determines if any nonzero value of formula in the data array.
(dat)
.a ¶Give first (for .a
, i.e. dat->a[0]
).