373 mS
20
20
117 mS
10
0
50.5 mS
5
5
538 mS
200
3
685 mS
3
200
355 mS
1
200
438 mS
4
100
191 mS
1
100
66.9 mS
4
10
42.0 mS
1
10
Execution time
per call
Number of columns
nc
Number of rows
nr
The overhead is about 0.7 seconds for the largest tested matrix. This may not be critical for single
function calls, but it is significant if the function is called repeatedly, as is the case when using the
numeric solver, performing numeric integration, or plotting the function. For example, if the 200 x 3
matrix is passed to a function which is plotted at each of the 240 display pixel columns of the TI-92
Plus, the overhead is about 2.7 minutes.
If more than one matrix is used as a function argument, the overhead predictably increases to about
the sum of the individual overheads of each matrix. For example, if the arguments are two matrices
with dimensions of 50 rows x 2 columns, and 50 rows x 3 columns, the total overhead is about 149 mS
+ 191 mS = 340 mS.
The overhead may be reduced by passing the matrix by reference, instead of by value. For the timing
results and model equation above, the matrix was passed by value, that is, the matrix itself was passed
as the function argument. A typical function call is
f(matrix)
(call by value)
To pass the matrix by reference instead of value, the function argument is the matrix name as a string:
f("mat_name")
(call by reference)
With the value method, the element [2,3] is accessed with
mat[2,3]
(access by value)
With the reference method, the same element is accessed using indirection:
#mat_name[2,3]
(access by reference)
where mat_name is the name of the matrix. Indirection, a feature built into TI Basic, is accomplished
when the number character '#' precedes a variable name, for example, #var. This expression does not
return the value of var, instead, it returns the value of the variable whose name is stored as a string in
var. For example, if var contains the string "var2", and the value of variable var2 is 7, then #var returns
7.
The reference method works only when the matrix is a global variable. A variable which is local in a
program or function cannot be accessed by any other function which is called.
These two test routines demonstrate the overhead reduction when using the reference method.
7 - 46
Summary of Contents for TI-92+
Page 52: ...Component side of PCB GraphLink I O connector detail 1 41...
Page 53: ...LCD connector detail PCB switch side 1 42...
Page 54: ...Key pad sheet contact side Key pad sheet key side 1 43...
Page 55: ...Key cap detail 1 44...
Page 57: ...Component side of PCB with shield removed A detail view of the intergrated circuits 1 46...
Page 410: ...void extensionroutine2 void Credit to Bhuvanesh Bhatt 10 4...