[math][integer] Moving integer utilities out of the math lib.

This does look to me like a good idea, but to remain coherent, all of http://www.boost.org/doc/libs/1_57_0/libs/math/doc/html/gcd_lcm.html should move, which means: common_factor.hpp common_factor_rt.hpp common_factor_ct.hpp Plus docs and tests. Further I'd like to see the headers under boost/integer/*.hpp and the namespace changed to boost::integer. For backwards compatibility the boost/math/*.hpp headers should be present also but merely include the new ones and import the symbols into boost::math via using declarations. One SNAFU I see is that boost.integer is a largely unmaintained ragbag of utilities (though often very useful). It would be nice if someone would take responsibility for this library: any takers? It might be the right time too to move the rest of Boost.Integer into boost::integer rather than dumping everything in namespace boost? And finally to provide a "soft landing" for existing users, the Math lib docs should retain a stub page for these utilities that points to the new docs - Paul and I can take care of that one. Does that look like a plan? Anyone care to take it on? Best, John.

John Maddock wrote:
This does look to me like a good idea, but to remain coherent, all of http://www.boost.org/doc/libs/1_57_0/libs/math/doc/html/gcd_lcm.html should move, which means:
common_factor.hpp common_factor_rt.hpp common_factor_ct.hpp
Plus docs and tests.
One problem I see here is that the compile-time templates derive from
mpl::integral_c, which means a dependency on MPL. I doubt that anyone is
actually using anything besides ::value, but in principle, the base class
can't be removed without potentially breaking code. So, to be on the safe
side, boost/math/common_factor_ct.hpp should probably contain
using boost::integer::static_gcd_type;
template < static_gcd_type Value1, static_gcd_type Value2 >
struct boost::math::static_gcd : public mpl::integral_c

Le 10/01/15 15:14, Peter Dimov a écrit :
John Maddock wrote:
This does look to me like a good idea, but to remain coherent, all of http://www.boost.org/doc/libs/1_57_0/libs/math/doc/html/gcd_lcm.html should move, which means:
common_factor.hpp common_factor_rt.hpp common_factor_ct.hpp
Plus docs and tests.
One problem I see here is that the compile-time templates derive from mpl::integral_c, which means a dependency on MPL. I doubt that anyone is actually using anything besides ::value, but in principle, the base class can't be removed without potentially breaking code. So, to be on the safe side, boost/math/common_factor_ct.hpp should probably contain
using boost::integer::static_gcd_type;
template < static_gcd_type Value1, static_gcd_type Value2 > struct boost::math::static_gcd : public mpl::integral_c
::value> { }; And, for reasons well outlined in your other post, the boost/math headers should remain in Math.
+1 for this split of responsibilities. Vicente

Le 10/01/15 13:21, John Maddock a écrit :This does look to me like a good idea, but to remain coherent, all of http://www.boost.org/doc/libs/1_57_0/libs/math/doc/html/gcd_lcm.html should move, which means:
common_factor.hpp common_factor_rt.hpp common_factor_ct.hpp
Plus docs and tests.
Further I'd like to see the headers under boost/integer/*.hpp and the namespace changed to boost::integer. For backwards compatibility the boost/math/*.hpp headers should be present also but merely include the new ones and import the symbols into boost::math via using declarations.
One SNAFU I see is that boost.integer is a largely unmaintained ragbag of utilities (though often very useful).
I believed that Daryle Walker was maintaining it, but now that I see that the last closed fix was 5 years ago I agree that it is unmaintained. Anyway the library has 4 authors: Beman Dawes, Daryle Walker, Gennaro Prota andJohn Maddock. No one of the other authors want to maintain this simple ;-) library? Beman? John?
It would be nice if someone would take responsibility for this library: any takers? It might be the right time too to move the rest of Boost.Integer into boost::integer rather than dumping everything in namespace boost?
Does that look like a plan? Anyone care to take it on?
I think so. The logical structure must be preserved. Some years ago, I mentored a Bits Ints GSoC project that falls in this category that added a lot of ct and rt facilities for ints. If no one of the current authors want to take care of the maintenance of this library I could do it, but I would like Beman and John, you help on this task also. Best, Vicente

