forum.alglib.net
http://forum.alglib.net/

First use of ALGLIB
http://forum.alglib.net/viewtopic.php?f=2&t=43
Page 1 of 1

Author:  rubenvb [ Tue Jul 27, 2010 12:14 pm ]
Post subject:  First use of ALGLIB

Hi,

I have just now switched to ALGLIB from GSL for my special math function needs.

Why? Your ellipticintegralk == Wolfram's EllipticK >> GSL's gsl_sf_ellint_Kcomp
GSL cannot handle a negative argument (it takes the sqrt of what yours and Wolfram's take, which is a bad design decision IMHO).

One thing though: I'm using mingw-w64 (64-bit gcc on windows) and had to remove all #include <stdafx.h>
These shouldn't even be there IMHO, and are bad cross-platformability. There's no hurt in removing them I believe, except making the code more standard.

I only needed 9 files from ALGLIB, and only 4 source files had that include.

ALGLIB works great though!

Author:  rubenvb [ Wed Jul 28, 2010 9:24 am ]
Post subject:  Re: First use of ALGLIB

Rewind that last sentence of my first post...

The ALGLIB (c++) function ellipticintegralk does not work properly:

Wolfram Alpha
EllipticK(-96)=0.3737
ALGLIB
ellipticintegralk(-96.)=-1.5E15

What is wrong and how can it be fixed?

Thanks!

Author:  Sergey.Bochkanov [ Wed Jul 28, 2010 8:18 pm ]
Post subject:  Re: First use of ALGLIB

Regarding integral. ALGLIB uses high-quality implementation of elliptic integrals from Cephes, but this implementation is restricted to m's within [0,1]. There is remark about it in the subroutine comments, although it may be not clear enough. However, you can use reduction formula from Abramowitz and Stegun (17.4.15, 17.4.17) to reduce m to [0,1].

About stdafx.h - it is required by MSVC, without it compilation will require additional tuning of compiler parameters. There is an empty file in the /src directory which can be used. So I think that this is not very serious problem.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/