How to find maximum in SparseDoubleMatrix2D (Java Colt library)? or even in a 1D Matrix for that matter

479 Views Asked by At

On the overview website http://acs.lbl.gov/software/colt/api/index.html it is said that via Columnwise Data Analysis the maximum value(of a column) can be found. However I searched for quite a long while and cannot find the method!

2

There are 2 best solutions below

2
On

It's cern.jet.stat.Descriptive.max(DoubleArrayList). You'll have to build such a list with new DoubleArrayList(doubleMatrix2D.viewColumn(iColumn).toArray()).

0
On

Not exactly what you want, but might help others looking for similar things:

In parallel colt, there are direct methods for finding the max and min values, together with location: methods getMaxLocation() and getMinLocation() are present in both the classes cern.colt.matrix.tdouble.DoubleMatrix1D and cern.colt.matrix.tdouble.DoubleMatrix2D