Documentation:Reference:TDI D2 - MdsWiki
Navigation
Personal tools

From MdsWiki

Jump to: navigation, search

DIGITS (X)

F90 Inquiry. The number of significant digits in the model representing
the same type as the argument.

Argument. X must be numeric.

Signals. None.
Units... None.
Form.... Integer scalar.
Result.. The number of non-sign bits in an integer or the number
of fraction bits in a real or complex number.

Example. DIGITS(1.0) is 24 on the VAX.

DIM (X,Y)

F90 Numeric Elemental. The difference X-Y if it is positive; otherwise,
zero.

Arguments X and Y must be integer or real.
Complex numbers are an error.

Signals. Single signal or smaller data.
Units... Single or common units, else bad.
Form.... Compatible form of X and Y. F90 says type of X.

Result.. X-Y if X>Y and zero otherwise.

Example. DIM(-3.0,2.0) is 0.0.

DIM_OF (A,[N])

MDS/VMS Operation. Get the dimension.

Arguments Optional: N.
A VMS or MDS descriptor as below.
N integer scalar from 0 to the number of dimension of a
signal.

Result.. A is searched for these:
DSC$K_CLASS_A, range of N-th lower and upper bounds.
DSC$K_CLASS_APD, range of N-th lower and upper bounds.
DSC$K_CLASS_CA, range of N-th lower and upper bounds.
DSC$K_DTYPE_DIMENSION, unchanged.
DSC$K_DTYPE_SIGNAL, the N-th dimension field.
Otherwise, an error.

Example. DIM_OF([1,2,3]) is 0..2, the range from 0 to 2.

DISPATCH_OF (A)

MDS Operation. Get the dispatch field.

Argument. Descriptor as below.

Result.. A is searched for these:
DSC$K_DTYPE_ACTION, the dispatch field.
DSC$K_DTYPE_DISPATCH, unchanged.
Otherwise, an error.

DIVIDE (X,Y)

Numeric Elemental. The quotient of two numbers.
Usual Form X / Y.
Function Form DIVIDE(X,Y).

Arguments X and Y must be numeric.

Signals. Single signal or smaller data.
Units... X units with inverted Y units separated by a slash.
Form.... The compatible form of X and Y.

Result.. The quotient without remainder of X/Y. If the result is
real or complex there may be rounding. Integer division
truncates. Complex division is
CMPLX((RX*RY-IX*IY)/DEN,(RY*IX-RX*IY)/DEN) with
DEN=RY^2+RI^2, where RX=REAL(X), IX=AIMAG(X), etc. The
exponents are scaled to prevent overflow or underflow.
>>>>>>>>>WARNING, integer divide by zero is ignored.

Examples. 5/3 is 1.
5/BUILD_WITH_UNITS(3,"s") is BUILD_UNITS(1,"/s").

DO (TEST,STMT,...)

CC Modified Statement. Repeat until expression is false.
Required Usual Form. DO {STMT} WHILE (X);.
Function Form DO(TEST,STMT...). May be syntatically invalid.

Arguments
STMT statement list. The curly braces are required!
TEST logical scalar.
>>>>>>Note that TEST is first argument of call form.
>>>>>>WARNING, multiple statements in call form are considered
to be in braces.

Result.. None.

Example. DO {
_J=_X[_J];
} WHILE (_J);.

DOT_PRODUCT (VECTOR_A,VECTOR_B)

F90 Transformation. Performs dot-product multiplication of numeric.
((Non-F90, treats logicals as integers.))

Arguments VECTOR_A and VECTOR_B must be numeric vectors.

Signals. None.
Units... Single or common units, else bad.
Form.... Compatible scalar.

Result.. For integer or real, result is SUM(VECTOR_A*VECTOR_B);
for complex, SUM(CONJG(VECTOR_A),VECTOR_B).
For zero elements the result is zero.

Example. DOT_PRODUCT([1,2,3],[2,3,4]) is 20.

DPROD (X,Y)

F90 Modified Numeric Elemental. Double precision product.

Arguments X and Y must be numeric except octaword or H floating.
For F90, they must be default real and result is double.

