Boost logo

Boost :

Subject: Re: [boost] [xint] Boost.XInt formal review
From: Barend Gehrels (barend_at_[hidden])
Date: 2011-03-05 12:06:40


Hi,

This is my little review of XInt. Thanks for creating this library.

> - What is your evaluation of the design?
> - What is your evaluation of the implementation?

I didn't look in detail at the design nor at the implementation. Reasons
are time constraints, and the fact that this is already discussed in
much detail on this mailing list, and the fact that I don't know the
internals of any integer library I'm using. So I cannot compare.

> - What is your evaluation of the documentation?

The documentation is good. It seems complete and the texts are very
readable. It contains enough samples to start using it. It contains
enough reasoning. For an integer library, which you can normally start
to use immediately, it is definitely good enough. Is it generated by
Doxygen?

> - What is your evaluation of the potential usefulness of the library?

Very useful.

> - Did you try to use the library? With what compiler? Did you have any
> problems?

Yes, both MSVC Express 2005 and gcc 4.5.0 on mingw didn't give me any
problems.

> - How much effort did you put into your evaluation? A glance? A quick
> reading? In-depth study?

A few hours.

> - Are you knowledgeable about the problem domain?

Yes, from user perspective. I'm using ttmath's large doubles in
Boost.Geometry. Together with Bruno I did write a numeric adaptor (which
is probably obsoleted now) using CLN and GMP.

I've doubts about the inclusion of random generators within XInt. I
consider it as out of scope. About Boost.Random, The documentation
states "But, also as of Boost 1.43, it requires a compiled library", I
don't have this impression. I always use Boost.Random by header only.

This just came during writing this review:

> The only competing library that matters, so far as I can see, is GMP.

I don't think this is the case. ttmath is really competing, header only,
templated, etc. I've mentioned ttmath various times on this mailing list
(e.g. here <http://lists.boost.org/Archives/boost/2010/02/161943.php> ).
There is also CLN ( http://www.ginac.de/CLN/ )

I created a little test-program to check how easy it is to use, and how
fast it is. I'm quite fond of ttmath and I do hope that it is sent for
review to Boost at some point. So I compared with that. And, to compare
more, I also compared with CLN.

My little testprogram is pasted here: http://codepad.org/3cSn9GkZ

It does some operations (*, +, >, =) and nothing more. And it measures
the duration.

I will not give exact duration numbers because of easy
misinterpretation, I tested only two compilers, this is not the full
behaviour, etc. etc.

Just my summary is that XInt seems slightly slower than ttmath for me on
gcc, and is about the same speed on MSVC 2005. So, for a brand new
library written in five months (I'm referring to other mails now), I
think the speed is acceptable or good.

The CLN comparison I did only on gcc, and CLN turns out to be faster
than both ttmath and XInt. So CLN's speed is competing, but CLN is not
header-only and it has the wrong license (GMP) so in that sense it is
not a real competetor.

About my vote, this is difficult. I would really like ttmath be part of
Boost. It has a BSD license. It is header only. Its floating point
numbers are really good and according to my own test better (in
precision) than either CLN or GMP. But ttmath is never submitted until
now and I don't know if it is still planned. Besides that, it is not
uncommon within Boost to offer two similar libraries.

xint::integer is one thing, xdouble::double is missing. Is any floating
point precision planned? If no, is it not inconvenient to have two
completely different libraries for integer and FP? I really need a
perfect Boost FP big number library...

So I didn't decide about my definitive vote yet.

Regards, Barend

-- 
Barend Gehrels
http://about.me/barendgehrels

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk