674
Appendix A: System Routines — Lists and Matrices
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
is_matrix
Declaration:
Boolean
is_matrix
(EStackIndex
i
)
Category(ies):
Lists and Matrices
Description:
Determines whether the expression indexed by
i
is a matrix.
Inputs:
i
— Index of the top tag of an internally-simplified expression.
Outputs:
Returns TRUE if the expression indexed by
i
is a matrix. Otherwise returns
FALSE.
Assumptions:
None
Side Effects:
None
Availability:
On AMS 1.05 and higher.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: is_square_matrix
Example:
void push_colnorm (EStackIndex matrix_idx)
/* Pushes the largest of the sums of the absolute values of the
elements in each column of the matrix indexed by matrix_idx.
*/
{ Access_AMS_Global_Variables;
EStackIndex i, j, old_top = top_estack;
if (is_matrix (matrix_idx))
{ if (! can_be_approxed (matrix_idx, TRUE))
ER_THROW (ER_DOMAIN);
i = matrix_idx - 1u;
push0 ();
while (END_TAG != ESTACK (i))
{ j = top_estack;
push_abs (i);
replace_top2_with_sum (j);
i = next_expression_index (i);
}
j = top_estack;
push_max1 (j);
delete_between (old_top, j);
}
else ER_throw( ER_DATATYPE );
}