PIPS
|
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "polynome.h"
Go to the source code of this file.
Functions | |
void | polynome_error (const char *name, char *fmt,...) |
INTLIBRARY. More... | |
void | good_polynome_assert (char *function,...) |
void good_polynome_assert(va_alist) Check if the second argument is a valid polynomial. More... | |
bool | monome_check (Pmonome pm) |
bool monome_check(Pmonome pm) Return true if all's right. More... | |
bool | polynome_check (Ppolynome pp) |
bool polynome_check(Ppolynome pp) Return true if all's right. More... | |
bool | is_polynome_a_monome (Ppolynome pp) |
bool is_polynome_a_monome(Ppolynome pp) Return true if the pp is just a monome. More... | |
void good_polynome_assert | ( | char * | function, |
... | |||
) |
void good_polynome_assert(va_alist) Check if the second argument is a valid polynomial.
If not, print first argument ((char *) function name) and abort.
function | unction |
Definition at line 84 of file pnome-error.c.
References abort, fprintf(), and polynome_check().
Referenced by polynome_monome_add(), and polynome_monome_addition().
bool is_polynome_a_monome(Ppolynome pp) Return true if the pp is just a monome.
that means the polynom has only one term Check each monomial, make sure there's no nul or undefined monomial, then check unicity of each monomial.
LZ 06 Nov. 92
pp | p |
Definition at line 162 of file pnome-error.c.
References polynome_check(), POLYNOME_NUL, and polynome_succ.
Referenced by polynome_power_n().
bool monome_check(Pmonome pm) Return true if all's right.
Looks if pm is MONOME_UNDEFINED; if not: make sure that the coeff is non nul, that the term is non nul, and checks the (Pvecteur) term. All this also checks that pm is pointing to a valid address.
Modification:
pm | m |
Definition at line 110 of file pnome-error.c.
References monome_coeff, MONOME_NUL_P, monome_term, MONOME_UNDEFINED_P, vect_check(), and VECTEUR_NUL_P.
Referenced by polynome_check().
bool polynome_check(Ppolynome pp) Return true if all's right.
Check each monomial, make sure there's no nul or undefined monomial, then check unicity of each monomial.
Modification:
pp | p |
Definition at line 131 of file pnome-error.c.
References monome_check(), monome_colin(), polynome_monome, POLYNOME_NUL, POLYNOME_NUL_P, polynome_succ, and POLYNOME_UNDEFINED_P.
Referenced by complexity_check(), good_polynome_assert(), and is_polynome_a_monome().
void polynome_error | ( | const char * | name, |
char * | fmt, | ||
... | |||
) |
INTLIBRARY.
void polynome_error(va_dcl va_list): should be called to terminate execution and to core dump when data structures are corrupted or when an undefined operation is requested (zero divide for instance). polynome_error should be called as:
polynome_error(function_name, format, expression-list)
where function_name is a string containing the name of the function calling POLYNOME_ERROR, and where format and expression-list are passed as arguments to vprintf. POLYNOME_ERROR terminates execution with abort. Ex: polynome_error("polynome_power_n", "negative power: %d\n", p); ARARGS0
print name of function causing error
print out remainder of message
create a core file for debug
name | ame |
fmt | mt |
Definition at line 62 of file pnome-error.c.
References abort, and fprintf().
Referenced by Bernouilli(), factorielle(), monome_monome_div(), polynome_equal(), polynome_power_n(), polynome_roots(), polynome_sum_of_power(), and polynome_used_var().