Chapter 9. Basic Matrix Operations

   

 
Java Number Cruncher: The Java Programmer's Guide to Numerical Computing
By Ronald  Mak

Table of Contents
Part  III.   A Matrix Package


Even the most basic matrix operations of addition, subtraction, and, especially , multiplication can put a strain on a computer's computational capabilities. The matrix operands do not have to be very big before they generate large numbers of individual floating-point operations. This is prime breeding ground for accumulated roundoff errors.

In this chapter, we'll begin to develop the numbercruncher.matrix package. Its classes include Matrix , SquareMatrix , IdentityMatrix , RowVector , and ColumnVector . We'll add class LinearSystem for solving systems of simultaneous linear equations in Chapter 10 and class InvertibleMatrix in Chapter 11. Figure 9-1 shows the inheritance tree for these classes. [1]

[1] We won't make the claim that this class hierarchy is the most reasonable one?ain fact, a commercial-quality matrix package would probably combine some of these classes. However, this hierarchy does break things up into more easily digestible chunks for the purposes of this book.

Figure 9-1. The inheritance tree for the classes in the matrix package.

graphics/09fig01.gif

Most of the math in this chapter is from high school algebra?awe'll simply be implementing it as Java classes. The interactive program for this chapter will demonstrate the use of the Matrix , SquareMatrix , IdentityMatrix , and RowVector classes, along with matrix multiplication, to animate an object in three-dimensional space.


   
Top
 


Java Number Cruncher. The Java Programmer's Guide to Numerical Computing
Java Number Cruncher: The Java Programmers Guide to Numerical Computing
ISBN: 0130460419
EAN: 2147483647
Year: 2001
Pages: 141
Authors: Ronald Mak

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net