Texas Instruments TI89 Developer Guide - Page 755
mat_idx, row_index1, push_rowswap
![]() |
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 755 highlights
Appendix A: System Routines - Lists and Matrices 713 push_rowswap Declaration: void push_rowswap (EStackIndex mat_idx, EStackIndex row_index1, EStackIndex row_index2) Category(ies): Lists and Matrices Description: Pushes onto the estack a matrix with two rows swapped. Inputs: mat_idx - Index of the input matrix. row_index1 - Index of one of the rows to swap. row_index2 - Index of the other row to swap. 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: None Example: This code fragment swaps two rows in a matrix on the estack (indexed by mat_idx) if piv_row is not equal to cur_row. The old matrix is removed from the estack and mat_idx is set to point to the newly created matrix. EStackIndex piv_row_idx, cur_row_idx, mat_idx, old_mat_idx; unsigned short piv_row, cur_row; . . . /* assume mat_idx, piv_row, and cur_row already set */ if (piv_row != cur_row) { old_mat_idx = mat_idx; push_ulong_to_integer ((unsigned long)piv_row); piv_row_idx = top_estack; push_ulong_to_integer ((unsigned long)cur_row); cur_row_idx = top_estack; /* Swap rows so current row is pivot row. */ push_rowswap (mat_idx, piv_row_idx, cur_row_idx); delete_between (old_mat_idx, cur_row_idx); delete_expression (mat_idx); mat_idx = top_estack; } . . . TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001
![](/manual_guide/products/texas-instruments-ti89-developer-guide-95b636f/755.png)