1
#include "sbasis-poly.h"
5
SBasis poly_to_sbasis(Poly const & p) {
6
SBasis x = Linear(0, 1);
9
for(int i = p.size()-1; i >= 0; i--) {
10
r = SBasis(Linear(p[i], p[i])) + multiply(x, r);
17
Poly sbasis_to_poly(SBasis const & sb) {
20
Poly S; // (1-x)x = -1*x^2 + 1*x + 0
29
for(int i = sb.size()-1; i >= 0; i--) {
30
r = S*r + sb[i][0]*A + sb[i][1]*B;
41
c-file-style:"stroustrup"
42
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
47
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :