Documentation:Reference:TDI NO - MdsWiki
Navigation
Personal tools

From MdsWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 04:02, 23 January 2007 (edit)
WikiSysop (Talk | contribs)

← Previous diff
Revision as of 04:03, 23 January 2007 (edit)
WikiSysop (Talk | contribs)

Next diff →
Line 104: Line 104:
<span id="name_of1"></span> <span id="name_of1"></span>
-==NAME_OF (A)== 
- 
-MDS Operation. Get the name field. <br /><br /> Argument. Descriptor as below. <br /><br /> Result.. A is searched for this: <br /> DSC$K_DTYPE_CONGLOM, the name field. <br /> Otherwise, an error. 
- 
-<span id=“name“></span> 
==NAND (L,M)== ==NAND (L,M)==

Revision as of 04:03, 23 January 2007

MAP (A,B)

Transformation. Element selection from an array.

Arguments
A an array of any type considered to be a vector.
B a list of offsets into the A array.
Values are from 0 to the number of elements in A less 1.
Out-of-bounds values are considered to be at the limits.

Signals. Same as B.
Units... Same as A.
Form.... Same type as A and same shape as B.

Result.. Each value in B is used to look up a value in A.
The value is copied into the result.
This is the same as A(B) in IDL when B is a vector.
>>>>>>>>>WARNING, multidimensional arrays referenced by bad offsets
will likely be junk.

Examples. MAP(1..10,[20,-1,5]) is [10,1,6].
_A=5..1..-1, MAP(_A,SORTI(_A)) is [1,2,3,4,5],
which is the same as SORT(5..1..-1).

See also. CULL to remove bad B values.
SUBSCRIPT for dimensional indexing into signal and
multiple index access to arrays.

matmul (MATRIX_A,MATRIX_B)

F90 Transformation. Performs matrix multiplication of numeric matrices.

Arguments
MATRIX_A numeric array of rank one or two. A vector is
considered to be of shape [1,m].
MATRIX_B numeric array of rank one or two. The size of the first
dimension of MATRIX_B must be the same as the size of
the last dimension of MATRIX_A. A vector is considered
to be of shape [m,1].
There is no support for F90 logical arrays.

Signals. Single signal or smaller data.
Units... Same as for MATRIX_A * MATRIX_B.
Form.... If MATRIX_A has shape [n,m] and MATRIX_B has shape
[m,k], the result has shape [n,k]. For rank-one cases,
the n or k is omitted.

Result.. Result element [i,j] is
SUM(MATRIX_A[i,:] * MATRIX_B[:,j]).

Examples. MATMUL(_A=[1 2 3],_B=[1 2]) is [14 20].
[2 3 4] [2 3] [20 29]
[3 4]
MATMUL([1,2],_A) is vector-matrix product [5,8,11].
MATMUL(_A,[1,2,3]) is matrix-vector product [14,20].

mat_rot (MATRIX,ANGLE,MAG,X0,Y0)

Transformation. Rotate a matrix about a point.

Arguments
MATRIX rank-two array.
ANGLE real scalar, clockwise? rotation of the data.
MAG real scalar, magnification.
X0 real scalar, first axis center of rotation.
Y0 real scalar, second axis center of rotation.

Signals. Same as MATRIX.
Units... Same as MATRIX.
Form.... Same as MATRIX.

Result.. The value at closest grid point to the rotated array.

Example. ??

mat_rot_int (MATRIX,ANGLE,MAG,X0,Y0)

Transformation. Rotate a matrix about a point with interpolation.

Arguments
MATRIX rank-two array.
ANGLE real scalar, clockwise? rotation of the data.
MAG real scalar, magnification.
X0 real scalar, first axis center of rotation.
Y0 real scalar, second axis center of rotation.

Signals. Same as MATRIX.
Units... Same as MATRIX.
Form.... Same as MATRIX.

Result.. The value interpolated from near-by grid points to the
rotated array.

Example. ??

