Appendix A: System Routines — Lists and Matrices
695
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
push_mat_to_list
Declaration:
void
push_mat_to_list
(EStackIndex
mat_idx
)
Category(ies):
Lists and Matrices
Description:
Convert the matrix indexed by
mat_idx
to a list and push the result on the
estack.
Inputs:
mat_idx
— Indexes the input matrix.
Outputs:
None
Assumptions:
None
Side Effects:
May expand expression stack, cause heap compression, or throw an error.
Availability:
On AMS 2.00 and higher.
TI-89 / TI-92 Plus
Differences:
None
See Also: push_list_to_mat
Example:
This example code segment takes a list indexed by list_index. If list_index
indexes a row or column matrix, then
push_mat_to_list
is used to create a
list. In this way, the code that follows can operate on a list or a vector (row
or column matrix).
EStackIndex list_index;
unsigned short nrows, ncols;
.
.
.
if (LIST_TAG != ESTACK(list_index))
ER_throw( ER_DATATYPE );
nrows = ncols = 0;
if (ESTACK(list_index - 1u) == LIST_TAG) {
/* input is a matrix/vector */
nrows = remaining_element_count (list_index - 1u);
ncols = remaining_element_count (list_index - 2u);
/* see if it is a vector */
if ( (1 == nrows) || (1 == ncols) ) {
push_mat_to_list (list_index);
list_index = top_estack;
} else
ER_throw( ER_DATATYPE );
}
.
.
.