Révision 128 pobysoC-4.0/src/pobyso.h
pobyso.h (revision 128) | ||
---|---|---|
19 | 19 |
|
20 | 20 |
#ifndef POBYSO_h |
21 | 21 |
|
22 |
/* Typedefs to make code more readable. */ |
|
23 |
typedef sollya_obj_t pobyso_error_t; |
|
24 |
typedef sollya_obj_t pobyso_function_t; |
|
25 |
typedef sollya_obj_t pobyso_precision_t; |
|
26 |
typedef sollya_obj_t pobyso_range_t; |
|
27 |
|
|
28 |
typedef sollya_obj_t sollya_verbosity_t; |
|
29 |
|
|
22 | 30 |
#define POBYSO_ABSOLUTE 1 |
23 | 31 |
#define POBYSO_RELATIVE 2 |
32 |
|
|
24 | 33 |
/* Mimic the default behavior of interactive Sollya. */ |
25 | 34 |
#define POBYSO_DEFAULT_POINTS 501 |
26 | 35 |
#define POBYSO_INF_NORM_NUM_POINTS (POBYSO_DEFAULT_POINTS) |
27 | 36 |
#define POBYSO_GUESS_DEGREE_BOUND 1024 |
28 | 37 |
|
38 |
|
|
39 |
/* Very thin wrappers around a lot of Sollya functions. |
|
40 |
*/ |
|
41 |
static inline pobyso_error_t pobyso_error(void) |
|
42 |
{return(sollya_lib_error());} |
|
43 |
|
|
44 |
static inline int pobyso_is_error(sollya_obj_t errorCandidate) |
|
45 |
{return(sollya_lib_obj_is_error(errorCandidate));} |
|
46 |
|
|
47 |
static inline int pobyso_is_function(sollya_obj_t functionCandidate) |
|
48 |
{return(sollya_lib_obj_is_function(functionCandidate));} |
|
49 |
|
|
29 | 50 |
/** |
30 | 51 |
* Print object(s) to stdout. |
31 | 52 |
* A very thin wrapper around the lib_sollya_v_autoprint() function. |
... | ... | |
50 | 71 |
* function. |
51 | 72 |
* @return a Sollya expression if successes, a Sollya error if fails. |
52 | 73 |
*/ |
53 |
sollya_obj_t |
|
74 |
pobyso_error_t |
|
75 |
pobyso_parse(const char* expression); |
|
76 |
|
|
77 |
/** |
|
78 |
* A wrapper around the Sollya Remez function. |
|
79 |
*/ |
|
80 |
/** |
|
81 |
* Parse a string to create a Sollya object. |
|
82 |
* A very thin wrapper around the sollya_lib_parse_string() function. |
|
83 |
* If the final ";" is forgotten in the expression, it is added by the |
|
84 |
* function. |
|
85 |
* @return a Sollya expression if successes, a Sollya error if fails. |
|
86 |
*/ |
|
87 |
pobyso_error_t |
|
54 | 88 |
pobyso_parse_string(const char* expression); |
55 | 89 |
|
56 | 90 |
/** |
91 |
* A wrapper around the Sollya Remez function with the canonical monomials |
|
92 |
* base. |
|
93 |
*/ |
|
94 |
|
|
95 |
pobyso_function_t |
|
96 |
pobyso_remez_canonical_monomials_base(pobyso_function_t function, |
|
97 |
long int degree, |
|
98 |
pobyso_range_t interval, |
|
99 |
pobyso_function_t weight, |
|
100 |
double quality, |
|
101 |
pobyso_range_t bounds); |
|
102 |
|
|
103 |
/** |
|
104 |
* A wrapper around the Sollya Remez function with the a sparse monomials |
|
105 |
* base. |
|
106 |
*/ |
|
107 |
|
|
108 |
pobyso_function_t |
|
109 |
pobyso_remez_sparse_monomials_base(pobyso_function_t); |
|
110 |
|
|
111 |
/** |
|
112 |
* A wrapper around the Sollya Remez function with the canonical monomials |
|
113 |
* base. |
|
114 |
*/ |
|
115 |
|
|
116 |
pobyso_function_t |
|
117 |
pobyso_remez_arbitrary_base(pobyso_function_t); |
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
/** |
|
57 | 122 |
* Set the verbosity mode off (level 0). |
58 |
* If currentVerbosity != NULL, currentVerbosity is set |
|
59 |
* to the current verbosity level. It may be used to reset the |
|
60 |
* verbosity level later. |
|
123 |
* The current level of vebositiy is returned. |
|
61 | 124 |
*/ |
62 |
void
|
|
63 |
pobyso_set_verbosity_off(sollya_obj_t* currentVerbosityLevel);
|
|
125 |
sollya_verbosity_t
|
|
126 |
pobyso_set_verbosity_off(void);
|
|
64 | 127 |
|
65 | 128 |
/** |
66 | 129 |
* Set the verbosity level to newVerbosityLevel. |
67 | 130 |
* @param newVerbosityLevel must be a Sollay object corresponding to an |
68 | 131 |
* integer constant. |
69 | 132 |
*/ |
70 |
void
|
|
133 |
sollya_verbosity_t
|
|
71 | 134 |
pobyso_set_verbosity_to(sollya_obj_t newVerbosityLevel); |
72 | 135 |
|
73 | 136 |
#if 0 |
Formats disponibles : Unified diff