MAX (A1,A2,A3,...)

F90 Numeric Elemental. Maximum value.

Arguments Integer or real. Complex numbers are an error.

Signals. The single signal or the smallest.
Units... The single or matching units, else bad.
Form.... The compatible form of all the arguments. Conversion is
done pairwise.

Result.. The largest argument. A reserved operand will dominate.

Example. MAX(-9.0,7.0,2.0) is 7.0.

MAXEXPONENT (X)

F90 Inquiry. The maximum exponent in the model representing numbers of
the same type as the argument.

Argument. X is real, scalar or array.

Signals. None.
Units... None.
Form.... Integer scalar.

Result.. The number emax for the model of the same type as X.
Example. MAXEXPONENT(1.0) is 127 on the VAX.

MAXLOC (ARRAY,[MASK])

F90 Transformation. Determine the location of an element of ARRAY with
the maximum value of the elements identified by MASK.

Arguments Optional: MASK.
ARRAY numeric array.
MASK logical and conformable with ARRAY.

Signals. None.
Units... None.
Form.... Long vector of size equal to rank of ARRAY.

Result.. The result is the vector of subscripts of an element
whose value equals the maximum of all elements of ARRAY
or all elements for which MASK is true. Reserved
operands ($ROPRAND) are ignored. Each subscript will
be in the extent of its dimension. For zero size, no
true elements in MASK, or all $ROPRAND the result is
undefined. If more than one element has the maximum
value the result is the first in array order. The result
is an offset vector even if there is a lower bound.

Examples. MAXLOC([2,4,6]) is [2].
For _A=[0 -5 8 -3], MAXLOC(_A,_A LT 6) is [2,1].
[3 4 -1 2]
[1 5 6 -4]

See also. MAXVAL for the value.

MAXVAL (ARRAY,[DIM],[MASK])

F90 Transformation. Maximum value of the elements of ARRAY along
dimension DIM corresponding to true elements of MASK.

Arguments Optional: DIM, MASK.
ARRAY numeric array.
DIM integer scalar from 0 to n-1, where n is rank of ARRAY.
MASK logical and conformable to ARRAY.

Signals. Same as ARRAY if DIM-th or all dimensions omitted.
Units... Same as ARRAY.
Form.... Same type as ARRAY. It is a scalar if DIM is absent or
ARRAY is scalar or vector. Otherwise, the result is an
array of rank n-1 and shaped like ARRAY with DIM
subscript omitted.

Result.. The result without DIM is the maximum value of the
elements of ARRAY, testing only those with true MASK
values and value not equal to the reserved operand
($ROPRAND). With DIM, the value of an element of the
result is the maximum of ARRAY elements with DIM
dimension fixed as the element number of the result.
If no value is found, -HUGE(ARRAY) is returned.

Examples. MAXVAL([1,2,3]) is 3. MAXVAL(_C,,_C LT 0) finds the
maximum negative element of C. If
_B=[1 3 5],
[2 4 6]
MAXVAL(_B,0) is [2,4,6] and MAXVAL(_B,1) is [5,6].

See also. MAXLOC for the location.

MEAN (ARRAY,[DIM],[MASK])

Transformation. Average value of the elements of ARRAY along dimension
DIM corresponding to the true elements of MASK.

Arguments Optional: DIM, MASK.
ARRAY numeric array.
DIM integer scalar from 0 to n-1, where n is rank of ARRAY.
MASK logical and conformable to ARRAY.

Signals. Same as ARRAY if DIM-th or all dimensions omitted.
Units... Same as ARRAY.
Form.... Same type as ARRAY. It is a scalar if DIM is absent or
ARRAY is scalar or vector. Otherwise, the result is an
array of rank n-1 and shaped like ARRAY with DIM
subscript omitted.

Result.. The result without DIM is the mean value of the elements
of ARRAY, testing only those with true MASK values and
value not equal to the reserved operand ($ROPRAND). With
DIM, the value of an element of the result is the mean
of ARRAY elements with dimension DIM fixed as the
element number of the result.
If no value is found, zero is given.

Examples. MEAN([1,2,3]) is 2. MEAN(_C,,_C GT 0) finds the mean of
positive element of C. If _B=[1 3 5],
[2 4 6]
MEAN(_B,0) is [1,3,5] and MEAN(_B,1) is [3,4].

median (ARRAY,WIDTH)

Transformation. Median filter of specified width or area.

Arguments
ARRAY integer or real, vector or rank-two array.
WIDTH integer scalar.

Signals. Same as ARRAY.
Units... Same as ARRAY.
Form.... Same as ARRAY.

Result.. Each element at least WIDTH/2 from the edge is median of
the values WIDTH/2 on each side of it. The perimeter is
equal to the first interior value. (subject to change)

Example. ??

MERGE (TSOURCE,FSOURCE,MASK)

F90 Logical Elemental. Choose alternative value according to a mask.

Arguments
TSOURCE any type compatible with FSOURCE.
FSOURCE any type compatible with TSOURCE.
MASK logical, conformable with TSOURCE and FSOURCE.

Signals. Single signal or smaller data.
Units... Single or common units (excluding MASK), else bad.
Form.... The type is the compatible type of FSOURCE and TSOURCE.
The shape conformable to FSOURCE, TSOURCE, and MASK.

Result.. If the MASK value is true, the TSOURCE value is use;
otherwise, the FSOURCE value is use.

Examples. MERGE([1,2,3],[4,5,6],[$TRUE,$FALSE,$TRUE]) is [1,5,3].
If TSOURCE is the array [1 6 5], FSOURCE is the array
[2 4 6]
[0 3 2] and MASK is [1 0 1],
[7 4 8] [0 0 1]
then MERGE(TSOURCE,FSOURCE,MASK)
is [1 3 5].
[7 4 6]

See also. CONDITIONAL with form: MASK ? TSOURCE : FSOURCE, for
scalar mask test.

METHOD_OF (A)

MDS Operation. Get the method field.

Argument. Descriptor as below.

Result.. A is searched for this:
DSC$K_DTYPE_METHOD, the method field.
Otherwise, an error.

MIN (A1,A2,A3,...)

F90 Numeric Elemental. Minimum value.

Arguments Integer or real. Complex numbers are an error.

Signals. The single signal or the smallest.
Units... The single or matching units, else bad.
Form.... The compatible form of all the arguments. Conversion is
done pairwise.

Result.. The smallest argument. A reserved operand will dominate.

Example. MIN(-9.0,7.0,2.0) is -9.0.

MINEXPONENT (X)

F90 Inquiry. The minimum exponent in the model representing numbers of
the same type as the argument.

Argument. X must be real or complex, scalar or array.

Signals. None.
Units... None.
Form.... Integer scalar.

Result.. The number emin for the model of the same type as X.

Example. MINEXPONENT(1.0) is -127 on the VAX.

MINLOC (ARRAY,[MASK])

F90 Transformation. Determine the location of an element of ARRAY
having the minimum value of the elements identified by MASK.

Arguments Optional: MASK.
ARRAY numeric array.
MASK logical and conformable with ARRAY.

Signals. None.
Units... None.
Form.... Long vector of size equal to rank of ARRAY.

Result.. The result is the vector of subscripts of an element
whose value equals the minimum of all elements of ARRAY
or all elements for which MASK is true. Reserved
operands ($ROPRAND) are ignored. Each subscript will
be in the extent of its dimension. For zero size, no
true elements in MASK, or all $ROPRAND the result is
undefined. If more than one element has the maximum
value the result is the first in array order. The result
is an offset vector even if there is a lower bound.

Examples. MINLOC([2,4,6]) is [0].
For _A=[0 -5 8 -3], MINLOC(_A,_A GT -4) is [0,3].
[3 4 -1 2]
[1 5 6 -4]

