Polynomial functions


Defines

#define poly_deg(p)   (vec_length(p) - 1)
#define poly_ediv(a, b, _q)   lpoly_ediv(a, b, 0, _q)

Typedefs

typedef vec ** pmat
typedef vecpvec

Functions

static pmat pmat_new (int W, int H)
static void pmat_delete (pmat m)
static pvec pvec_new (int N)
static void pvec_delete (pvec v)
 it_function_args (itf_polynomial)
void poly_normalize (vec v)
 remove null factors from the polynomial
int poly_is_null (vec v)
static double poly_eval (vec v, double x)
void poly_shift (vec v, int shift)
vec poly_add (vec a, vec b)
vec poly_sub (vec a, vec b)
static vec poly_mul (vec a, vec b)
vec lpoly_ediv (vec _a, vec _b, int deg_x, vec *_q)
static vec poly_div (vec a, vec b)
static vec poly_mod (vec a, vec b)
vec poly_gcd (vec a, vec b)
vec _lpoly_ediv (vec a, vec b, int deg_x, vec *_q)
 it_function (itf_polynomial)

Variables

it_function_t itf_polynomial

Detailed Description

Copyright (C) 2005-2007 Vivien Chappelier

Define Documentation

#define poly_deg (  )     (vec_length(p) - 1)

Definition at line 64 of file poly.h.

Referenced by _lpoly_ediv(), it_function(), and lpoly_ediv().

#define poly_ediv ( a,
b,
_q   )     lpoly_ediv(a, b, 0, _q)

Definition at line 102 of file poly.h.

Referenced by poly_div(), and poly_mod().


Typedef Documentation

typedef vec** pmat

Definition at line 38 of file poly.h.

typedef vec* pvec

Definition at line 48 of file poly.h.


Function Documentation

vec _lpoly_ediv ( vec  a,
vec  b,
int  deg_x,
vec _q 
)

Definition at line 122 of file poly.c.

References poly_deg, vec_new(), and vec_null.

Referenced by lpoly_ediv().

it_function ( itf_polynomial   ) 

Definition at line 208 of file poly.c.

References poly_deg.

it_function_args ( itf_polynomial   ) 

Definition at line 58 of file poly.h.

vec lpoly_ediv ( vec  _a,
vec  _b,
int  deg_x,
vec _q 
)

Definition at line 166 of file poly.c.

References _lpoly_ediv(), it_assert, poly_deg, poly_normalize(), vec_clone(), and vec_delete().

static void pmat_delete ( pmat  m  )  [inline, static]

Definition at line 43 of file poly.h.

References Mat_delete.

static pmat pmat_new ( int  W,
int  H 
) [inline, static]

Definition at line 40 of file poly.h.

References Mat_new.

Referenced by main().

vec poly_add ( vec  a,
vec  b 
)

Definition at line 76 of file poly.c.

References poly_normalize(), vec_length(), and vec_set_length.

Referenced by main().

static vec poly_div ( vec  a,
vec  b 
) [inline, static]

Definition at line 105 of file poly.h.

References poly_ediv, and vec_delete().

Referenced by main().

static double poly_eval ( vec  v,
double  x 
) [inline, static]

Definition at line 73 of file poly.h.

References it_function_args, and itf_polynomial.

Referenced by main().

vec poly_gcd ( vec  a,
vec  b 
)

Definition at line 187 of file poly.c.

References poly_is_null(), poly_mod(), poly_normalize(), vec_clone(), and vec_delete().

Referenced by main().

int poly_is_null ( vec  v  ) 

Definition at line 64 of file poly.c.

References vec_length().

Referenced by poly_gcd().

static vec poly_mod ( vec  a,
vec  b 
) [inline, static]

Definition at line 113 of file poly.h.

References poly_ediv, and vec_delete().

Referenced by main(), and poly_gcd().

static vec poly_mul ( vec  a,
vec  b 
) [inline, static]

Definition at line 92 of file poly.h.

References vec_conv().

Referenced by main().

void poly_normalize ( vec  v  ) 

remove null factors from the polynomial

e.g. 0 X^2 + X + 1 becomes X + 1

Definition at line 33 of file poly.c.

References vec_length(), and vec_set_length.

Referenced by lpoly_ediv(), poly_add(), poly_gcd(), and poly_sub().

void poly_shift ( vec  v,
int  shift 
)

Definition at line 47 of file poly.c.

References vec_length().

vec poly_sub ( vec  a,
vec  b 
)

Definition at line 97 of file poly.c.

References poly_normalize(), vec_length(), and vec_set_length.

Referenced by main().

static void pvec_delete ( pvec  v  )  [inline, static]

Definition at line 53 of file poly.h.

References Vec_delete.

static pvec pvec_new ( int  N  )  [inline, static]

Definition at line 50 of file poly.h.

References Vec_new.

Referenced by main().


Variable Documentation


Hosted by
Copyright (C) 2005-2006 Hervé Jégou
Vivien Chappelier
Francois Cayre
libit logo courtesy of Jonathan Delhumeau