Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors


Manual Reference Pages  - mtx_dim (5)

NAME

mtx/dim - Return array dimensions in two lists

CONTENTS

Synopsis
Description
Error Handling
Examples
See Also
Author

SYNOPSIS

mtx/dim write, ![matrix] <, write, ![matrix] ... >

DESCRIPTION

Returns dimensions and base dimensions of one or more matrix arrays in two separate list sequences. The arguments are grouped into pairs of write and read.

The write argument may be a single target register or a list sequence containing two target registers. If a register other than NULL is provided in the first target position, then a list sequence is created describing the size of each dimension in the given matrix array. If a register other than NULL is provided in the second target position, then a list sequence is created describing the base of each dimension in the given matrix array.

Dimension sizes and bases in the returned list sequences are stored as a raw index (32-bit unsigned integer) if possible. If the number cannot be represented in this form, it will be stored as an encoded psInteger value (PSUNIT_TYPE_XVALUE). If a deterministic type is required for this data, use the mtx/size and mtx/bsize instructions instead of mtx/dim. See mtx_size(5) and mtx_bsize(5).

If the matrix array has zero size, then both target registers will contain PSUNIT_TYPE_NULL. If no base dimensions were configured explicitly by the mtx/def instruction used to initialise the matrix array, then the second target register will contain PSUNIT_TYPE_NULL. This implies the base dimensions are at their default setting of 0.

ERROR HANDLING

A runtime error is generated if an argument is of the wrong type, or if a referenced object does not exist in the nexus or does not point to a matrix array.

EXAMPLES

The following demonstrates using the mtx/dim instruction to create a new matrix array that has the same number and size of dimensions as an existing array:

.copydim  
% Copy dimensions from array in P0
mtx/dim @[P1, P2], P0

% Copy matrix type into P3 attr/copy P3, P0, [psMatrixType]
% Create a new array with the same type and dimensions mtx/local P0, P3, [new_array], P1, P2
% Dump resulting object obj/dump P0
% Clean up reg/clr P1, P2, P3

SEE ALSO

pal_commands(5), pal_registers(5), pal_indices(5), ps_attributes(5), mtx_def(5), mtx_size(5), mtx_bsize(5),
PROSE Assembly Language at prose.sourceforge.net.

AUTHOR

Copyright (c) 2002-2011 Mark R. Bannister <cambridge@users.sourceforge.net>.

This is free software and can be downloaded from prose.sourceforge.net; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


PAL 1.0 mtx_dim (5) 18 October 2011
Generated by manServer 1.07 from man5/mtx_dim.5 using man macros.