
Boost : 
Subject: Re: [boost] Math tools polynomial enhancements
From: John Maddock (jz.maddock_at_[hidden])
Date: 20151029 14:33:00
> Well, I think "braindead" is a little harsh, it seems quite reasonable to
> me for a generalpurpose univariate polynomial class. I must admit though,
> I don't particularly like the choice of constructors
In C++11 land, constexpr construction from an initializer list would be
a good choice.
> and the degree member
> function will return the maximum value of size_t when size == 0.
That's a bug. See, told you it was braindead ;)
> Yes, I was initially troubled by this question but resolved, admittedly
> more through intuition than proof, that polynomial division is Euclidean
> (integer) division: the / operator gives you the quotient, and % gives you
> the remainder. Someone with a deeper understanding of abstract algebra
> could presumably validate or discredit this claim. However, if one accepts
> this, then everything falls neatly into place, for example the /= operator
> makes sense, which it obviously wouldn't otherwise.
Looking quickly at what other polynomial libraries do, it seems this
could indeed work.
>
> I think it probably needs to be written by someone who has a concrete use
>> case and is deeply familiar with the theory, I don't know if that's you,
>> but I do know it's not me ;)
>>
> I admit that I am mostly drawn to this problem by fascination and wonder
> rather than a pragmatic need to get something done. But I think you're
> right, it's important to have a concrete use case rather than just throwing
> operators at a class to see what sticks. So GCD is the use case I propose,
> starting with the Euclidean algorithm and then the Stein algorithm. I'm not
> an expert in this area but I have a pretty good idea of what needs to be
> done.
OK, lets give it a shot and see where it leads.
Best, John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk