Bug 319603

Summary: Work with polynomials
Product: [Frameworks and Libraries] analitza Reporter: Percy Camilo Triveño Aucahuasi <percy.camilo.ta>
Component: coreAssignee: Aleix Pol <aleixpol>
Status: REPORTED ---    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Percy Camilo Triveño Aucahuasi 2013-05-10 04:31:51 UTC
1) Sometimes you need to know is the expression is a polynomial, so for example:

x*x+y*y+sin(x) is not but
x*x+y*y it is

Note that 
x*x+y*y+sin(a) is a polynomail if a is some parameter (in Variables module)

bool Expression::isPolynomail(const Expression &exp, Variables var);

2) Also it would be very convenient if the API can report if a polynomial expression is univariate, bivariate, etc 

API: to report if a polynomial if bivariate I guess you just need to convert the expression to lambda and count the bvars (and omit the paramaters/variables in Variables mod) ... you can choose the name of the API.

3) And the degree/order or the polynomail.

int Expression::polynomailDegree(const Expression &exp, Variables var);

4) Construct a (univariate) polynomial from roots.

if the input is 1,2 then you return (x-1)*(x-2)

Expression Expression::createPolynomial(const QVector<double> &roots)


Reproducible: Always
Comment 1 Justin Zobel 2021-03-09 05:23:04 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.