Re: [Math] Re: LU decomposition very SLOW (commons.math3.linear)

2016-10-29 Thread Gilles

Hi.

This conversation should preferably be continued on the
"dev" ML.
[CC'ing there.]

Best regards,
Gilles

On Sat, 29 Oct 2016 13:43:43 +0200, Eric Barnhill wrote:

Hi Wilbur,

That is strange that such a basic technique appears to be at odds 
with best
practices, especially when said best practice is out of numerical 
recipes,

which has such broad authority.

I think you would be welcome to push the change if you were 
interested to

and your contribution would be welcome.

Thank you also for citing the smile library. That appears to be an
extraordinarily rich Java library. It is a good example of why 
projects
need active, interested, expert maintainers; if code is not 
maintained by
such a person it is generally quickly surpassed by other code 
elsewhere.


Best,
Eric
Well, I tried the same with "Array2DRowRealMatrix" but it made no 
difference

at all.

Meanwhile I cloned the CM snapshot and checked the source code. The 
authors
of the "LUDecomposition" class state that their code "is based on the 
class
with similar name from the JAMA library" but this seems not the case! 
The
Jama implementation is quite different -- actually the same as the 
alternate
(Num. Recipes) implementation I had supplied earlier (and also runs 
at the

expected speed)!

So, whatever the reason was to abandon the JAMA version, the current 
Commons
Math implementation is certainly much inferior in terms of 
performance.

Which is astonishing given the popularity of this method.

Will ask the "dev" mailing list, as suggested ...

Thanks,
Wilhelm





--
View this message in context: http://apache-commons.680414.
n4.nabble.com/math-LU-decomposition-very-SLOW-commons-math3-linear-
tp4692255p4692283.html
Sent from the Commons - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [Math] Re: LU decomposition very SLOW (commons.math3.linear)

2016-10-29 Thread Eric Barnhill
Hi Wilbur,

That is strange that such a basic technique appears to be at odds with best
practices, especially when said best practice is out of numerical recipes,
which has such broad authority.

I think you would be welcome to push the change if you were interested to
and your contribution would be welcome.

Thank you also for citing the smile library. That appears to be an
extraordinarily rich Java library. It is a good example of why projects
need active, interested, expert maintainers; if code is not maintained by
such a person it is generally quickly surpassed by other code elsewhere.

Best,
Eric
Well, I tried the same with "Array2DRowRealMatrix" but it made no difference
at all.

Meanwhile I cloned the CM snapshot and checked the source code. The authors
of the "LUDecomposition" class state that their code "is based on the class
with similar name from the JAMA library" but this seems not the case! The
Jama implementation is quite different -- actually the same as the alternate
(Num. Recipes) implementation I had supplied earlier (and also runs at the
expected speed)!

So, whatever the reason was to abandon the JAMA version, the current Commons
Math implementation is certainly much inferior in terms of performance.
Which is astonishing given the popularity of this method.

Will ask the "dev" mailing list, as suggested ...

Thanks,
Wilhelm





--
View this message in context: http://apache-commons.680414.
n4.nabble.com/math-LU-decomposition-very-SLOW-commons-math3-linear-
tp4692255p4692283.html
Sent from the Commons - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org


Re: [Math] Re: LU decomposition very SLOW (commons.math3.linear)

2016-10-28 Thread Gilles

Hi.

On Thu, 27 Oct 2016 05:41:08 -0700 (PDT), wilbur wrote:

Hello Gilles,

thanks for your interest! I am attaching a minimal example that 
demonstrates

this behavior.
The matrix -- which I create with MatrixUtils.createRealMatrix() -- 
is dense

(of type BlockRealMatrix).


Could you please try with "Array2DRowRealMatrix" too?

The results listed at the bottom of the main class suggest, that 
execution

times for the standard LUDecomposition get out of proportion for N
somewhere between 750 and 1000.

I am also including the ‘MyLUDecomposition’ implementation provided 
by Smile
as a separate class. It is fast but I can’t say if it is numerically 
as good

as the Commons Math version.


Do you propose it as an alternative implementation to be included
in Commons Math?
[If so, this should be discussed on the "dev" mailing list.]


Hope this is conclusive.


I don't know.
First thing is to ensure the performance/accuracy trade-off, as you
suggested.


I am new to this group, not sure if the attachment
gets delivered.


No, but the link below is fine.


Appreciate any hints.


You seem to be on your way to figure out what is going on.[1] ;-)

Thanks,
Gilles

[1] For the investigation, I suggest to use a CM snapshot:
   
https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-math4/4.0-SNAPSHOT/

or work from the current development repository:
   https://git1-us-west.apache.org/repos/asf?p=commons-math.git



--Wilhelm
lu_decomp_test.zip





-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [Math] Re: LU decomposition very SLOW (commons.math3.linear)

2016-10-27 Thread wilbur
Hello Gilles,

thanks for your interest! I am attaching a minimal example that demonstrates
this behavior.
The matrix -- which I create with MatrixUtils.createRealMatrix() -- is dense
(of type BlockRealMatrix).

The results listed at the bottom of the main class suggest, that execution
times for the standard LUDecomposition get out of proportion for N 
somewhere between 750 and 1000.

I am also including the ‘MyLUDecomposition’ implementation provided by Smile
as a separate class. It is fast but I can’t say if it is numerically as good
as the Commons Math version.

Hope this is conclusive. I am new to this group, not sure if the attachment
gets delivered. 
Appreciate any hints.

--Wilhelm
lu_decomp_test.zip
  



--
View this message in context: 
http://apache-commons.680414.n4.nabble.com/math-LU-decomposition-very-SLOW-commons-math3-linear-tp4692255p4692259.html
Sent from the Commons - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org