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] Matrix indices
Date Sat, 28 Aug 2004 03:39:46 GMT
Mark R. Diggory wrote:
> I would recommend submitting a patch to the java files into bugzilla 
> with the changes in it.
> 
> Review the contributing documentation on the developers page:
> http://jakarta.apache.org/commons/math/developers.html
> 
> Post any questions you may have about contributing a patch.
> 
> Cheers,
> -Mark
> 
> Kim van der Linde wrote:
> 
>>
>>
>> Mark R. Diggory wrote:
>>
>>> I agree entirely with your argument. I would feel more comfortable 
>>> with 0 to n-1.
>>
>>
>>
>> Ok, how do I update the inproved class, as I did that already 
>> yesterday evening. I would also like to add several new methods:
>>
>> RealMatrix getSubMatrix (int startRow, int endRow, int startColumn, 
>> int endColumn)  throws MatrixIndexException;
>>
>> RealMatrix getSubMatrix (int[] rows, int[] columns)  throws 
>> MatrixIndexException;
>>
>> RealMatrix getSubMatrix (int startRow, int endRow, int[] columns) 
>> throws MatrixIndexException;
>>
>> RealMatrix getSubMatrix (int[] rows, int startColumn, int endColumn) 
>> throws MatrixIndexException;
>>
>> RealMatrix getRowMatrix(int row) throws MatrixIndexException;
>>
>> RealMatrix getColumnMatrix(int col) throws MatrixIndexException;
>>
>> double[] columnMeans();
>>
>> double[] rowMeans();
>>
>> getRowMatrix and getColumnMatrix could be excluded as they are special 
>> cases of the getSubMatrix methods.
>>
>> Objections against these?
>>
>> Cheers,
>>
>> Kim
>>
> 
> 
I need to understand better exactly what the problem is with the indexing. 
  I don't see anything wrong with the current implementation.  The element 
accessor methods use standard matrix notation, which starts with index = 1 
in each case.  The methods that provide access to copies of the underlying 
double[][] arrays are for efficiency and return arrays which are correctly 
sized to hold the matrix data.  I would be -1 to changing the matrix 
accessor methods (getEntry, setEntry, getRow, getColumn) to be "0-based" 
as this conflicts with standard mathematical notation.

I am OK with adding the additional methods above to (post 1.0) 
RealMatrixImpl or a MatrixUtils class.

Phil

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