You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Inger, Matthew" <In...@Synygy.com> on 2004/05/07 00:58:18 UTC

[math] BigMatrix - BigDecimal matrix

I have completed a BigMatrix interface, and a BigMatrixImpl
to go along with it.  

BigMatrix is a matrix interface which is designed to work on
BigDecimal objects, rather than on double values.  The reason
for needing something like this is if someone wants more accuracy
than is provided by the double type.

It passes all the testcases that were developed for RealMatrixImpl.

I will be putting this as a patch shortly, but wanted to make sure
there was a call for it.

Example calls:

double d[][] = { ... };
BigDecimal bd[][] = { ... };

BigMatrix bm1 = new BigMatrix(d);
BigMatrix bm2 = new BigMatrix(bd);

BigMatrix bm3 = bm1.multiply(bm2);

BigDecimal databd[][] = bm3.getData();
double datad[][] = bm3.getDataAsDoubleArray();

BigDecimal row1bd[] = bm3.getRow(1);
double row1d[] = bm3.getRowAsDoubleArray(1);

I've tried to supply some convenient conversions where possible
to make life easier.



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [math] BigMatrix - BigDecimal matrix

Posted by Phil Steitz <ph...@steitz.com>.
Inger, Matthew wrote:
> I have completed a BigMatrix interface, and a BigMatrixImpl
> to go along with it.  
> 
> BigMatrix is a matrix interface which is designed to work on
> BigDecimal objects, rather than on double values.  The reason
> for needing something like this is if someone wants more accuracy
> than is provided by the double type.
> 
> It passes all the testcases that were developed for RealMatrixImpl.
> 
> I will be putting this as a patch shortly, but wanted to make sure
> there was a call for it.
> 
> Example calls:
> 
> double d[][] = { ... };
> BigDecimal bd[][] = { ... };
> 
> BigMatrix bm1 = new BigMatrix(d);
> BigMatrix bm2 = new BigMatrix(bd);
> 
> BigMatrix bm3 = bm1.multiply(bm2);
> 
> BigDecimal databd[][] = bm3.getData();
> double datad[][] = bm3.getDataAsDoubleArray();
> 
> BigDecimal row1bd[] = bm3.getRow(1);
> double row1d[] = bm3.getRowAsDoubleArray(1);
> 
> I've tried to supply some convenient conversions where possible
> to make life easier.
> 
> 
Sorry for the response latency.  This looks reasonable to me. I am +0 for 
adding this to 1.0 (increasing to +1 for 1.1) assuming others are 
comfortable with code, tests and API.

Phil
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org