| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.3 Data resizing
- MGL command: new DAT [
nx=1 ny=1 nz=1] - Method on
mglData:voidCreate (intmx,intmy=1,intmz=1) - Method on
mglDataC:voidCreate (intmx,intmy=1,intmz=1) - C function:
voidmgl_data_create (HMDTdat,intmx,intmy,intmz) - C function:
voidmgl_datac_create (HADTdat,intmx,intmy,intmz) 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.
- MGL command: rearrange dat
mx [my=0 mz=0] - Method on
mglData:voidRearrange (intmx,intmy=0,intmz=0) - Method on
mglDataC:voidRearrange (intmx,intmy=0,intmz=0) - C function:
voidmgl_data_rearrange (HMDTdat,intmx,intmy,intmz) - C function:
voidmgl_datac_rearrange (HADTdat,intmx,intmy,intmz) 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.
- MGL command: transpose dat ['dim'='yxz']
- Method on
mglData:voidTranspose (const char *dim="yx") - Method on
mglDataC:voidTranspose (const char *dim="yx") - C function:
voidmgl_data_transpose (HMDTdat,const char *dim) - C function:
voidmgl_datac_transpose (HADTdat,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.
- MGL command: extend dat
n1 [n2=0] - Method on
mglData:voidExtend (intn1,intn2=0) - Method on
mglDataC:voidExtend (intn1,intn2=0) - C function:
voidmgl_data_extend (HMDTdat,intn1,intn2) - C function:
voidmgl_datac_extend (HADTdat,intn1,intn2) 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|.
- MGL command: squeeze dat
rx [ry=1 rz=1 sm=off] - Method on
mglData:voidSqueeze (intrx,intry=1,intrz=1,boolsmooth=false) - Method on
mglDataC:voidSqueeze (intrx,intry=1,intrz=1,boolsmooth=false) - C function:
voidmgl_data_squeeze (HMDTdat,intrx,intry,intrz,intsmooth) - C function:
voidmgl_datac_squeeze (HADTdat,intrx,intry,intrz,intsmooth) 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]).
- MGL command: crop dat
n1 n2'dir' - Method on
mglData:voidCrop (intn1,intn2,chardir='x') - Method on
mglDataC:voidCrop (intn1,intn2,chardir='x') - C function:
voidmgl_data_crop (HMDTdat,intn1,intn2,chardir) - C function:
voidmgl_datac_crop (HADTdat,intn1,intn2,chardir) 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.
- MGL command: insert dat 'dir'
[pos=off num=0] - Method on
mglData:voidInsert (chardir,intpos=0,intnum=1) - Method on
mglDataC:voidInsert (chardir,intpos=0,intnum=1) - C function:
voidmgl_data_insert (HMDTdat,chardir,intpos,charnum) - C function:
voidmgl_datac_insert (HADTdat,chardir,intpos,charnum) Insert num slices along dir-direction at position pos and fill it by zeros.
- MGL command: delete dat 'dir'
[pos=off num=0] - Method on
mglData:voidDelete (chardir,intpos=0,intnum=1) - Method on
mglDataC:voidDelete (chardir,intpos=0,intnum=1) - C function:
voidmgl_data_delete (HMDTdat,chardir,intpos,charnum) - C function:
voidmgl_datac_delete (HADTdat,chardir,intpos,charnum) Delete num slices along dir-direction at position pos.
- MGL command: sort dat
idx [idy=-1] - Method on
mglData:voidSort (londidx,longidy=-1) - C function:
voidmgl_data_sort (HMDTdat,londidx,longidy) 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!
- MGL command: clean dat
idx - Method on
mglData:voidClean (londidx) - C function:
voidmgl_data_clean (HMDTdat,londidx) Delete rows which values are equal to next row for given column idx.
- MGL command: join dat vdat
- Method on
mglData:voidJoin (const mglDataA &vdat) - Method on
mglDataC:voidJoin (const mglDataA &vdat) - C function:
voidmgl_data_join (HMDTdat,HCDTvdat) - C function:
voidmgl_datac_join (HADTdat,HCDTvdat) Join data cells from vdat to dat. At this, function increase dat sizes according following: z-size for 3D data arrays arrays with equal x-,y-sizes; or y-size for 2D data arrays with equal x-sizes; or x-size otherwise.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on March 21, 2014 using texi2html 5.0.
