Defines | |
#define | IRPLIB_SWAP(a, b) { const double t=(a);(a)=(b);(b)=t; } |
#define | irplib_trace() |
Functions | |
static double | irplib_polynomial_eval_2_max (double p2, double p1, double p0, cpl_boolean is_c, double x1, double x2) |
Find the max residual on a 2nd degree 1D-polynomial on the roots. | |
static double | irplib_polynomial_eval_3_max (double p3, double p2, double p1, double p0, cpl_boolean is_c, double x1, double x2, double x3) |
Find the max residual on a 3rd degree 1D-polynomial on the roots. | |
static cpl_boolean | irplib_polynomial_solve_1d_2 (double, double, double, double *, double *) |
static cpl_boolean | irplib_polynomial_solve_1d_3 (double, double, double, double, double *, double *, double *, cpl_boolean *, cpl_boolean *) |
static void | irplib_polynomial_solve_1d_31 (double, double, double *, double *, double *, cpl_boolean *) |
static void | irplib_polynomial_solve_1d_32 (double, double, double, double *, double *, double *, cpl_boolean *) |
static void | irplib_polynomial_solve_1d_3r (double, double, double, double, double *, double *, double *) |
static void | irplib_polynomial_solve_1d_3c (double, double, double, double, double, double, double *, double *, double *, cpl_boolean *, cpl_boolean *) |
static cpl_error_code | irplib_polynomial_solve_1d_4 (double, double, double, double, double, cpl_size *, double *, double *, double *, double *) |
static cpl_error_code | irplib_polynomial_solve_1d_nonzero (cpl_polynomial *, cpl_vector *, cpl_size *) |
static cpl_error_code | irplib_polynomial_divide_1d_root (cpl_polynomial *, double, double *) |
cpl_error_code | irplib_polynomial_add (cpl_polynomial *self, const cpl_polynomial *first, const cpl_polynomial *second) |
Add two polynomials of the same dimension. | |
cpl_error_code | irplib_polynomial_subtract (cpl_polynomial *self, const cpl_polynomial *first, const cpl_polynomial *second) |
Subtract two polynomials of the same dimension. | |
cpl_error_code | irplib_polynomial_multiply_scalar (cpl_polynomial *self, const cpl_polynomial *other, double factor) |
Multiply a polynomial with a scalar. | |
cpl_error_code | irplib_polynomial_solve_1d_all (const cpl_polynomial *self, cpl_vector *roots, cpl_size *preal) |
Compute all n roots of p(x) = 0, where p(x) is of degree n, n > 0. |
static double irplib_polynomial_eval_2_max | ( | double | p2, | |
double | p1, | |||
double | p0, | |||
cpl_boolean | is_c, | |||
double | x1, | |||
double | x2 | |||
) | [static] |
Find the max residual on a 2nd degree 1D-polynomial on the roots.
p2 | p2 | |
p1 | p1 | |
p0 | p0 | |
is_c | CPL_TRUE iff the two roots are complex | |
x1 | The 1st point of evaluation (or real part on complex) | |
x2 | The 2nd point of evaluation (or imaginary part on complex) |
Definition at line 613 of file irplib_polynomial.c.
References irplib_trace.
Referenced by irplib_polynomial_solve_1d_2().
static double irplib_polynomial_eval_3_max | ( | double | p3, | |
double | p2, | |||
double | p1, | |||
double | p0, | |||
cpl_boolean | is_c, | |||
double | x1, | |||
double | x2, | |||
double | x3 | |||
) | [static] |
Find the max residual on a 3rd degree 1D-polynomial on the roots.
p3 | p3 | |
p2 | p2 | |
p1 | p1 | |
p0 | p0 | |
is_c | CPL_TRUE iff two roots are complex | |
x1 | The 1st point of evaluation (real) | |
x2 | The 2nd point of evaluation (or real part on complex) | |
x3 | The 3rd point of evaluation (or imaginary part on complex) |
Definition at line 650 of file irplib_polynomial.c.
References irplib_trace.
Referenced by irplib_polynomial_solve_1d_3().
cpl_error_code irplib_polynomial_add | ( | cpl_polynomial * | self, | |
const cpl_polynomial * | first, | |||
const cpl_polynomial * | second | |||
) |
Add two polynomials of the same dimension.
self | The polynomial to hold the result | |
first | The 1st polynomial to add | |
second | The 2nd polynomial to add |
Definition at line 134 of file irplib_polynomial.c.
cpl_error_code irplib_polynomial_subtract | ( | cpl_polynomial * | self, | |
const cpl_polynomial * | first, | |||
const cpl_polynomial * | second | |||
) |
Subtract two polynomials of the same dimension.
self | The polynomial to hold the result | |
first | The polynomial to subtract from | |
second | The polynomial to subtract |
Definition at line 195 of file irplib_polynomial.c.
cpl_error_code irplib_polynomial_multiply_scalar | ( | cpl_polynomial * | self, | |
const cpl_polynomial * | other, | |||
double | factor | |||
) |
Multiply a polynomial with a scalar.
self | The polynomial to hold the result | |
other | The polynomial to scale, may equal self | |
factor | The factor to multiply with |
Definition at line 253 of file irplib_polynomial.c.
cpl_error_code irplib_polynomial_solve_1d_all | ( | const cpl_polynomial * | self, | |
cpl_vector * | roots, | |||
cpl_size * | preal | |||
) |
Compute all n roots of p(x) = 0, where p(x) is of degree n, n > 0.
self | The 1D-polynomial | |
roots | A pre-allocated vector of length n to hold the roots | |
preal | The number of real roots found, or undefined on error |
Possible CPL error code set in this function:
Definition at line 310 of file irplib_polynomial.c.
References irplib_polynomial_solve_1d_nonzero().