Does that look like a plan? Anyone care to take it on?
I think so. The logical structure must be preserved. Some years ago, I mentored a Bits Ints GSoC project that falls in this category that added a lot of ct and rt facilities for ints. If no one of the current authors want to take care of the maintenance of this library I could do it, but I would like Beman and John, you help on this task also.
I'll help as best I can, but don't really have the time. BTW I don't think Beman or myself actually authored any aspects of the integer lib, we've just fixed a few things here and there from time to time. John.

On Sat, Jan 10, 2015 at 12:54 PM, John Maddock
Does that look like a plan? Anyone care to take it on?
I think so. The logical structure must be preserved. Some years ago, I mentored a Bits Ints GSoC project that falls in this category that added a lot of ct and rt facilities for ints. If no one of the current authors want to take care of the maintenance of this library I could do it, but I would like Beman and John, you help on this task also.
I'll help as best I can, but don't really have the time.
Same here.
BTW I don't think Beman or myself actually authored any aspects of the integer lib, we've just fixed a few things here and there from time to time.
IIRC, I authored at least part of integer.hpp. But that was 1999, and integer.hpp for most uses has long since been made obsolete by <cstdint>. --Beman

-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Vicente J. Botet Escriba Sent: 10 January 2015 15:50 To: boost@lists.boost.org Subject: Re: [boost] [math][integer] Moving integer utilities out of the math
lib.
Le 10/01/15 13:21, John Maddock a écrit :This does look to me like a good
to remain coherent, all of http://www.boost.org/doc/libs/1_57_0/libs/math/doc/html/gcd_lcm.html should move, which means:
common_factor.hpp common_factor_rt.hpp common_factor_ct.hpp
Plus docs and tests.
Further I'd like to see the headers under boost/integer/*.hpp and the namespace changed to boost::integer. For backwards compatibility the boost/math/*.hpp headers should be present also but merely include the new ones and import the symbols into boost::math via using declarations.
One SNAFU I see is that boost.integer is a largely unmaintained ragbag of utilities (though often very useful).
I believed that Daryle Walker was maintaining it, but now that I see that the last closed fix was 5 years ago I agree that it is unmaintained. Anyway the library has 4 authors: Beman Dawes, Daryle Walker, Gennaro Prota andJohn Maddock. No one of the other authors want to maintain this simple ;-) library? Beman? John?
It would be nice if someone would take responsibility for this library: any takers? It might be the right time too to move the rest of Boost.Integer into boost::integer rather than dumping everything in namespace boost?
Does that look like a plan? Anyone care to take it on?
I think so. The logical structure must be preserved. Some years ago, I mentored a Bits Ints GSoC project that falls in this category that added a lot of ct and rt facilities for ints. If no one of the current authors want to take care of the maintenance of this
idea, but library
I could do it, but I would like Beman and John, you help on this task also.
I'm willing to help with (possibly new/combined) documentation. Paul --- Paul A. Bristow Prizet Farmhouse Kendal UK LA8 8AB +44 (0) 1539 561830

Paul A. Bristow wrote:
I'm willing to help with (possibly new/combined) documentation.
Thanks Paul. I've copied math/common_factor*.hpp, doc/gcd, test/common_factor_test.cpp to Integer, then fixed the headers as described previously and updated the test accordingly. I also updated the 'integer' team. I haven't touched anything in Math. Integer's tests pass for me on msvc-8.0, 10.0, 11.0, 12.0, gcc 4.8.3 03/11, clang 3.4.2 03/11. Let me know if there's anything else with which I can help.

Let me know if there's anything else with which I can help.
I suppose I should probably fix Rational, because it currently has no maintainer. It has many unmerged changes though, some quite extensive. I'm also getting a test failure on develop (with msvc-8.0): rational_test.cpp(983): error: in "rational_cross_constructor_test": check half_mu2.denominator() == MyOverflowingUnsigned(2u) has failed [1635872 != 2] that is not present on master.

