[fusion] useful as_variant in spirit2

Good day everyone, The function in boost\spirit\home\support\detail\as_variant.hpp seems to have no dep. on spirit, and it's a useful utility that would fit into fusion/support/as_variant.hpp> IIUC it's a meta function that computes a variant<T0, ..., TN> from a fusion sequence<T0, ..., TN>. I think there's no reason for a runtime counterpart, i.e. as_variant<Seq>::type is a valid expression but as_variant(Seq) and result_of::as_variant<Seq>::type is not. Thus, the function is already complete. Does it seem reasonable to you to include in fusion? The work of moving it would be to only update the docs, as spirit2 probably does excessive testing of this function anyway. I could collect the docs from other parts of fusion, and put together a separate test file if needed. All real work is already done, just presentation and formality that is lacking. Have a nice weekend, Christian

I noticed Boost.Math has some univariate polynomial-related functions, but I couldn't find anything regarding multivariate polynomials in either boost or the sandbox. It seems like something ripe for generic programming (hence I think of boost first). Is anyone currently working on something this, or can anyone provide a recommendation for an outside library? Our particular application deals with real (or complex) multivariate polynomials, and being able to do arithmetic, differentiation, integration, composition, and (of course) evaluation (among, perhaps, other operations). Thanks, - Jeff

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Jeffrey Hellrung Sent: Friday, September 25, 2009 9:39 PM To: boost@lists.boost.org Subject: [boost] multivariate polynomials
I noticed Boost.Math has some univariate polynomial-related functions, but I couldn't find anything regarding multivariate polynomials in either boost or the sandbox. It seems like something ripe for generic programming (hence I think of boost first). Is anyone currently working on something this, or can anyone provide a recommendation for an outside library?
Our particular application deals with real (or complex) multivariate polynomials, and being able to do arithmetic, differentiation, integration, composition, and (of course) evaluation (among, perhaps, other operations).
I'm sure John Maddock will reply with more authority (when his builders have left ;-) But I know of no plans for work on this at present. We didn't even come to a satisfactory conclusion of Pawel Kieliszczyk's Polynomial library after a review that wanted more changes than the author has found time to implement for a re-review. http://lists.boost.org/Archives/boost/2009/03/149833.php So one could argue that we need to walk before running with multivariates ;-) Boost.Math does not do anything complex either yet - these things always seem to turn out unexpectedly complex ;-) :-( But if you are planning to tackle this, I am sure we are willing to offer help in fitting into the Boost.Math scaffold. Templating on real type (rather than just double) is very useful (to some) but causes extra brain hurt. Policies to handle exceptional cases are also invaluable but cause yet more complexity. Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

AMDG Christian Holmquist wrote:
The function in boost\spirit\home\support\detail\as_variant.hpp seems to have no dep. on spirit, and it's a useful utility that would fit into fusion/support/as_variant.hpp> IIUC it's a meta function that computes a variant<T0, ..., TN> from a fusion sequence<T0, ..., TN>. I think there's no reason for a runtime counterpart, i.e. as_variant<Seq>::type is a valid expression but as_variant(Seq) and result_of::as_variant<Seq>::type is not. Thus, the function is already complete.
Does it seem reasonable to you to include in fusion? The work of moving it would be to only update the docs, as spirit2 probably does excessive testing of this function anyway. I could collect the docs from other parts of fusion, and put together a separate test file if needed. All real work is already done, just presentation and formality that is lacking.
How is this different from boost::make_variant_over? In Christ, Steven Watanabe

Steven Watanabe wrote:
AMDG
Christian Holmquist wrote:
The function in boost\spirit\home\support\detail\as_variant.hpp seems to have no dep. on spirit, and it's a useful utility that would fit into fusion/support/as_variant.hpp> IIUC it's a meta function that computes a variant<T0, ..., TN> from a fusion sequence<T0, ..., TN>. I think there's no reason for a runtime counterpart, i.e. as_variant<Seq>::type is a valid expression but as_variant(Seq) and result_of::as_variant<Seq>::type is not. Thus, the function is already complete.
Does it seem reasonable to you to include in fusion? The work of moving it would be to only update the docs, as spirit2 probably does excessive testing of this function anyway. I could collect the docs from other parts of fusion, and put together a separate test file if needed. All real work is already done, just presentation and formality that is lacking.
How is this different from boost::make_variant_over?
This version in spirit::detail was supposed to be a workaround. At one point, boost::make_variant_over had some problems with arbitrary forward sequences. I recall mentioning this problem with Eric Friedman at BoostCon 08. This may be a problem long gone. I'll check as soon as I can find some time. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
participants (5)
-
Christian Holmquist
-
Jeffrey Hellrung
-
Joel de Guzman
-
Paul A. Bristow
-
Steven Watanabe