forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 11:13 pm

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: ALGLIB port for AutoIt
PostPosted: Wed Aug 27, 2014 8:31 am 
Offline

Joined: Wed Aug 27, 2014 7:52 am
Posts: 2
Hi, Sergey!

You wrote in FAQ:
X-generator is another tool developed exclusively for ALGLIB. It is a generator of wrappers for the C/C# computational cores. This generator is heavily used by Python and VB.NET releases of ALGLIB. It is also used to generate doctests - code snippets, which are used as both examples (doc) and test suite (tests).

Both technologies are kept private, but result we've got with these tools - ALGLIB - is freely available under GPL.


Recently I've manually rewritten function ExponentialIntegralEN from ALGLIB (alglib-2.6.0.vb6.zip) into AutoIt. It works fine. Thanks.

Image
About AutoIt scripting language read here, please:www.autoitscript.com
AutoIt v3 is a freeware BASIC-like scripting language.


Would you like to expand the X-generator for AutoIt (v3) code creation?

Cheers,
Valery

Code:
;===========================================
; E1 <= E_n-Function for n = 1
; http://mathworld.wolfram.com/En-Function.html
; It defined as special case of the exponential integral Ei(x)
; E1(x) = -Ei(-x)
; Rewritten from ExponentialIntegralEN (ALGLIB)
Func E1($x)
Local $Result, $r, $t
Local $yk, $xk, $pk, $pkm1, $pkm2, $qk, $qkm1, $qkm2
Local $psi = 0, $z, $i, $k, $big, $EUL
Local Const $MachineEpsilon = 1.11e-16

    $EUL = 0.57721566490153286060
    $big = 1.44115188075855872e17
    If $x<0 Or $x>170 Or $x=0 then return -1

    If $x<=1 then
        $psi = -$EUL-Log($x)
        $z = -$x
        $xk = 0
        $yk = 1
        $pk = 0
        $Result = 0.0
        Do
         $xk += 1
         $yk *= $z/$xk
         $pk += 1
         If $pk<>0 then $Result += $yk/$pk
         If $Result<>0 then
          $t = Abs($yk/$Result)
         Else
          $t = 1
         EndIf
        Until $t<$MachineEpsilon

        $t = 1
        $Result = $psi*$t-$Result
        return $Result
    Else
        $k = 1
        $pkm2 = 1
        $qkm2 = $x
        $pkm1 = 1.0
        $qkm1 = $x+1
        $Result = $pkm1/$qkm1
        Do
            $k += 1
            If Mod($k,2)=1 then
              $yk = 1
              $xk = 1+($k-1)/2
            Else
              $yk = $x
              $xk = $k/2
            Endif
            $pk = $pkm1*$yk+$pkm2*$xk
            $qk = $qkm1*$yk+$qkm2*$xk
            If $qk<>0 then
                $r = $pk/$qk
                $t = Abs(($Result-$r)/$r)
                $Result = $r
            Else
                $t = 1
            EndIf
            $pkm2 = $pkm1
            $pkm1 = $pk
            $qkm2 = $qkm1
            $qkm1 = $qk
            If Abs($pk) > $big then
                $pkm2 /= $big
                $pkm1 /= $big
                $qkm2 /= $big
                $qkm1 /= $big
            EndIf
        Until $t<$MachineEpsilon
        $Result *= exp(-$x)
    EndIf
    return $Result
EndFunc


Top
 Profile  
 
 Post subject: Re: ALGLIB port for AutoIt
PostPosted: Fri Aug 29, 2014 7:22 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Hello!

Because AutoIt is a scripting language, I don't think that there will be large demand for scientific functionality. From the other side, having one more supported language adds significant amount of work if we want to change something fundamental in the ALGLIB. So, I think that ALGLIB for AutoIt is not really needed.


Top
 Profile  
 
 Post subject: Re: ALGLIB port for AutoIt
PostPosted: Fri Aug 29, 2014 7:50 am 
Offline

Joined: Wed Aug 27, 2014 7:52 am
Posts: 2
> So, I think that ALGLIB for AutoIt is not really needed.
Maybe you are right, maybe... In any case I have hands and head to rewrite any software for my needs. Thank you for kindly tip.


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 33 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group