MPSolve 3.2.1
Loading...
Searching...
No Matches
xmpsolve::PolynomialSolver Class Reference

The PolynomialSolver class aims to solve a polynomial given its coefficients or the content of the line edit to parse. More...

#include <polynomialsolver.h>

Inheritance diagram for xmpsolve::PolynomialSolver:

Public Slots

int solvePoly (mps_polynomial *poly, PolynomialBasis basis=MONOMIAL, mps_algorithm selected_algorithm=MPS_ALGORITHM_SECULAR_GA, int required_digits=16, mps_output_goal goal=MPS_OUTPUT_GOAL_APPROXIMATE)
 Solve a polynomial. More...
 
int solvePolFile (QString selectedFile, mps_algorithm selected_algorithm=MPS_ALGORITHM_SECULAR_GA, int required_digits=16, mps_output_goal goal=MPS_OUTPUT_GOAL_APPROXIMATE)
 Solve a polynomial specified by a .pol file. More...
 
int solvePolFileFromContent (QString content, mps_algorithm selected_algorithm, int required_digits, mps_output_goal goal=MPS_OUTPUT_GOAL_APPROXIMATE)
 solvePolFileFromContent solves a .pol file given its ontent More...
 
int solvePoly (QString inputString, PolynomialBasis basis=xmpsolve::MONOMIAL, mps_algorithm=MPS_ALGORITHM_SECULAR_GA, int required_digits=16, mps_output_goal goal=MPS_OUTPUT_GOAL_APPROXIMATE)
 Parse the string describing the polynomial and solve it. More...
 
QString errorMessage ()
 errorMessage can be used to access the last error message, if solvePoly() returns -1. More...
 
unsigned long int CPUTime ()
 CPUTime can be used to access the CPU time consumed by the last polynomial solved. Calling it before solvePoly() leads to undefined behaviour. More...
 
RootsModelrootsModel ()
 rootsModel returns a pointer to the internal rootsModel that holds the approximations computed by the algorithm. More...
 
void abortComputations ()
 abortComputations kills every current computation.
 
void workerExited ()
 Called when the thread solving the polynomial exits.
 

Signals

void solved ()
 Signal emitted when the computation ends.
 

Public Member Functions

 PolynomialSolver (QObject *parent=0)
 

Detailed Description

The PolynomialSolver class aims to solve a polynomial given its coefficients or the content of the line edit to parse.

When the polynomial will be solve a solved() signal will be emitted and the roots will be reachable through the get_roots() method.

Member Function Documentation

◆ CPUTime

unsigned long int PolynomialSolver::CPUTime ( )
slot

CPUTime can be used to access the CPU time consumed by the last polynomial solved. Calling it before solvePoly() leads to undefined behaviour.

Returns
the number of ms spent on the last polynomial solution.

◆ errorMessage

QString PolynomialSolver::errorMessage ( )
slot

errorMessage can be used to access the last error message, if solvePoly() returns -1.

Returns
A QString describing the last error.

◆ rootsModel

RootsModel * PolynomialSolver::rootsModel ( )
slot

rootsModel returns a pointer to the internal rootsModel that holds the approximations computed by the algorithm.

Returns
A pointer to the internal rootsModel.

◆ solvePolFile

int PolynomialSolver::solvePolFile ( QString  selectedFile,
mps_algorithm  selected_algorithm = MPS_ALGORITHM_SECULAR_GA,
int  required_digits = 16,
mps_output_goal  goal = MPS_OUTPUT_GOAL_APPROXIMATE 
)
slot

Solve a polynomial specified by a .pol file.

Returns
The degree of the polynomial.

◆ solvePolFileFromContent

int PolynomialSolver::solvePolFileFromContent ( QString  content,
mps_algorithm  selected_algorithm,
int  required_digits,
mps_output_goal  goal = MPS_OUTPUT_GOAL_APPROXIMATE 
)
slot

solvePolFileFromContent solves a .pol file given its ontent

Parameters
contentThe content of the desired .pol file
selected_algorithmThe algorithm to use.
required_digitsThe number of accurate digits required.
Returns
The degree of the polynomial.

◆ solvePoly [1/2]

int PolynomialSolver::solvePoly ( mps_polynomial poly,
PolynomialBasis  basis = MONOMIAL,
mps_algorithm  selected_algorithm = MPS_ALGORITHM_SECULAR_GA,
int  required_digits = 16,
mps_output_goal  goal = MPS_OUTPUT_GOAL_APPROXIMATE 
)
slot

Solve a polynomial.

Returns
The degree of the polynomial.

◆ solvePoly [2/2]

int PolynomialSolver::solvePoly ( QString  inputString,
PolynomialBasis  basis = xmpsolve::MONOMIAL,
mps_algorithm  selected_algorithm = MPS_ALGORITHM_SECULAR_GA,
int  required_digits = 16,
mps_output_goal  goal = MPS_OUTPUT_GOAL_APPROXIMATE 
)
slot

Parse the string describing the polynomial and solve it.

Returns
The degree of the polynomial.

The documentation for this class was generated from the following files: