Results 1 to 14 of 14

Thread: Programmers wanted to test a numerical library

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    8
    Good bye.
    Last edited by ksmateer; Feb 9th, 2023 at 02:50 AM.

  2. #2
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: Programmers wanted to test a numerical library

    Is it an open source?

  3. #3
    Frenzied Member VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    1,323

    Re: Programmers wanted to test a numerical library

    This VBCorLib project also has a BigInteger implementation: https://github.com/kellyethridge/VBCorLib

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    8

    Re: Programmers wanted to test a numerical library

    I'd like to make it open source eventually.

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    8

    Re: Programmers wanted to test a numerical library

    My library comes with BigInt, BigDec and BigCom object data types.

  6. #6
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: Programmers wanted to test a numerical library

    What is BicCom??

    I would like to insert BigInt...to my M2000 Interpreter. I didn't like the VBCorLib library. For my interpreter I like to have objects, not UDT. In VBCorLibm, there is a public UDT:
    Code:
    Public Type BigNumber
        Digits()    As Integer
        Precision   As Long
        Sign        As Long
    End Type
    My expression evaluator works with pure types (boolean, integer, long, long long, single, double, currency, decimal), and with objects (user objects can define operators). So the expression evaluator can be expanded if there is an object which have all the functions on it (including function as operators).

  7. #7

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    8

    Re: Programmers wanted to test a numerical library

    Hello georgecar. I am deleting this post and moving it to a more
    appropriate forum that Elroy mentioned.

    But to answer your question quickly, my library is completely object
    oriented using COM architecture. BigCom is an object data type that
    contains complex numbers (in the form a + bi where a nd b are real
    values and i denoted the imaginary unit.)

    From the code snippet you presented it seems you might be interested
    in BigDec, an object data type for real values (up to 10,000 digits).

  8. #8

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    8

    Programmers wanted to beta test a numerical library

    Hello, I'm looking for some programmers to beta test a numerical library, written as an ActiveX dll in VB 6 pro. The library provides all elementary functions for integer, floating point and complex arithmetics. Values can be calculated up to 10,000 digits though methods are optimized for 100 digits, hence the name Big Goo Numerical
    Library. (Goo is for googol.)

    It comes complete with a help file and a simple demo program. The library will be free to use and distribute. As for open source, I'm considering it but the intention is for mathematicians primarily.

    If anyone is interested let me know and I'll send you a copy.

  9. #9
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: Programmers wanted to beta test a numerical library

    Can you post the help file? It might drum up some interest if the documentation looks interesting.

  10. #10

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    8

    Re: Programmers wanted to beta test a numerical library

    That's a good idea. The help file is an HTML file. Is there a place where I can upload it so that users can download it?

    If not then I can always email it to you.

  11. #11
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: Programmers wanted to test a numerical library

    This is my complex object, is small. Written in M2000 Interpreter which run on a VB6 application.

    User objects are something more than an object. They are objects in the background, but it is a layer above it, where interpreter take charge of what these objects do. One thing is that they have objects inside. Properties are objects (group type) which are parts of groups.

    Here the program make two type of complex numbers, single and double. Both of them are class type Complex.
    Not only we make complex numbers but also arrays (one dimension). This Idea (the program written for version 11) give me the magic I need to create the Version 12.

    So I show you this code to see the "interface". Please you can show some sample of the usage of the proposal library.



    PHP Code:
    Class Complex {
    Private:
        
    klim=0
        
    Function copy {
            =
    group(this)
        }
    Public:
        
    Property Ptr {
            
    value {link parent k to kvalue=k(0)}
        }
        
    Property Ubound {
            
    value {link parent lim to limvalue=lim}    
        }
        Final 
    Lbound=0&
        
    // we use clear to clear value variable which property define as double by default
        // using Property a { }=0& we can define the value as long
        // but here we use Real for two different buffers, one with type double and one with type single
        
    Property Real {
            
    value {clear:link parent k to kvalue=eval(k,0)}
        }
        
    Group Real {
            
    operator "++" {
                
    link parent k to k: Return k0:=eval(k0)+1
            
    }
        }
        
    Property Imaginary {
            
    value {clear:link parent k to k:    value=eval(k,1)}
        }
        
    Group Imaginary {
            
    operator "++" {
                
    link parent k to k: Return k1:=eval(k1)+1
            
    }
        }
        
    Property toString$ {
             
    value {
                 
    Link parent klim to klim
                 read 
    where=0&
                 if 
    where<or where>lim then error "Index out of bound"
                 
    where*=2
                m
    =eval(k,where+1)
                if 
    m==0 then
                     value
    $=format$("({0})",eval(kwhere))
                else.if eval(
    k,0)==0 then
                    u
    $="({1}i)"
                    
    value$=format$("({0}i)",eval(k,where1))
                else
                    if 
    abs(m)==1 then u$="({0}{2}i)" else u$="({0}{2}{1}i)"
                    
    value$=format$(u$,eval(kwhere),abs(m), IF$(m<0->"-","+"))
                
    end if
            }
        }
        Function 
    Export$() {
            =eval$(.
    k)
        }
        
    Module Import (This$) {
            
    m=len(This$)*2
            
    if m>and m<=len(.kthen
                
    Return .k0:=This$
            
    end if
        }
        
    Module SwapBuffers (&as Complex){
            if .
    len<> a.len then  Error "Not compatible buffers"
            
    swap .ka.k
            swap 
    .lima.lim
            
        
    }
    Class:
        
    Module Complex {
            
    Error "Can't define objects"
        
    }
    }
    Class 
    DoubleComplex as Complex {
    Private:
        
    len=16
        
    Function newDoubleComplex(as DoubleComplexw) {
            
    buffer z as double*2
            
    return z0:=eval$(.kw*.len!, .len)
            
    let a.k=za.lim=0  // k is Private in a
            
    =group(a
        }
        Function 
    copyme(as DoubleComplex) {
            
    buffer z as double*2*(a.lim+1)
            return 
    z0:=eval$(.k)
            
    let a.k=z
            
    =group(a
        }
    Public:
        
    Operator "+"  {
            
    read a as Complex
            let this
    =.newFloatComplex(this0)
            return .
    k0:=eval(.k,0)+a.real1:=eval(.k1)+a.imaginary
        
    }
        
    Operator "-"  {
            
    read a as Complex
            let this
    =.newFloatComplex(this0)
            return .
    k0:=eval(.k,0)-a.real1:=eval(.k1)-a.imaginary
        
    }
        
    Set () {
            
    read a as Complex
            read 
    where=0&
            if 
    where<or where>.lim then error "Index out of bound" else  where*=2
            
    if a is type FloatComplex then
                
    return .kwhere:=a.realwhere+1:=a.imaginary
            
    else.if a is type DoubleComplex then
                
    return .kwhere:=eval$(a.k)
            else
                
    error "can't assign this group"
            
    end if
        }
        
    Module Redim (many as long) {
            if 
    many<1 then error "Wrong Dimension"
            
    buffer clear .as double*2*many: .lim<=many-1
        
    }
        
    Module RedimPreserve (many as long) {
            if 
    many<1 then error "Wrong Dimension"
            
    buffer .as double*2*many: .lim<=many-1
        
    }
        Function final 
    copy {
            =.
    copyme(this)
        }
        
    value () {
            
    read where=0&
            if 
    where<or where>.lim then error "Index out of bound"
             
             
    if where=and .lim=0 then
                 
    =this
             
    else
                  =.
    newDoubleComplex(thiswhere)
              
    end if
        }
    Class:
        
    Module DoubleComplex (as double=0as double=0many=1&) {
            if 
    many<1 then error "Wrong Dimension"
            
    buffer clear .as double*2*many: .lim<=many-1
            
    return .k0:=r1:=i    
        
    }
    }
    Class 
    FloatComplex as Complex{
    Private:
        
    len=8
        
    Function newFloatComplex(as FloatComplexw) {
            
    buffer z as single*2
            
    return z0:=eval$(.kw*.len!, .len)
            
    let a.k=za.lim=0
            
    =group(a
        }
        Function 
    copyme(as FloatComplex) {
            
    buffer z as single*2*(a.lim+1)
            return 
    z0:=eval$(.k)
            
    let a.k=z
            
    =group(a
        }
    Public:
        
    Operator "+"  {
            
    read a as Complex
            let this
    =.newFloatComplex(this0)
            return .
    k0:=eval(.k,0)+a.real1:=eval(.k1)+a.imaginary
        
    }
        
    Operator "-"  {
            
    read a as Complex
            let this
    =.newFloatComplex(this0)
            return .
    k0:=eval(.k,0)-a.real1:=eval(.k1)-a.imaginary
        
    }
        
    Set  () {
            
    read a as Complex
            read 
    where=0&
            if 
    where<or where>.lim then error "Index out of bound" else  where*=2
            
    if a  is type DoubleComplex then
                
    return .kwhere:=a.realwhere+1:=a.imaginary
            
    else.if a is type FloatComplex then
                
    return .kwhere:=eval$(a.k)
            else
                
    error "can't assign this group"
            
    end if
        }
        
    Module Redim (many as long) {
            if 
    many<1 then error "Wrong Dimension"
            
    buffer clear .as single*2*many: .lim<=many-1
        
    }
        
    Module RedimPreserve (many as long) {
            if 
    many<1 then error "Wrong Dimension"
            
    buffer .as single*2*many: .lim<=many-1
        
    }
        Function final 
    copy {
            =.
    copyme(this)
        }
        
    value (){
            
    read where=0&
            if 
    where<or where>.lim then error "Index out of bound"
            
    if where=and .lim=0 then
                
    =this
            
    else
                =.
    newFloatComplex(thiswhere)
            
    end if
        }
    Class:
        
    Module FloatComplex (as single=0as single=0many=1&) {
            if 
    many<1 then error "Wrong Dimension"
            
    buffer clear .as single*2*many: .lim<=many-1
            
    return .k0:=r1:=i
        
    }
    }
    def typename$(x)=type$(x
    z1=FloatComplex(2,2) : print z1.toString$="(2+2i)"
    z2=DoubleComplex(-2,3) :print  z2.toString$="(-2+3i)"
    print typename$(z2.real)="Double"
    z5=FloatComplex(10,-5) : print z5.toString$="(10-5i)"
    print typename$(z5.real)="Single"
    z5=FloatComplex(10) :print z5.toString$="(10)"
    z6=DoubleComplex() : print z6.toString$="(0)"
    z6=z5 :print z6.toString$="(10)"
    print z5 is type FloatComplex true
    print z6 is type DoubleComplex true
    z2
    .imaginary++
    z2.imaginary++
    print  
    z2.toString$="(-2+5i)"
    z5=z2
    print typename$(z5.real)="Single"
    print z5 is type FloatComplex true
    z5
    .real++
    print 
    z5.toString$="(-1+5i)"
    zArray=FloatComplex(1,1,10)
    zArray(4)=FloatComplex(30,-5)
    zArray(5)=FloatComplex(3,-75)
    zArray(7)=zArray(4)
    for 
    i=zArray.Lbound to zArray.Ubound
        
    print  izArray.toString$(i)
    next
    z5
    =zArray(4)
    print 
    z5.toString$="(30-5i)"
    print zArray(4).toString$ = zArray.toString$(4)
    print  
    z5.toString$="(30-5i)"
    zk=z5+zArray+FloatComplex(5100)
    print 
    zArray(4).toString$="(30-5i)"
    print zk.tostring$()="(36+96i)"
    zk=zArray
    // print zk.ubound, zk.ptr, zArray.ptr, zArray.Ubound
    zA=zArray.Copy()  // copy 10 items
    zArray(5)=FloatComplex(34)
    print 
    zArray(5).toString$="(3+4i)"
    print za(5).toString$="(3-75i)"
    za(7)=zArray(5)+za(5)
    print 
    za(7).toString$="(6-71i)"
    za(7)=za(7)-za(5)
    print 
    za(7).toString$="(3+4i)"
    za(7)=za(7)-zArray(5)
    print 
    za(7).toString$="(0)"
    z5.import z1.export$()
    print 
    z5.tostring$="(2+2i)"
    zArray.import za.export$()
    print 
    zArray.toString$(7)="(0)"
    print zArray.ptr<>za.ptr
    print zArray.Ubound=9,  z5.Ubound=0
    zArray
    .SwapBuffers &z5   // swap data only
    print zArray.Ubound=0z5.Ubound=9z5(5).toString$="(3-75i)" 

  12. #12

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    8

    Re: Programmers wanted to test a numerical library

    georgekar, here's an example of using the Big Goo Numerical Library to make complex calculations:

    The 4th root of -2 is a complex number. To find it use the following code:

    Dim Z As New BigCom

    Z = Nrt(-2, 4)

    Debug.Print Z

    The result for Z will be

    0.84089641525371454303112547623321489504003426235678 +0.84089641525371454303112547623321489504003426235676i

    The default precision for the library is 50 digits (after the decimal point). To yield values in the range of a Double data type you can set the BigGooPrecision environment variable or the Precision property of the BigCom object. i.e., Z.Precision = 14 will yield values in the range of a Double data type (14 digits after the decimal point).

    To find the inverse use the Pwr method:

    Debug.Print Pwr(Z, 4)

    The result will yield -2

    When I get my website completed you will be able to download it from there. As for now I can send you a demonstration or just the help file for your perusal.
    Last edited by ksmateer; Feb 1st, 2023 at 12:17 AM.

  13. #13
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: Programmers wanted to beta test a numerical library

    Quote Originally Posted by ksmateer View Post
    That's a good idea. The help file is an HTML file. Is there a place where I can upload it so that users can download it?

    If not then I can always email it to you.
    You can ZIP it and post it as an attachment here.

  14. #14

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    8

    Re: Programmers wanted to test a numerical library

    I uploaded my help file but when I click on the link to unzip and view it only the left pane containing the table of contents displays; there's no text on the right. Has this problem been reported before?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width