User`s guide
5 Sample Applications (Java)
(4,3) -0.6831
(1,4) 0.1826
(2,4) 0.3651
(3,4) 0.5477
(4,4) 0.7303
R matrix:
(1,1) 2.2361
(1,2) -1.7889
(2,2) 1.6733
(1,3) 0.4472
(2,3) -1.9124
(3,3) 1.4639
(2,4) 0.5976
(3,4) -1.9518
(4,4) 0.9129
Understanding the getfactor Program
The getfactor program takes one or two arguments from standard input.
The first argu m ent is converted to the integer order of the test matrix. If the
string
sparse is passed as the second argument, a sparse m atrix is cre ated
to contain the test array. The Cholesky, LU, and QR factorizations are then
computed and the results a re displayed to standard output.
The main method has three parts:
• The first part sets up the input matrix, creates a new factor object, and calls
the
cholesky, ludecomp,andqrdecomp methods. This part is executed
inside of a
try block. This is done so that if an exception occurs during
execution, the corresponding
catch block will be executed.
• The second part is the
catch block. The code prints a message to standard
output to let the user know about the error that has occurred.
• The third part is a
finally block to manually clean up native resources
before exiting.
5-26