The basic reason i inquired is that by using doubles, you're limiting the precision available when doing certain operations. Take the following matrix:
[ 4 6 ] [ 6 14 ] If you try to take the inverse of that matrix, the correct answer is: [ 0.7 -0.3 ] [ -0.3 0.2 ] however, by using double in java, we get something like: [ 0.7000000000000002 -0.3000000000000001 ] [ -0.3000000000000001 0.20000000000000007 ] using BigDecimal isntead, we might get a slightly more accurate result (though i admit, in most cases, people won't go to 16 digits) -----Original Message----- From: Al Chou [mailto:[EMAIL PROTECTED] Sent: Friday, April 09, 2004 1:13 AM To: Jakarta Commons Developers List Subject: Re: [Math] - RealMatrix --- Phil Steitz <[EMAIL PROTECTED]> wrote: > Inger, Matthew wrote: > > Has any thought been given to creating a Matrix interface > > which can handle BigInteger and/or BigDecimal? > > Yes. BigInteger would be a little funny, since Integers aren't a field ;-) > but BigDecimal might make sense, as would Complex. There are (at least) > two ways to go, which we can explore post 1.0: > > 1) Create an abstract Matrix interface with entries being abstact field > elements. See the approach in, e.g. JADE > <http://jade.dautelle.com/api/com/dautelle/math/Matrix.html>. This is > really walking down the abstract algebra framework path. > > 2) Create BigDecimalMatrix, ComplexMatrix with interfaces similar to > RealMatrix, leveraging the special properties of the field elements and > their representations. > > My inclination would be to KISS and go with 2), with practical > applications / use cases driving decisions on what gets implemented; > though I see the value of the abstract approach as well. +1 As usual, I agree that real use of the library should play a very large role in informing what we develop (though I certainly dream of being most things to most users <g>). > Unless we think that the current design of RealMatrix is overly limiting, > I would prefer to hold off on this discussion until post 1.0, though. > > Phil I completely agree. We don't have anyone clamoring for these extensions (yet)! Al __________________________________ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
