[#144] Another implementation of Bignum — "Dmitry Antipov" <dmitry.antipov@...>
Hello Ruby hackers,
15 messages
2002/06/06
[#151] Re: Another implementation of Bignum [tarball attached]
— "Dmitry Antipov" <dmitry.antipov@...>
2002/06/07
Hello again,
[#152] Re: Another implementation of Bignum [tarball attached]
— matz@... (Yukihiro Matsumoto)
2002/06/07
Hi,
[#174] Improving Ruby's garbage collector for interactive apps — Matthew Bloch <mattbee@...>
re: this problem I had a few weeks back:
8 messages
2002/06/19
[#177] Re: Improving Ruby's garbage collector for interactive apps
— matz@... (Yukihiro Matsumoto)
2002/06/20
Hi,
[#178] Re: Improving Ruby's garbage collector for interactive apps
— Matthew Bloch <mattbee@...>
2002/06/21
On Thursday 20 June 2002 18:54, you wrote:
[#186] Steps to get multiple interpreters per process... — Sean Chittenden <sean@...>
Can someone chart out what would need to happen to get multiple ruby
10 messages
2002/06/24
[#187] Re: Steps to get multiple interpreters per process...
— matz@... (Yukihiro Matsumoto)
2002/06/25
Hi,
[#188] Re: Steps to get multiple interpreters per process...
— Sean Chittenden <sean@...>
2002/06/25
> |Can someone chart out what would need to happen to get multiple
[#191] Re: Steps to get multiple interpreters per process...
— Chris Ross <chris@...>
2002/06/25
RE: Another implementation of Bignum [tarball attached]
From:
"Christoph" <chr_news@...>
Date:
2002-06-09 00:28:53 UTC
List:
ruby-core #162
> From: 底蓿韆タ炅韵魵 [mailto:dmitry.antipov@mail.ru]
...
> I'm finished merging my Bignums with 1.7.2 shapshot dated
> 2002-06-04. All issues listed in README within my previous tarball are
> fixed
Thanks!
One comment, did you consider implementing the shift methods with the
mpn methods mpn_rshift and mpn_lshift?
> (except for round-up differences).
...
> I'm thinking about 4 new number theoretic functions (`Integer' means
> `Fixnum or Bignum'):
>
> - Integer.gcd(Integer) -> Integer
> Return a greatest common divisor
What about the ``extended'' gcd (mpz_gcdext), which is
probably more useful the gcd itself - lets say
Integer#gcd_ext(other_int) -> [gcd,m,n] such that
self*m + other_int*n = gcd (of self and other_int)
>
> - Integer.lcm(Integer) -> Integer
> Return a least common multiple
>
> - Integer.prime? -> true or false
> Return true if Integer is prime, false otherwise
>
> - Integer.factorize -> array of factors with exponents
> For example:
> 17.factorize -> [17] (17 is prime)
> 36.factorize -> [[2, 2], [3, 2]] (36 = 2^2 * 3^2)
> 645645654.factorize -> [2, [3, 5], 137, 9697]
> (645645654 = 2 * 3^5 * 137 * 9697)
>
> These are a common tasks for numerical algorithms and appropriate
> functions
> (IMHO) will be quite useful. The impelementation for Fixnum is not
> hard, but it's a serious task to implement fast `prime?' and
> `factorize' for Bignums.
>
> Any ideas ?
You surely are aware the gmp has a probabilistic primality test. Anyway,
what about using a free implementation based on
Lenstra's elliptic curve Method - see
http://www.loria.fr/~zimmerma/records/ecmnet.html
...
/Christoph