Le 13/01/15 22:05, Peter Dimov a écrit :
Let me know if there's anything else with which I can help.
I suppose I should probably fix Rational, because it currently has no maintainer.
It has many unmerged changes though, some quite extensive.
I'm also getting a test failure on develop (with msvc-8.0):
rational_test.cpp(983): error: in "rational_cross_constructor_test": check half_mu2.denominator() == MyOverflowingUnsigned(2u) has failed [1635872 != 2]
that is not present on master.
Are these changes fixing some bugs? What about moving develop to another branch, and start develop from master? We could take the changes from this branch later once by once. Vicente

Vicente J. Botet Escriba wrote:
Le 13/01/15 22:05, Peter Dimov a écrit :
I suppose I should probably fix Rational, because it currently has no maintainer.
It has many unmerged changes though, some quite extensive.
I'm also getting a test failure on develop (with msvc-8.0):
rational_test.cpp(983): error: in "rational_cross_constructor_test": check half_mu2.denominator() == MyOverflowingUnsigned(2u) has failed [1635872 != 2]
that is not present on master.
Are these changes fixing some bugs?
Yes, it seems so. The failure above is actually in a new test, so it's not a regression. It's also only present on msvc-8.0, and even there, if I extract the test code into a separate program, the denominator has the expected value of 2. It could be some odd interaction with Test, but I've no time to investigate. The develop changes seem beneficial, so I'll just merge them.

Date: Wed, 14 Jan 2015 07:34:43 +0100 From: vicente.botet@wanadoo.fr To: boost@lists.boost.org Subject: Re: [boost] [math][integer] Moving integer utilities out of themathlib.
Le 13/01/15 22:05, Peter Dimov a écrit :
Let me know if there's anything else with which I can help.
I suppose I should probably fix Rational, because it currently has no maintainer.
It has many unmerged changes though, some quite extensive.
I'm also getting a test failure on develop (with msvc-8.0):
rational_test.cpp(983): error: in "rational_cross_constructor_test": check half_mu2.denominator() == MyOverflowingUnsigned(2u) has failed [1635872 != 2]
that is not present on master.
Are these changes fixing some bugs? What about moving develop to another branch, and start develop from master? We could take the changes from this branch later once by once. I was trying to fix some bugs on the tracker. It was done on SVN before we switched to Git. At least some of them should have been uploaded to the release branch. I remember not being able to figure out that line-983 error. I haven't looked at any Boost code since the Git switch, but you can e-mail me if you have any questions. Daryle W.

Le 13/01/15 20:11, Peter Dimov a écrit :
Paul A. Bristow wrote:
I'm willing to help with (possibly new/combined) documentation.
Thanks Paul.
I've copied math/common_factor*.hpp, doc/gcd, test/common_factor_test.cpp to Integer, then fixed the headers as described previously and updated the test accordingly. I also updated the 'integer' team.
I haven't touched anything in Math.
Integer's tests pass for me on msvc-8.0, 10.0, 11.0, 12.0, gcc 4.8.3 03/11, clang 3.4.2 03/11.
Let me know if there's anything else with which I can help.
Thanks Peter, I see that most of the work is done. I will Chrono and Ratio to the new Integer interface soon. Best, Vicente

Here's where the common_factor headers are used:
C:\Projects\boost-git\boost>dist\bin\boostdep
boost/math/common_factor_ct.hpp
Inclusion report for

Le 14/01/15 10:45, Peter Dimov a écrit :
Here's where the common_factor headers are used:
C:\Projects\boost-git\boost>dist\bin\boostdep boost/math/common_factor_ct.hpp Inclusion report for
(in module math): from pool:
from units:
from variant:
C:\Projects\boost-git\boost>dist\bin\boostdep boost/math/common_factor_rt.hpp Inclusion report for
(in module math): from chrono:
from multi_index:
from rational:
I can take care of Pool and Units, if needed. Not sure what their maintenance status is, officially.
Done for Chrono. I could do it for Rational if someone give me the rights. Thanks Peter for pushing this move, Vicente

