From e6e6a3c4eeac2ad5d3b5e1379cd94085c6fe9e24 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 21 Feb 2007 12:57:52 +0100 Subject: [PATCH] bernstein: bernsteinExpansion: accept list of polynomials --- bernstein/src/bernstein.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bernstein/src/bernstein.cpp b/bernstein/src/bernstein.cpp index 50767ac..e809a01 100644 --- a/bernstein/src/bernstein.cpp +++ b/bernstein/src/bernstein.cpp @@ -117,6 +117,22 @@ matrix domainVertices(Param_Polyhedron *PP, Param_Domain *Q, const exvector& par lst bernsteinExpansion(const matrix& vert, const ex& poly, const exvector& vars, const exvector& Params) { + if (is_exactly_a(poly)) { + lst polylst = ex_to(poly); + lst::const_iterator j = polylst.begin(); + + lst coeff = bernsteinExpansion(vert, *j, vars, Params); + + for (++j; j != polylst.end(); ++j) { + lst::const_iterator k; + lst new_coeff = bernsteinExpansion(vert, *j, vars, Params); + for (k = new_coeff.begin(); k != new_coeff.end(); ++k) + coeff.append(*k); + coeff.sort().unique(); + } + return coeff; + } + unsigned maxDegree = findMaxDegree(poly, vars); matrix A = getAiMatrix(vert.rows()); -- 2.11.4.GIT