commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kim van der Linde <...@kimvdlinde.com>
Subject Re: [math] API changes for RC2
Date Mon, 27 Sep 2004 19:08:08 GMT
I do use it at one place, but that is a piece that needs overhaul 
anyway, and after that, they are gone there also. My impression is that 
you either want a double[][] array to dealw with, or a Matrix in itself.

Kim

Phil Steitz wrote:

> Do you use the setXxx stuff anywhere or see any reason that we need to maintain it?
> 
> 	-----Original Message----- 
> 	From: Kim van der Linde [mailto:kim@kimvdlinde.com] 
> 	Sent: Mon 9/27/2004 11:21 AM 
> 	To: Jakarta Commons Developers List 
> 	Cc: 
> 	Subject: Re: [math] API changes for RC2
> 	
> 	
> 
> 
> 
> 	Phil Steitz wrote:
> 	
> 	> "Spooky" -- delightful word choice ;-)  The getDataRef  method is
> 	> there to limit copy operations and to support hacking the underlying
> 	> array -- evil, hazardous, breaks encapsulation -- altogether
> 	> "spooky"; but users may want this in some cases.
> 	
> 	I do:
> 	
> 	Matrix diffMatrix = new Matrix(cases, variables);
> 	double diffArray[][] = diffMatrix.getDataRef();
> 	double baseArray[][] = baseMatrix.getDataRef();
> 	//verbose(true, "Robust baseMatrix\n"+baseMatrix.toSquareString());
> 	for (int x = 0; x < cases; x++)
> 	{
> 	   for (int y = 0; y < variables; y++)
> 	   {
> 	     diffArray[x][y] = baseArray[x][y] - robustMeans[y];
> 	   }
> 	}
> 	//verbose(true, "Robust diffArray\n"+diffMatrix.toSquareString());
> 	robustDist = Distances.mahalanobis(diffMatrix, robustCovar);
> 	det = Math.sqrt(robustCovar.getDeterminant());
> 	
> 	Just an example.......
> 	
> 	Kim
> 	
> 	--
> 	http://www.kimvdlinde.com
> 	
> 	---------------------------------------------------------------------
> 	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

-- 
http://www.kimvdlinde.com

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


Mime
View raw message