DAT [nx=1 ny=1 nz=1
]
¶mglData
: void
Create (int
mx, int
my=1
, int
mz=1
)
¶mglDataC
: void
Create (int
mx, int
my=1
, int
mz=1
)
¶void
mgl_data_create (HMDT
dat, int
mx, int
my, int
mz)
¶void
mgl_datac_create (HADT
dat, int
mx, int
my, int
mz)
¶Creates or recreates the array with specified size and fills it by zero. This function does nothing if one of parameters mx, my, mz is zero or negative.
dat mx [my=0 mz=0]
¶mglData
: void
Rearrange (int
mx, int
my=0
, int
mz=0
)
¶mglDataC
: void
Rearrange (int
mx, int
my=0
, int
mz=0
)
¶void
mgl_data_rearrange (HMDT
dat, int
mx, int
my, int
mz)
¶void
mgl_datac_rearrange (HADT
dat, int
mx, int
my, int
mz)
¶Rearrange dimensions without changing data array so that resulting sizes should be mx*my*mz < nx*ny*nz. If some of parameter my or mz are zero then it will be selected to optimal fill of data array. For example, if my=0 then it will be change to my=nx*ny*nz/mx and mz=1.
dat ['dim'='yxz']
¶mglData
: void
Transpose (const char *
dim="yx"
)
¶mglDataC
: void
Transpose (const char *
dim="yx"
)
¶void
mgl_data_transpose (HMDT
dat, const char *
dim)
¶void
mgl_datac_transpose (HADT
dat, const char *
dim)
¶Transposes (shift order of) dimensions of the data. New order of dimensions is specified in string dim. This function can be useful also after reading of one-dimensional data.
dat n1 [n2=0]
¶mglData
: void
Extend (int
n1, int
n2=0
)
¶mglDataC
: void
Extend (int
n1, int
n2=0
)
¶void
mgl_data_extend (HMDT
dat, int
n1, int
n2)
¶void
mgl_datac_extend (HADT
dat, int
n1, int
n2)
¶Increase the dimensions of the data by inserting new (|n1|+1)-th slices after (for n1>0) or before (for n1<0) of existed one. It is possible to insert 2 dimensions simultaneously for 1d data by using parameter n2. Data to new slices is copy from existed one. For example, for n1>0 new array will be a_ij^new = a_i^old where j=0...n1. Correspondingly, for n1<0 new array will be a_ij^new = a_j^old where i=0...|n1|.
dat rx [ry=1 rz=1 sm=off]
¶mglData
: void
Squeeze (int
rx, int
ry=1
, int
rz=1
, bool
smooth=false
)
¶mglDataC
: void
Squeeze (int
rx, int
ry=1
, int
rz=1
, bool
smooth=false
)
¶void
mgl_data_squeeze (HMDT
dat, int
rx, int
ry, int
rz, int
smooth)
¶void
mgl_datac_squeeze (HADT
dat, int
rx, int
ry, int
rz, int
smooth)
¶Reduces the data size by excluding data elements which indexes are not divisible by rx, ry, rz correspondingly. Parameter smooth set to use smoothing (i.e. out[i]=\sum_{j=i,i+r} a[j]/r) or not (i.e. out[i]=a[j*r]).
dat n1 n2
'dir'
¶mglData
: void
Crop (int
n1, int
n2, char
dir='x'
)
¶mglDataC
: void
Crop (int
n1, int
n2, char
dir='x'
)
¶void
mgl_data_crop (HMDT
dat, int
n1, int
n2, char
dir)
¶void
mgl_datac_crop (HADT
dat, int
n1, int
n2, char
dir)
¶Cuts off edges of the data i<n1 and i>n2 if n2>0 or i>n[xyz]
-n2 if n2<=0 along direction dir.
dat 'how'
¶mglData
: void
Crop (const char *
how="235x"
)
¶mglDataC
: void
Crop (const char *
how="235x"
)
¶void
mgl_data_crop_opt (HMDT
dat, const char *
how)
¶void
mgl_datac_crop_opt (HADT
dat, const char *
how)
¶Cuts off far edge of the data to be more optimal for fast Fourier transform. The resulting size will be the closest value of 2^n*3^m*5^l to the original one. The string how may contain: ‘x’, ‘y’, ‘z’ for directions, and ‘2’, ‘3’, ‘5’ for using corresponding bases.
dat 'dir' [pos=off num=0]
¶mglData
: void
Insert (char
dir, int
pos=0
, int
num=1
)
¶mglDataC
: void
Insert (char
dir, int
pos=0
, int
num=1
)
¶void
mgl_data_insert (HMDT
dat, char
dir, int
pos, char
num)
¶void
mgl_datac_insert (HADT
dat, char
dir, int
pos, char
num)
¶Insert num slices along dir-direction at position pos and fill it by zeros.
dat 'dir' [pos=off num=0]
¶mglData
: void
Delete (char
dir, int
pos=0
, int
num=1
)
¶mglDataC
: void
Delete (char
dir, int
pos=0
, int
num=1
)
¶void
mgl_data_delete (HMDT
dat, char
dir, int
pos, char
num)
¶void
mgl_datac_delete (HADT
dat, char
dir, int
pos, char
num)
¶Delete num slices along dir-direction at position pos.
dat idx [idy=-1]
¶mglData
: void
Sort (lond
idx, long
idy=-1
)
¶void
mgl_data_sort (HMDT
dat, lond
idx, long
idy)
¶Sort data rows (or slices in 3D case) by values of specified column idx (or cell {idx,idy} for 3D case). Note, this function is not thread safe!
dat idx
¶mglData
: void
Clean (lond
idx)
¶void
mgl_data_clean (HMDT
dat, lond
idx)
¶Delete rows which values are equal to next row for given column idx.
dat vdat [v2dat ...]
¶mglData
: void
Join (const mglDataA &
vdat)
¶mglDataC
: void
Join (const mglDataA &
vdat)
¶void
mgl_data_join (HMDT
dat, HCDT
vdat)
¶void
mgl_datac_join (HADT
dat, HCDT
vdat)
¶Join data cells from vdat to dat. At this, function increase dat sizes according following: z-size for data arrays arrays with equal x-,y-sizes; or y-size for data arrays with equal x-sizes; or x-size otherwise.