commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <p...@steitz.com>
Subject RE: [math] API changes for RC2
Date Mon, 27 Sep 2004 18:50:23 GMT
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
	
	

Mime
View raw message