Debian Codegraph @

examples/quadratic-solver/quadratic-poly.h

raw
1 /*
2 * This file is part of MPSolve 3.0
3 *
4 * Copyright (C) 2001-2013, Dipartimento di Matematica "L. Tonelli", Pisa.
5 * License: http://www.gnu.org/licenses/gpl.html GPL version 3 or higher
6 *
7 * Authors:
8 * Leonardo Robol <[email protected]>
9 */
10
11 #include <mps/mps.h>
12
13 #define MPS_QUADRATIC_POLY(t) (MPS_POLYNOMIAL_CAST (mps_quadratic_poly, t))
14 #define MPS_IS_QUADRATIC_POLY(t) (mps_polynomial_check_type (t, "mps_quadratic_poly"))
15
16 struct mps_quadratic_poly {
17 mps_polynomial p;
18 int level;
19 };
20
21 typedef struct mps_quadratic_poly mps_quadratic_poly;
22
23 mps_quadratic_poly *mps_quadratic_poly_new (mps_context * ctx, int level);
24 void mps_quadratic_poly_free (mps_context * ctx, mps_polynomial *p);
25
26 void mps_quadratic_poly_fstart (mps_context *ctx, mps_polynomial *p, mps_approximation ** approximations);
27 void mps_quadratic_poly_dstart (mps_context *ctx, mps_polynomial *p, mps_approximation ** approximations);
28
29 void mps_quadratic_poly_fnewton (mps_context * s, mps_polynomial * poly, mps_approximation * root, cplx_t corr);
30 void mps_quadratic_poly_dnewton (mps_context * s, mps_polynomial * poly, mps_approximation * root, cdpe_t corr);
31 void mps_quadratic_poly_mnewton (mps_context * s, mps_polynomial * poly, mps_approximation * root, mpc_t corr, long int wp);
32
33 mps_boolean mps_quadratic_poly_feval (mps_context * ctx, mps_polynomial * p, cplx_t x, cplx_t value, double * error);
34 mps_boolean mps_quadratic_poly_deval (mps_context * ctx, mps_polynomial * p, cdpe_t x, cdpe_t value, rdpe_t error);
35 mps_boolean mps_quadratic_poly_meval (mps_context * ctx, mps_polynomial * p, mpc_t x, mpc_t value, rdpe_t error);
36