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. 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. |