MPSolve 3.2.1
|
Implementation of the allocation and edit functions for the handling of monomial polynomials. More...
Go to the source code of this file.
Classes | |
struct | mps_monomial_poly_double_buffer |
struct | mps_monomial_poly |
Data regarding a polynomial represented in the monomial base. More... | |
Macros | |
#define | MPS_MONOMIAL_POLY(t) (MPS_POLYNOMIAL_CAST (mps_monomial_poly, t)) |
#define | MPS_IS_MONOMIAL_POLY(t) (mps_polynomial_check_type (t, "mps_monomial_poly")) |
Functions | |
mps_monomial_poly * | mps_monomial_poly_new (mps_context *s, long int degree) |
Return a newly allocated mps_monomial_poly of the given degree. | |
void | mps_monomial_poly_free (mps_context *s, mps_polynomial *mp) |
Free a instance of mps_monomial_poly previously allocated with mps_monomial_poly_new() . | |
long int | mps_monomial_poly_get_precision (mps_context *s, mps_monomial_poly *mp) |
long int | mps_monomial_poly_raise_precision (mps_context *s, mps_polynomial *mp, long int prec) |
Raise the precision bits of the multiprecision fields of the polynomial to selected value. More... | |
void | mps_monomial_poly_set_coefficient_q (mps_context *s, mps_monomial_poly *mp, long int i, mpq_t real_part, mpq_t imag_part) |
This routine can be used to set the i-th coefficients of the polynomial with a multiprecision rational number. More... | |
void | mps_monomial_poly_set_coefficient_d (mps_context *s, mps_monomial_poly *mp, long int i, double real_part, double imag_part) |
Set the coefficient in position i of the mpnomial. More... | |
void | mps_monomial_poly_set_coefficient_f (mps_context *s, mps_monomial_poly *p, long int i, mpc_t coeff) |
void | mps_monomial_poly_set_coefficient_int (mps_context *s, mps_monomial_poly *mp, long int i, long long real_part, long long imag_part) |
void | mps_monomial_poly_set_coefficient_s (mps_context *s, mps_monomial_poly *p, int i, const char *real_coeff, const char *imag_coeff) |
Set the ![]() | |
void | mps_monomial_poly_get_coefficient_d (mps_context *s, mps_monomial_poly *p, int i, cplx_t output) |
Get a double version of the ![]() | |
void | mps_monomial_poly_get_coefficient_q (mps_context *s, mps_monomial_poly *p, int i, mpq_t real_output, mpq_t imag_output) |
Get a rational version of the ![]() | |
mps_monomial_poly * | mps_monomial_poly_derive (mps_context *s, mps_monomial_poly *p, int k, long int wp) |
Get the k-th derivative of p with floating point coefficients approximated with the precision wp. More... | |
mps_boolean | mps_monomial_poly_feval (mps_context *ctx, mps_polynomial *p, cplx_t x, cplx_t value, double *error) |
mps_boolean | mps_monomial_poly_deval (mps_context *ctx, mps_polynomial *p, cdpe_t x, cdpe_t value, rdpe_t error) |
mps_boolean | mps_monomial_poly_meval (mps_context *ctx, mps_polynomial *p, mpc_t x, mpc_t value, rdpe_t error) |
void | mps_monomial_poly_fstart (mps_context *ctx, mps_polynomial *p, mps_approximation **approximations) |
void | mps_monomial_poly_dstart (mps_context *ctx, mps_polynomial *p, mps_approximation **approximations) |
void | mps_monomial_poly_mstart (mps_context *ctx, mps_polynomial *p, mps_approximation **approximations) |
void | mps_monomial_poly_fnewton (mps_context *ctx, mps_polynomial *p, mps_approximation *root, cplx_t corr) |
void | mps_monomial_poly_dnewton (mps_context *ctx, mps_polynomial *p, mps_approximation *root, cdpe_t corr) |
void | mps_monomial_poly_mnewton (mps_context *ctx, mps_polynomial *p, mps_approximation *root, mpc_t corr, long int wp) |
void | mps_monomial_poly_get_leading_coefficient (mps_context *ctx, mps_polynomial *p, mpc_t leading_coefficient) |
void | mps_monomial_poly_deflate (mps_context *ctx, mps_polynomial *p) |
mps_monomial_poly * | mps_monomial_poly_read_from_stream (mps_context *s, mps_input_buffer *buffer, mps_structure structure, mps_density density, long int precision) |
Parse the stream that has been loaded into buffer and that describe a mps_monomial_poly. More... | |
Implementation of the allocation and edit functions for the handling of monomial polynomials.
mps_monomial_poly * mps_monomial_poly_derive | ( | mps_context * | s, |
mps_monomial_poly * | p, | ||
int | k, | ||
long int | wp | ||
) |
Get the k-th derivative of p with floating point coefficients approximated with the precision wp.
s | The current mps_context |
p | The polynomial to derive |
k | The order of the derivative that should be computed. |
wp | The selected output working precision |
void mps_monomial_poly_get_coefficient_d | ( | mps_context * | s, |
mps_monomial_poly * | p, | ||
int | i, | ||
cplx_t | output | ||
) |
Get a double version of the
s | The current mps_context. |
p | The polynomial of which you want to know the coefficient. |
i | The degree of the coefficient to obtain. |
output | A cplx_t where the result will be stored. |
void mps_monomial_poly_get_coefficient_q | ( | mps_context * | s, |
mps_monomial_poly * | p, | ||
int | i, | ||
mpq_t | real_output, | ||
mpq_t | imag_output | ||
) |
Get a rational version of the
s | The current mps_context. |
p | The polynomial of which you want to know the coefficient. |
i | The degree of the coefficient to obtain. |
real_output | A mpq_t where the real part of the result will be stored. |
imag_output | A mpq_t where the imaginary part of the result will be stored. |
long int mps_monomial_poly_raise_precision | ( | mps_context * | s, |
mps_polynomial * | p, | ||
long int | prec | ||
) |
Raise the precision bits of the multiprecision fields of the polynomial to selected value.
If the polynomial coefficients were generated by integer or rational input they will be autoregenerated.
s | The status of the computation. |
p | The polynomial that need the precision raised, casted to a mps_polynomial. |
prec | The selected bits of precision. |
mps_monomial_poly * mps_monomial_poly_read_from_stream | ( | mps_context * | s, |
mps_input_buffer * | buffer, | ||
mps_structure | structure, | ||
mps_density | density, | ||
long int | precision | ||
) |
Parse the stream that has been loaded into buffer and that describe a mps_monomial_poly.
s | The current mps_context |
buffer | The buffer that needs to be parsed |
The | structure of the polynomial |
The | density configuration of the polynomial. |
The | input precision of the coefficients, if specified, 0 otherwise |
void mps_monomial_poly_set_coefficient_d | ( | mps_context * | s, |
mps_monomial_poly * | mp, | ||
long int | i, | ||
double | real_part, | ||
double | imag_part | ||
) |
Set the coefficient in position i of the mpnomial.
s | The mps_context associated to this computation. |
mp | The monomial_poly in which the coefficients will be set. |
i | The index of the coefficient to set. |
real_part | The real part of the coefficient. |
imag_part | The imaginary part of the coefficient. |
void mps_monomial_poly_set_coefficient_q | ( | mps_context * | s, |
mps_monomial_poly * | mp, | ||
long int | i, | ||
mpq_t | real_part, | ||
mpq_t | imag_part | ||
) |
This routine can be used to set the i-th coefficients of the polynomial with a multiprecision rational number.
s | The mps_context the will be used for the computation. This shall be passed along with the polynomial because it manages user interaction and can perform error handling. |
mp | The monomial_poly that will hold the coefficient. |
i | The exponent of the monomial to which the coefficient is related. |
real_part | The real part of the coefficient. |
imag_part | The imaginary part of the coefficients. |
void mps_monomial_poly_set_coefficient_s | ( | mps_context * | s, |
mps_monomial_poly * | p, | ||
int | i, | ||
const char * | real_coeff, | ||
const char * | imag_coeff | ||
) |
Set the
s | The current mps_context. |
p | The polynomial whose coefficient should be set. |
i | The degree of the coefficient to set. |
real_coeff | A string representing the real part of the coefficient that should be set, or NULL as an alias for ![]() |
imag_coeff | A string representing the imaginary part of the coefficient that should be set, or NULL as an alias for ![]() |