MPSolve 3.2.1
Loading...
Searching...
No Matches
mps::Polynomial Class Referenceabstract
Inheritance diagram for mps::Polynomial:
mps_polynomial mps::NRootsPolynomial

Public Member Functions

 Polynomial (mps_context *ctx, const char *type_name="mps_polynomial")
 This constructor has the main role of adjusting the fake vtable in the C struct to reflect the actual content of the C++ implementation that may have been provided in extension to this class.
 
int get_degree ()
 Public accessor to the degree of the Polynomial.
 
virtual bool eval (mps_context *ctx, cplx_t x, cplx_t value, double *error)=0
 Evaluate the polynomial at a point. More...
 
virtual bool eval (mps_context *ctx, cdpe_t x, cdpe_t value, rdpe_t error)=0
 Evaluate the polynomial at a point. More...
 
virtual bool eval (mps_context *ctx, mpc_t x, mpc_t value, rdpe_t error)=0
 Evaluate the polynomial at a point. More...
 
virtual long int raise_data_wp (mps_context *ctx, long int wp)
 Raise the working precision of this polynomial to the specified value. More...
 
virtual void start_fp (mps_context *ctx, mps_approximation **approximations)
 
virtual void start_dpe (mps_context *ctx, mps_approximation **approximations)
 
virtual void start_mp (mps_context *ctx, mps_approximation **approximations)
 
virtual void get_leading_coefficient (mps_context *ctx, mpc_t lc)
 
virtual void newton (mps_context *ctx, mps_approximation *a, cplx_t x)=0
 
virtual void newton (mps_context *ctx, mps_approximation *a, cdpe_t x)=0
 
virtual void newton (mps_context *ctx, mps_approximation *a, mpc_t x, long int wp)=0
 

Static Public Member Functions

static PolynomialfromString (mps_context *ctx, const char *inputString)
 Parse a polynomial from a C-style string.
 
static mps_boolean feval_wrapper (mps_context *ctx, mps_polynomial *p, cplx_t x, cplx_t value, double *error)
 
static mps_boolean deval_wrapper (mps_context *ctx, mps_polynomial *p, cdpe_t x, cdpe_t value, rdpe_t error)
 
static mps_boolean meval_wrapper (mps_context *ctx, mps_polynomial *p, mpc_t x, mpc_t value, rdpe_t error)
 
static void free_wrapper (mps_context *ctx, mps_polynomial *p)
 
static long int raise_data_wrapper (mps_context *ctx, mps_polynomial *p, long int wp)
 
static void fstart_wrapper (mps_context *ctx, mps_polynomial *p, mps_approximation **approximations)
 
static void dstart_wrapper (mps_context *ctx, mps_polynomial *p, mps_approximation **approximations)
 
static void mstart_wrapper (mps_context *ctx, mps_polynomial *p, mps_approximation **approximations)
 
static void fnewton_wrapper (mps_context *ctx, mps_polynomial *p, mps_approximation *a, cplx_t x)
 
static void dnewton_wrapper (mps_context *ctx, mps_polynomial *p, mps_approximation *a, cdpe_t x)
 
static void mnewton_wrapper (mps_context *ctx, mps_polynomial *p, mps_approximation *a, mpc_t x, long int wp)
 
static void get_leading_coefficient_wrapper (mps_context *ctx, mps_polynomial *p, mpc_t leading_coefficient)
 

Additional Inherited Members

- Public Attributes inherited from mps_polynomial
const char * type_name
 Name of the type. This must be a global static string that can be used to check if a mps_polynomial is of a specific type. It can be NULL to leave the type vague.
 
int degree
 The degree of the polynomial.
 
long int prec
 Bits of precision of the coefficients. More...
 
mps_structure structure
 Structure of the polynomial, i.e., the algebraic (or non-algebraic) structure where the coefficients are found.
 
mps_density density
 Density of the coefficients, or MPS_DENSITY_USER if the coefficients (or the newton fraction) is provided via a user routine.
 
mps_boolean thread_safe
 This is true if the polynomial has thread-safe methods. Note that this is the default assumption set by mps_polynomial_init(). You should overwrite after calling it if that's not the case.
 
mps_polynomial_feval_t feval
 Method that evaluates the polynomial.
 
mps_polynomial_deval_t deval
 Method that evaluates the polynomial.
 
mps_polynomial_meval_t meval
 Method that evaluates the polynomial.
 
mps_polynomial_fstart_t fstart
 Method that collocate initial starting points.
 
mps_polynomial_dstart_t dstart
 Method that collocate initial starting points.
 
mps_polynomial_mstart_t mstart
 Method that collocate initial starting points.
 
mps_polynomial_free_t free
 Function used to release polynomial resources.
 
mps_polynomial_raise_data_t raise_data
 Function used to raise precision of the coefficients of the representation of the polynomial.
 
mps_polynomial_fnewton_t fnewton
 Function used to compute the Newton correction in a point.
 
mps_polynomial_dnewton_t dnewton
 Function used to compute the Newton correction in a point.
 
mps_polynomial_mnewton_t mnewton
 Function used to compute the Newton correction in a point.
 
mps_polynomial_get_leading_coefficient_t get_leading_coefficient
 Function used to retrieve the leading coefficient of the polynomial.
 

Member Function Documentation

◆ eval() [1/3]

virtual bool mps::Polynomial::eval ( mps_context ctx,
cdpe_t  x,
cdpe_t  value,
rdpe_t  error 
)
pure virtual

Evaluate the polynomial at a point.

This method should be overloaded by subclasses of Polynomial in order to provide the necessary methods to MPSolve.

Parameters
xThe point where the Polynomial should be evaluted.
valueThe storage where the result of the evaluation will be stored.
errorAn upper bound to the error that has been computed in this operation.
Returns
true if the operation was successful, false in case an exception has been encountered.

Implemented in mps::NRootsPolynomial.

◆ eval() [2/3]

virtual bool mps::Polynomial::eval ( mps_context ctx,
cplx_t  x,
cplx_t  value,
double *  error 
)
pure virtual

Evaluate the polynomial at a point.

This method should be overloaded by subclasses of Polynomial in order to provide the necessary methods to MPSolve.

Parameters
xThe point where the Polynomial should be evaluted.
valueThe storage where the result of the evaluation will be stored.
errorAn upper bound to the error that has been computed in this operation.
Returns
true if the operation was successful, false in case an exception has been encountered.

Implemented in mps::NRootsPolynomial.

◆ eval() [3/3]

virtual bool mps::Polynomial::eval ( mps_context ctx,
mpc_t  x,
mpc_t  value,
rdpe_t  error 
)
pure virtual

Evaluate the polynomial at a point.

This method should be overloaded by subclasses of Polynomial in order to provide the necessary methods to MPSolve.

Parameters
xThe point where the Polynomial should be evaluted.
valueThe storage where the result of the evaluation will be stored.
errorAn upper bound to the error that has been computed in this operation.
Returns
true if the operation was successful, false in case an exception has been encountered.

Implemented in mps::NRootsPolynomial.

◆ raise_data_wp()

long int Polynomial::raise_data_wp ( mps_context ctx,
long int  wp 
)
virtual

Raise the working precision of this polynomial to the specified value.

Note that this might be a no-op on polynomials that are defined implicitly or without the need for explicit coefficients.


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