Wednesday, 24 July 2013

polys polys polys

I spent all day wrapping fmpz_poly. And I'm not even close to finished. I have wrapped the functions from all sections up to and including 13.25 (evaluation), and also 13.28 (composition).

The most interesting thing I implemented today (on other days this would hardly be worth mentioning) is to make the following work:

    fmpz_polyxx p, q;
    p = "3  1 0 1";
    q = "3  0 0 1";

    tassert(p(fmpzxx(2)) == 5);
    tassert(p(q).to_string() == "5  1 0 0 0 1");

You see, the operator() is overloaded to do either composition or evaluation, just like in real life. Isn't this exciting? ...

2 comments:

  1. I will borrow my next door neighbour's loud screeching cockatoo to wake me up so I don't miss even a single moment of that one. ;-o

    ReplyDelete