forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 8:52 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: First use of ALGLIB
PostPosted: Tue Jul 27, 2010 12:14 pm 
Offline

Joined: Tue Jul 27, 2010 12:09 pm
Posts: 2
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!


Top
 Profile  
 
 Post subject: Re: First use of ALGLIB
PostPosted: Wed Jul 28, 2010 9:24 am 
Offline

Joined: Tue Jul 27, 2010 12:09 pm
Posts: 2
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!


Top
 Profile  
 
 Post subject: Re: First use of ALGLIB
PostPosted: Wed Jul 28, 2010 8:18 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 43 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group