13 #ifndef MPS_POLYNOMIAL_H_
14 #define MPS_POLYNOMIAL_H_
26 #define MPS_POLYNOMIAL_CAST(typename, t) ((typename*)(mps_polynomial_cast (# typename, (mps_polynomial*)t)))
29 #define MPS_POLYNOMIAL(t) (MPS_POLYNOMIAL_CAST (mps_polynomial, t))
37 typedef mps_boolean (*mps_polynomial_feval_t)(
mps_context * ctx,
mps_polynomial * p, cplx_t x, cplx_t value,
double * error);
42 typedef mps_boolean (*mps_polynomial_deval_t)(
mps_context * ctx,
mps_polynomial * p, cdpe_t x, cdpe_t value, rdpe_t error);
220 mps_boolean mps_polynomial_check_type (
mps_polynomial * p,
const char * type_name);
311 virtual bool eval (
mps_context * ctx, cplx_t x, cplx_t value,
double * error) = 0;
326 virtual bool eval (
mps_context * ctx, cdpe_t x, cdpe_t value, rdpe_t error) = 0;
341 virtual bool eval (
mps_context * ctx, mpc_t x, mpc_t value, rdpe_t error) = 0;
364 cplx_t x, cplx_t value,
double * error);
367 cdpe_t x, cdpe_t value, rdpe_t error);
370 mpc_t x, mpc_t value, rdpe_t error);
390 mpc_t leading_coefficient);
virtual long int raise_data_wp(mps_context *ctx, long int wp)
Raise the working precision of this polynomial to the specified value.
Definition: polynomialxx.cpp:63
mps_polynomial_fstart_t fstart
Method that collocate initial starting points.
Definition: polynomial.h:171
mps_polynomial_mnewton_t mnewton
Function used to compute the Newton correction in a point.
Definition: polynomial.h:207
virtual bool eval(mps_context *ctx, cplx_t x, cplx_t value, double *error)=0
Evaluate the polynomial at a point.
mps_density density
Density of the coefficients, or MPS_DENSITY_USER if the coefficients (or the newton fraction) is prov...
Definition: polynomial.h:144
this struct holds the state of the mps computation
Definition: context.h:55
mps_polynomial_meval_t meval
Method that evaluates the polynomial.
Definition: polynomial.h:166
mps_structure structure
Structure of the polynomial, i.e., the algebraic (or non-algebraic) structure where the coefficients ...
Definition: polynomial.h:137
mps_polynomial_free_t free
Function used to release polynomial resources.
Definition: polynomial.h:186
mps_polynomial_raise_data_t raise_data
Function used to raise precision of the coefficients of the representation of the polynomial.
Definition: polynomial.h:192
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 i...
Definition: polynomial.h:117
mps_polynomial_dnewton_t dnewton
Function used to compute the Newton correction in a point.
Definition: polynomial.h:202
Struct that represents an abstract polynomial. All the other real polynomial implementations (such as...
Definition: polynomial.h:111
Definition: polynomial.h:274
long int prec
Bits of precision of the coefficients.
Definition: polynomial.h:130
mps_polynomial_deval_t deval
Method that evaluates the polynomial.
Definition: polynomial.h:161
static Polynomial * fromString(mps_context *ctx, const char *inputString)
Parse a polynomial from a C-style string.
Definition: polynomialxx.cpp:48
int get_degree()
Public accessor to the degree of the Polynomial.
Definition: polynomial.h:293
int degree
The degree of the polynomial.
Definition: polynomial.h:122
mps_polynomial_mstart_t mstart
Method that collocate initial starting points.
Definition: polynomial.h:181
mps_polynomial_dstart_t dstart
Method that collocate initial starting points.
Definition: polynomial.h:176
Definition: approximation.h:24
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...
Definition: polynomialxx.cpp:55
mps_polynomial_feval_t feval
Method that evaluates the polynomial.
Definition: polynomial.h:156
mps_polynomial_fnewton_t fnewton
Function used to compute the Newton correction in a point.
Definition: polynomial.h:197
mps_polynomial_get_leading_coefficient_t get_leading_coefficient
Function used to retrieve the leading coefficient of the polynomial.
Definition: polynomial.h:213
mps_boolean thread_safe
This is true if the polynomial has thread-safe methods. Note that this is the default assumption set ...
Definition: polynomial.h:151