See also. MINVAL for the value.

MINVAL (ARRAY,[DIM],[MASK])

F90 Transformation. Minimum value of the elements of ARRAY along
dimension DIM corresponding to true elements of MASK.

Arguments Optional: DIM, MASK.
ARRAY numeric array.
DIM integer scalar from 0 to n-1, where n is rank of ARRAY.
MASK logical and conformable to ARRAY.

Signals. Same as ARRAY if DIM-th or all dimensions omitted.
Units... Same as ARRAY.
Form.... Same type as ARRAY. It is a scalar if DIM is absent or
ARRAY is scalar or vector. Otherwise, the result is an
array of rank n-1 and shaped like ARRAY with DIM
subscript omitted.
Result.. The result without DIM is the minimum value of the
elements of ARRAY, testing only those with true MASK
values and value not equal to the reserved operand
($ROPRAND). With DIM, the value of an element of the
result is the minimum of ARRAY elements with DIM
dimension fixed as the element number of the result.
If no value is found, +HUGE(ARRAY) is returned.

Examples. MINVAL([1,2,3]) is 3. MINVAL(_C,,_C GT 0) finds the
minimum positive element of C.
If _B=[1 3 5],
[2 4 6]
MINVAL(_B,0) is [1,3,5] and MINVAL(_B,1) is [1,2].

See also. MINLOC for the location.

MOD (A,P)

F90 Numeric Elemental. Remainder.
Usual Form A MOD P.

Arguments A and P 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 A and P.

Result.. If P NE 0, the result is A-INT(A/P)*P. If P==0, the result
is the $ROPRAND for reals and undefined for integers.

Examples. MOD(3.0,2.0) is 1.0. MOD(8,5) is 3. MOD(-8,5) is -3.
MOD(8,-5) is -3. MOD(-8,-5) is -3.

MODEL_OF (A)

MDS Operation. Get the model field.

Argument. Descriptor as below.

Result.. A is searched for this:
DSC$K_DTYPE_CONGLOM, the model field.
Otherwise, an error.

modulo (A,P)

F90 Numeric Elemental. Remainder.
Usual Form A MODULO P.

Arguments A and P 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 A and P.

Result.. If P NE 0, the result is A-FLOOR(REAL(A)/(REAL)P)*P.
If P==0, the result is the $ROPRAND for reals and
undefined for integers.
Examples. MODULO(8,5) is 3. MODULO(-8,5) is 2.
MODULO(8,-5) is -2. MODULO(-8,-5) is -3.

NAME_OF (A)

MDS Operation. Get the name field.

Argument. Descriptor as below.

Result.. A is searched for this:
DSC$K_DTYPE_CONGLOM, the name field.
Otherwise, an error.

NAND (L,M)

Logical Elemental. Negation of logical intersection of elements.
Usual Forms L NAND M.

Arguments L and M must be logical (lowest bit is 1 for true).

Signals. Single signal or smaller data.
Units... None unless both have units and they don't match.
Form.... Logical of compatible shape.

Result.. False if both are true; otherwise, true.

Example. [0,0,1,1] && [0,1,0,1] is [$TRUE,$TRUE,$TRUE,$FALSE].

NAND_NOT (L,M)

Logical Elemental. Negation of logical intersection of first with
negation of second. Logically equivalent to NOT(L) OR M.
Accepted Form. L NAND_NOT M.

Arguments L and M must be logical (lowest bit is 1 for true).

Signals. Single signal or smaller data.
Units... None unless both have units and they don't match.
Form.... Logical of compatible shape.

Result.. True if L is false or M is true; otherwise, false.
Example. [0,0,1,1] NAND_NOT [0,1,0,1] is
[$TRUE,$TRUE,$FALSE,$TRUE].

NDESC (A)

MDS Information. The number of descriptors in an MDS record.

Argument. A must be an MDS class-R descriptor.

Signals. None.
Units... None.
Form.... Byte unsigned scalar.
Result.. The number of descriptors in the class-R descriptor.
Descriptor data types (DSC$K_DTYPE_DSC) are removed.
Use NDESC for count without NID, PATH, or variable.
Use NDESC_OF for count including them.

Examples. NDESC($VALUE) is 0. NDESC(A+B) may be error.

NDESC_OF (A)

MDS Information. The number of descriptors in an MDS record.

Argument. A must be an MDS class-R descriptor.

Signals. None.
Units... None.
Form.... Byte unsigned scalar.

Result.. The number of descriptors in the class-R descriptor.
Descriptor data types (DSC$K_DTYPE_DSC) are removed.
Use NDESC for count without NID, PATH, or variable.
Use NDESC_OF for count including them.

Examples. NDESC_OF($VALUE) is 0. NDESC_OF(A+B) is 2.

NDIMS (A)

MDS Information. The number of dimensions in an array or signal.

Argument. A can be a scalar, array or signal.

Result.. The number of dimensions in an array or signal.
If A is a scalar, NDIMS returns 0.
If A is an array or signal, NDIMS returns the number of dimensions.

Examples. NDIMS(42) is 0. NDIMS(ZERO([3,3],0)) is 2. NDIMS(BUILD_SIGNAL(1,*,3,4,5)) is 3.

NE (X,Y)

Logical Elemental. Tests for inequality of two values.
Usual Forms X != Y, X <> Y, X NE Y. F90 form /= is not allowed.
Function Form NE(X,Y).

Arguments X and Y must both be numeric or character.

Signals. Single signal or smaller data.
Units... None unless both have units and they don't match.
Form.... Logical of compatible shape.

Result.. True if X and Y are the unequal; otherwise, false.
$ROPRAND is not unequal to any value, thus gives false.
>>>>>>>>>WARNING, floating point operations may not match an exact
calculation for nonterminating binary fractions.
You cannot predict that .1+.1!=.2 will be false.

Example. 2<>2. is $FALSE.

nearest (X,S)

F90 Numeric Elemental. Nearest different machine represntable number in
a given direction.

Arguments
X real.
S real and not zero.

Signals. Single signal or smaller data.
Units... Same as X.
Form.... Same as X.

Result.. The machine representable number distinct from X and
nearest to it in the direction to the infinity of the
same sign as S.

Example. NEAREST(3.0,2.0) is 3+2^(-22).

NEQV (L,M)

Logical Elemental. Test that logical values are unequal.

Arguments L and M must be logical (lowest bit is 1 for true).

Signals. Single signal or smaller data.
Units... None unless both have units and they don't match.
Form.... Logical of compatible shape.
Result.. True if exactly one of X and Y are true;
otherwise, false.

Example. 2>3 NEQV 3>4 is $FALSE.

NINT (A,[KIND])

F90 Numeric Elemental. Nearest integer.

Argument. Optional: KIND.
A real. Complex numbers are an error.
Integers are passed.
KIND scalar integer type number, for example, KIND(1).
(Today. Ignored, always returns LONG.)

Signals. Same as A.
Units... Same as A.
Form.... Integer.

Result.. If A>0, NINT(A) is INT(A+0.5); else it is INT(A-0.5).

Examples. NINT(2.783) is 3. NINT(-2.783) is -3.

NOR (L,M)

Logical Elemental. Negation of logical union of elements.
Usual Forms L NOR M.

Arguments L and M must be logical (lowest bit is 1 for true).

Signals. Single signal or smaller data.
Units... None unless both have units and they don't match.
Form.... Logical of compatible shape.

Result.. False if either is true; otherwise, true.

Example. [0,0,1,1] && [0,1,0,1] is [$TRUE,$FALSE,$FALSE,$FALSE].

NOR_NOT (L,M)

Logical Elemental. Negation of logical union of first with negation
of second. Logically equivalent to NOT(L) AND M.
Accepted Form. L NOR_NOT M.

Arguments L and M must be logical (lowest bit is 1 for true).

