[Review] Final Few Days for Formal Review of Proposed Boost.Ratio Library

Hi everyone, If you have already posted a review, then thank you. For the rest of you: the review of Vicente Botet' Ratio library runs until October 11th, 2010 (this coming Monday), so please submit your reviews. What is it? ======== Portable implementation of the C++0x Standard Library's compile-time rational arithmetic working on C++03 and C++0x compilers. See the current C++0x working draft at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3126.pdf Boost.Ratio provides: * A class template, ratio, for specifying compile time rational constants such as 1/3 of a nanosecond or the number of inches per meter. ratio represents a compile time ratio of compile time constants with support for compile time arithmetic with overflow and division by zero protection * It provides a textual representation of boost::ratio<N, D> in the form of a std::basic_string. Other types such as boost::duration can use these strings to aid in their I/O. This library is header-only and is designed to be generic and useful in a lot of areas of math and numerics C++ programming, in particular it is absolutely needed for the proposed Boost.Chrono and Boost.Stopwatches libraries which are currently in the review queue. Getting the library ============= The latest version of this library may be downloaded from vault: http://www.boostpro.com/vault/index.php?action=downloadfile&filename=ratio.zip&directory=Math%20-%20Numerics& SVN: http://svn.boost.org/svn/boost/sandbox/chrono (directories boost/ratio and libs/ratio) and the docs may be viewed here html: http://svn.boost.org/svn/boost/sandbox/chrono/libs/ratio/doc/html/index.html pdf: http://svn.boost.org/svn/boost/sandbox/chrono/libs/ratio/doc/ratio.pdf You can get all these information also (which should avoid some long links) from http://svn.boost.org/trac/boost/wiki/LibrariesUnderConstruction#Boost.Ratio It is worth noting that the tests included in the zip file are relatively sparse. Vicente has an extensive suite of tests licensed under the LLVM license. He has posted a message on the Boost Developers mailing list regarding the license requirements for tests (See http://thread.gmane.org/gmane.comp.lib.boost.devel/208978), and is awaiting the outcome of that discussion before making the tests available. Writing a review ================ If you feel this is an interesting library, then please submit your review to the developer list (preferably), or to the review manager. Here are some questions you might want to answer in your review: - What is your evaluation of the design? - What is your evaluation of the implementation? - What is your evaluation of the documentation? - What is your evaluation of the potential usefulness of the library? - Did you try to use the library? With what compiler? Did you have any problems? - How much effort did you put into your evaluation? A glance? A quick - reading? In-depth study? - Are you knowledgeable about the problem domain? And finally, every review should answer this question: - Do you think the library should be accepted as a Boost library? Be sure to say this explicitly so that your other comments don't obscure your overall opinion. Anthony Review Manager for the proposed Boost.Ratio library -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

Anthony Williams <anthony.ajw <at> gmail.com> writes:
What is it? ======== Portable implementation of the C++0x Standard Library's compile-time rational arithmetic working on C++03 and C++0x compilers. See the current C++0x working draft at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3126.pdf
This is not a review, just a question about what the library is supposed to implement. It appears that the implementation of the ratio arithmetic follows the specification in n2798. The comments at the top of ratio.hpp also links to n2798. The specification for ratio arithmetic has since changed. In n3126, the specification of ratio_add reads: "The type ratio_add<R1, R2> shall be a synonym for ratio<T1, T2> where T1 has the value R1::num * R2::den + R2::num * R1::den and T2 has the value R1::den * R2::den." Regards, Daniel ________________________________ This e-mail is confidential and may contain legally privileged information. It is intended only for the addressees. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message from your system.

----- Original Message ----- From: "Daniel Andersson" <Daniel.Andersson@orcsoftware.com> To: <boost@lists.boost.org> Sent: Friday, October 08, 2010 2:41 PM Subject: Re: [boost] [Review] Final Few Days for Formal Review ofProposed Boost.Ratio Library
This is not a review, just a question about what the library is supposed to implement.
It appears that the implementation of the ratio arithmetic follows the specification in n2798. The comments at the top of ratio.hpp also links to n2798. The specification for ratio arithmetic has since changed. In n3126, the specification of ratio_add reads:
"The type ratio_add<R1, R2> shall be a synonym for ratio<T1, T2> where T1 has the value R1::num * R2::den + R2::num * R1::den and T2 has the value R1::den * R2::den."
Hi, Yes this is an incompatibility of the current implementation. Others have already made the remark and I will change to the last wording of n3126. As the ratio class has already the nested typedef type it would be no interface break with the current interface. Best, Vicente

Hi, While changing the static_gcd and other specific metafunction from the boost::detail to a specific ratio detail namespace I have see that Boost.Chrono used these detail implementation meta-function also. It seems necessary to move these details to a public namespace. I don't know which lib should be the best to include them, Boost.Math or Boost.Integer. The nedeed metafunctions are static_signed_gcd, static_signed_lcm, static_signed_sign, static_signed_abs. John, I have added 4 files to the sandbox/static_integer directory. Do you think that this could be included in Boost.Integer or Boost.Math if I provide the associated documentation and tests? Best, _____________________ Vicente Juan Botet Escribá http://viboes.blogspot.com/
participants (3)
-
Anthony Williams
-
Daniel Andersson
-
vicente.botet