Vicente J. Botet Escriba
Le 14/01/15 10:45, Peter Dimov a écrit :
C:\Projects\boost-git\boost>dist\bin\boostdep boost/math/common_factor_rt.hpp Inclusion report for
(in module math): from chrono: [...] from multi_index: [...] from rational: [...]
[...]
Done for Chrono. I could do it for Rational if someone give me the rights.
Done for Boost.MultiIndex. Joaquín M López Muñoz Telefónica

-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Peter Dimov Sent: 13 January 2015 19:11 To: boost@lists.boost.org Subject: Re: [boost] [math][integer] Moving integer utilities out of themath
lib.
Paul A. Bristow wrote:
I'm willing to help with (possibly new/combined) documentation.
Thanks Paul.
I've copied math/common_factor*.hpp, doc/gcd, test/common_factor_test.cpp to Integer, then fixed the headers as described previously and updated the test accordingly. I also updated the 'integer' team.
I haven't touched anything in Math.
Integer's tests pass for me on msvc-8.0, 10.0, 11.0, 12.0, gcc 4.8.3 03/11,
clang 3.4.2
03/11.
Let me know if there's anything else with which I can help.
I confirm that I'm on the job using a branch "doc_revision" - but nothing pushed yet. I'm considering using Quickbook and Doxygen and autoindexing. And some other examples would not go amiss IMO. Are we leaving LCM GCD copies at Boost.Math for a while to allow a less painful changeover? Or are the redirects? Paul --- Paul A. Bristow Prizet Farmhouse Kendal UK LA8 8AB +44 (0) 1539 561830

Are we leaving LCM GCD copies at Boost.Math for a while to allow a less painful changeover?
Or are the redirects?
Redirects would be better (along with importing into namespace boost::math). I'll probably get there in the end... unless you get there first? John.

Date: Sat, 10 Jan 2015 16:50:09 +0100 From: vicente.botet@wanadoo.fr To: boost@lists.boost.org Subject: Re: [boost] [math][integer] Moving integer utilities out of the math lib.
Le 10/01/15 13:21, John Maddock a écrit :This does look to me like a good idea, but to remain coherent, all of http://www.boost.org/doc/libs/1_57_0/libs/math/doc/html/gcd_lcm.html should move, which means:
common_factor.hpp common_factor_rt.hpp common_factor_ct.hpp
Plus docs and tests.
Further I'd like to see the headers under boost/integer/*.hpp and the namespace changed to boost::integer. For backwards compatibility the boost/math/*.hpp headers should be present also but merely include the new ones and import the symbols into boost::math via using declarations.
One SNAFU I see is that boost.integer is a largely unmaintained ragbag of utilities (though often very useful).
I believed that Daryle Walker was maintaining it, but now that I see that the last closed fix was 5 years ago I agree that it is unmaintained. Anyway the library has 4 authors: Beman Dawes, Daryle Walker, Gennaro Prota andJohn Maddock. No one of the other authors want to maintain this simple ;-) library? Beman? John? I don't mind if someone else wants to take over. I got bogged down trying to modernize it (which was so long ago that it would need re-modernizing if I ever uploaded it) and not getting how to do uploads. (The bug fixes I did with Rational were the only ones I've successfully uploaded by myself to an official release.) I do occasionally check my e-mail if whoever takes over has questions.
It would be nice if someone would take responsibility for this library: any takers? It might be the right time too to move the rest of Boost.Integer into boost::integer rather than dumping everything in namespace boost?
Does that look like a plan? Anyone care to take it on?
I think so. The logical structure must be preserved. Some years ago, I mentored a Bits Ints GSoC project that falls in this category that added a lot of ct and rt facilities for ints. If no one of the current authors want to take care of the maintenance of this library I could do it, but I would like Beman and John, you help on this task also.
participants (8)
-
Beman Dawes
-
Daryle Walker
-
Joaquin M Lopez Munoz
-
John Maddock
-
John Maddock
-
Paul A. Bristow
-
Peter Dimov
-
Vicente J. Botet Escriba