Signals. Single signal or smaller data.
Units... None unless both have units and they don't match.
Form.... Logical of compatible shape.

Result.. True if L is false and M is true; otherwise, false.

Example. [0,0,1,1] NOR_NOT [0,1,0,1] is
[$FALSE,$TRUE,$FALSE,$FALSE].

NOT (L)

Logical Elemental. Negate a logical. True is 1BU, False is 0BU.
Usual Form ! L or NOT L.
Function Form NOT(L).

Argument. L must be logical.

Signals. Same as L.
Units... Same as L.
Form.... Logical.

Result.. True if lowest bit of converted integer is off.
>>>>>>>>>WARNING, do not confuse this with the bit-wise INOT(J).
What F90 calls NOT, we call INOT.

Example. NOT([1,2,3]) is [$FALSE,$TRUE,$FALSE]).

OBJECT_OF (A)

MDS Operation. Get the object field.

Argument. Descriptor as below.

Result.. A is searched for this:
DSC$K_DTYPE_METHOD, the object field.
Otherwise, an error.

OCTAWORD (A)

Conversion Elemental. Convert to octaword (16-byte) integer.

Argument. A must be numeric.

Signals. Same as A.
Units... Same as A.
Form.... Octaword-length integer.

Result.. The truncated whole part of A.
Immediate at compilation.
>>>>>>>>>WARNING, truncation does not cause an error.

Examples. OCTAWORD(123) is 123O. OCTAWORD(65537) is 65537O.

OCTAWORD_UNSIGNED (A)

Conversion Elemental. Convert to octaword (16-byte) unsigned integer.

Argument. A must be numeric.

Signals. Same as A.
Units... Same as A.
Form.... Octaword-length unsigned integer.

Result.. The truncated whole part of A.
Immediate at compilation.
>>>>>>>>>WARNING, truncation does not cause an error.
Example. OCTAWORD_UNSIGNED(123) is 123oU.

on_error ([A])

Miscellaneous. On an error do the action A.

Argument. Optional: A.
A may be any expression. The default is to cancel previous
setting.

Result.. The result of action A.
Example. ?? if ever.

OPCODE_BUILTIN (I)

MDS Information. The string name of a builtin's opcode.

Argument. I must be an unsigned word scalar. It must be from 0 to
the number of defined opcodes less one.

Signals. Same as I.
Units... Same as I.
Form.... Character scalar of same shape.
Result.. The uppercase name for the opcode.

Example. OPCODE_BUILTIN(0) is "$".

OPCODE_STRING (I)

MDS Information. The string name of an opcode.

Argument. I must be an unsigned word scalar. It must be from 0 to
the number of defined opcodes less one.

Signals. Same as I.
Units... Same as I.
Form.... Character scalar of same shape.

Result.. The uppercase name for the opcode.

Example. OPCODE_STRING(0) is "OPC$$".

OR (L,M)

Logical Elemental. Logical union of elements.
Usual Forms L || M, L OR M.
Function Form OR(L,M).

Arguments L and M must be logical (lowest bit is 1 for true).

Signals. Single signal or smaller data.
Units... None unless both have units and they don't match.
Form.... Logical of compatible shape.

Result.. True if either is true; otherwise, false.
>>>>>>>>>WARNING, do not confuse with | which is bit-wise IOR.

Example. [0,0,1,1] || [0,1,0,1] is [$FALSE,$TRUE,$TRUE,$TRUE].

OR_NOT (L,M)

Logical Elemental. Logical union of first with negation of second.
Accepted Form. L OR_NOT M.

Arguments L and M must be logical (lowest bit is 1 for true).

Signals. Single signal or smaller data.
Units... None unless both have units and they don't match.
Form.... Logical of compatible shape.

Result.. True if L is true or M is false; otherwise, false.

Example. [0,0,1,1] OR_NOT [0,1,0,1] is [$TRUE,$FALSE,$TRUE,$TRUE].