help mata tostack()help mata enter()help mata swapst()help mata rotst()-------------------------------------------------------------------------------

Title

Commands to manipulate the internal stack set up by rpnfcn()

Syntax

Command nameArgument

&tostack()x

&enter()NULL

&swapst()NULL

&rotst()NULL

DescriptionThese functions are used to place matrices into the appropriate places in the stack used by

rpnfcn().&tostack()places the matrixxin a new top element of the stack.&enter()copies the current top element of the stack to a new top element in the stack.&swapst()swaps the two top elements of the stack.&rotst()rotates the stack one step down, meaning that the bottom-most element becomes the top element, while all others are shifted one step down.

RemarksThe commands

&tostack()and&enter()both copies the indicated matrix, and for very large matrices the user must thus ensure that Stata has sufficient memory to execute the command. The commands&swapst()and&rotst()on the other hand do not move or copy matrices as such, but rather rearranges their labels (the pointers in the stack) so as to create the desired effect.

Source coderpnstackfcn.mata

AuthorHenrik Støvring, Research Unit of General Practice, University of Southern Denmark. Please email hstovring@health.sdu.dk if you have comments, questions or observe any problems.

Also seeManual:

[M] Mata Reference ManualOnline: help for

[M-0] mata,Evaluation of algorithm matrix using RPN,RPN binary operators,RPN distribution functions,RPN functionsfor integration