Signals. Single signal or smaller data.
Units... Same as for X * Y.
Form.... Twice the precision of the compatible form.

Result.. The product of X and Y with each converted to twice
their precision.

Examples. DPROD(3,4) is 12Q. DPROD(-3.0,2.0) is -6.0D0.

DSCPTR (A,[N])

MDS Operation. Get a field of any class-R descriptor.

Arguments Optional: N.
A any class-R or class-APD descriptor.
N integer scalar from 0 to the number of pointers less 1.

Result.. The N-th descriptor of A for class R or the N-th list
element for class APD.
Descriptor data types (DSC$K_DTYPE_DSC) are removed.
Immediate at compilation for non-class-R.
Use DSCPTR for A without NID, PATH, or variable.
Use DSCPTR_OF for A including them.
>>>>>>>>>WARNING, the N-th element may not describe the N-th data value.

Example. DSCPTRS(A+B,1) is B.

See also. ARG_OF for argument fields of some class-R descriptors
and specific xxx_OF routines for other fields.

DSCPTR_OF (A,[N])

MDS Operation. Get a field of any class-R descriptor.

Arguments Optional: N.
A any class-R or class-APD descriptor.
N integer scalar from 0 to the number of pointers less 1.

Result.. The N-th descriptor of A for class R or the N-th list
element for class APD.
Descriptor data types (DSC$K_DTYPE_DSC) are removed.
Immediate at compilation for non-class-R.
Use DSCPTR for A without NID, PATH, or variable.
Use DSCPTR_OF for A including them.
>>>>>>>>>WARNING, the N-th element may not describe the N-th data value.

Example. DSCPTRS_OF(A+B,1) is B.

See also. ARG_OF for argument
Y numeric. Default is zero.

Signals. Single signal or smaller data.
Units... Single or common units, else bad.
Form.... D-precision complex.

DTYPE_RANGE (START,END,[DELTA])

MDS Operation. Make a range descriptor.

Usual Form: START .. END [.. DELTA] or START : END [: DELTA].

Argument Optional: DELTA; START and END when used as subscript limits.

See the specific routine; otherwise, required.
START scalar. The starting value.
END scalar. The last value.
DELTA scalar. The increment. Default is one.

Result.. Class-R descriptor.
Use BUILD_xxx for immediate structure building.
Use MAKE_xxx in FUNs for evaluated non-PUBLIC variables.

This uses a data type RANGE, whereas
DTYPE_RANGE(START,END,DELTA) is a function.
On evaluation, the compatible data type.
A vector of length max((END - BEGIN)/DELTA,0) elements.

The first value will be BEGIN and successive values will
differ by DELTA. The last value will not be futher from BEGIN than END.
>>>>>>>>>WARNING, the number of element cannot always be predicted
for fractional delta, 1:2:.1 may have 10 or 11 elements.
>>>>>>>>>WARNINGS, the colon (:) form may be confused with a tree member
and the dot-dot (..) form is hard to read/understand, use spaces.

Examples. 2..5 becomes [2,3,4,5] and 2:5:1.8 becomes [2.,3.8].

D_COMPLEX (A)

Conversion Elemental.
Convert to D-precision floating Complex.

Argument. A must be numeric.

Signals. Same as A.
Units... Same as A.
Form.... D-precision complex.

Result.. If Y is absent and X is complex, the AIMAG(X) is used
for Y. If X and Y are present, the real parts of each
are used.
Immediate at compilation.
>>>>>>>>>WARNING, truncation does not cause an error.

Example. D_COMPLEX(3,4.1) is CMPLX(3.0D0,4.1D0), approximately.

D_FLOAT (A)

Conversion Elemental. Convert to D-precision floating real.

Argument. A must be numeric.

Signals. Same as A.
Units... Same as A.
Form.... D-precision real.

Result.. Integers, reals and the real part of complex numbers are
converted to D-precision reals.
Immediate at compilation.
>>>>>>>>>WARNING, truncation does not cause an error.

Example. D_FLOAT(12), D_FLOAT(12.) D_FLOAT(12H0) are 12D0,
approximately.