I would recommend submitting a patch to the java files into bugzilla with the changes in it.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.
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 am OK with adding the additional methods above to (post 1.0) RealMatrixImpl or a MatrixUtils class.
Phil
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]