Subject: Re: [boost] Arbitrary precision arithmetic
From: joel (joel.falcou_at_[hidden])
Date: 2009-08-19 01:50:09
>> 2) Don't limit yourself to cryptographic applications. Big numbers have
>> applications in identification and other scientific fields. As such one
>> might be perfectly content with fixed sized stack allocated [unsigned] int
>> types. Ex. std::bitset<512> -> uint<512>
I agree on this
>> 3) Think pluggable. Start with a standard C++ implementation even if it is
>> slow as long as it work and then gradually, on latter releases, replace or
>> allow choosing faster implementations. Who knows this might allow others to
>> plug GMP or other implementations into it.
THis may end up as a test case for the general numerical functions
library I'm trying to generate out of my Boost.SIMD proposal.
In a large scope, it provides a large number of stub functions that are
tag dispatched rather efficiently based on "arithmetic"-like value types.
So basically, it defines 150+ functions that looks at their parameters
and decide which implementation to use at compile-time. I use that to
discriminate between scalar and SIMD functions, but if you "tag" this
bignum class correctly and follow my extension mecanism, then we can
statically choose between implementation. Roughly :
x = abs(x); <-- call the "standard bignum" implementation
y = abs(y); <-- call the GMP implementation
>> [Consider virtual functions,
>> function pointers, facets. Most in past conversations have offered strong
>> resistance to virtual functions.]
The more is done at CT, the better so traits+ tag-disptach is the way to
go compared to virtual functions.
-- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk