 |
My Project
UNKNOWN_GIT_VERSION
|
Go to the source code of this file.
|
static modp_number | modp_mul (modp_number x, modp_number y) |
|
static modp_number | modp_sub (modp_number x, modp_number y) |
|
static modp_number | OneInverse (modp_number a, modp_number p) |
|
static int | CalcBaseDim () |
|
static bool | EqualMon (mono_type m1, mono_type m2) |
|
static exponent | MonDegree (mono_type mon) |
|
static bool | Greater (mono_type m1, mono_type m2) |
|
static mon_list_entry * | MonListAdd (mon_list_entry *list, mono_type mon) |
|
static mono_type | MonListElement (mon_list_entry *list, int n) |
|
static mono_type | ZeroMonomial () |
|
static void | GeneralInit () |
|
static void | InitProcData () |
|
static mon_list_entry * | FreeMonList (mon_list_entry *list) |
|
static void | GeneralDone () |
|
static void | FreeProcData () |
|
static void | modp_Evaluate (modp_number *ev, mono_type mon, condition_type con) |
|
static void | int_Evaluate (mpz_t ev, mono_type mon, condition_type con) |
|
static void | ProduceRow (mono_type mon) |
|
static void | IntegerPoints () |
|
static void | int_PrepareProducts () |
|
static void | modp_PrepareProducts () |
|
static void | MakeConditions () |
|
static void | ReduceRow () |
|
static bool | RowIsZero () |
|
static bool | DivisibleMon (mono_type m1, mono_type m2) |
|
static void | ReduceCheckListByMon (mono_type m) |
|
static void | TakeNextMonomial (mono_type mon) |
|
static void | UpdateCheckList (mono_type m) |
|
static void | ReduceCheckListByLTs () |
|
static void | RowListAdd (int first_col, mono_type mon) |
|
static void | PrepareRow (mono_type mon) |
|
static void | NewResultEntry () |
|
static void | FreeResultEntry (modp_result_entry *e) |
|
static void | NewGenerator (mono_type mon) |
|
static void | MultGenerators () |
|
static modp_number | TakePrime (modp_number) |
|
static void | PrepareChinese (int n) |
|
static void | CloseChinese () |
|
static void | ClearGCD () |
|
static void | ReconstructGenerator (int ngen, int n) |
|
static void | Discard () |
|
static void | modp_SetColumnNames () |
|
static void | CheckColumnSequence () |
|
static bool | CheckGenerator () |
|
static void | ClearGenList () |
|
static void | UpdateGenList () |
|
static void | modp_Main () |
|
static void | ResolveCoeff (mpq_t c, number m) |
|
ideal | interpolation (const std::vector< ideal > &L, intvec *v) |
|
◆ condition_type
◆ mon_list_entry_struct
struct mon_list_entry_struct |
◆ row_list_entry_struct
struct row_list_entry_struct |
◆ generator_struct
◆ modp_result_struct
struct modp_result_struct |
◆ gen_list_struct
◆ exponent
◆ modp_number
◆ unsortedmatrix
◆ coord_exist_table
◆ coordinate_products
◆ coordinates
◆ int_coordinates
◆ modp_coordinates
◆ mono_type
◆ q_coordinates
◆ CalcBaseDim()
static int CalcBaseDim |
( |
| ) |
|
|
static |
◆ CheckColumnSequence()
static void CheckColumnSequence |
( |
| ) |
|
|
static |
Definition at line 1221 of file interpolation.cc.
1227 PrintS(
"wrong number of generators occurred");
1237 PrintS(
"denom of coef divisible by p");
1244 generator_entry *cur_gen;
1245 mon_list_entry *cur_mon;
1250 if (!
EqualMon(cur_mon->mon,cur_gen->lt))
1253 PrintS(
"wrong leading term occurred");
1260 cur_gen=cur_gen->next;
1261 cur_mon=cur_mon->next;
1268 PrintS(
"wrong seq of cols occurred");
◆ CheckGenerator()
static bool CheckGenerator |
( |
| ) |
|
|
static |
Definition at line 1297 of file interpolation.cc.
1310 mpz_add(sum,sum,val);
1312 if (mpz_sgn(sum)!=0)
◆ ClearGCD()
◆ ClearGenList()
static void ClearGenList |
( |
| ) |
|
|
static |
◆ CloseChinese()
static void CloseChinese |
( |
| ) |
|
|
static |
◆ Discard()
Definition at line 1165 of file interpolation.cc.
1167 modp_result_entry *temp;
1186 PrintS(
"-discarding ALL.\n");
1189 modp_result_entry *ntfree;
1190 generator_entry *cur_gen;
1209 cur_gen=cur_gen->next;
◆ DivisibleMon()
◆ EqualMon()
◆ FreeMonList()
static mon_list_entry* FreeMonList |
( |
mon_list_entry * |
list | ) |
|
|
static |
◆ FreeProcData()
static void FreeProcData |
( |
| ) |
|
|
static |
◆ FreeResultEntry()
static void FreeResultEntry |
( |
modp_result_entry * |
e | ) |
|
|
static |
Definition at line 958 of file interpolation.cc.
960 generator_entry *cur_gen;
961 generator_entry *next_gen;
962 cur_gen=e->generator;
963 while (cur_gen!=
NULL)
965 next_gen=cur_gen->next;
◆ GeneralDone()
static void GeneralDone |
( |
| ) |
|
|
static |
◆ GeneralInit()
static void GeneralInit |
( |
| ) |
|
|
static |
◆ Greater()
◆ InitProcData()
static void InitProcData |
( |
| ) |
|
|
static |
◆ int_Evaluate()
Definition at line 550 of file interpolation.cc.
567 mpz_set_si(mon_conv,mn[
k]);
568 mpz_mul(ev,ev,mon_conv);
◆ int_PrepareProducts()
static void int_PrepareProducts |
( |
| ) |
|
|
static |
◆ IntegerPoints()
static void IntegerPoints |
( |
| ) |
|
|
static |
◆ interpolation()
ideal interpolation |
( |
const std::vector< ideal > & |
L, |
|
|
intvec * |
v |
|
) |
| |
Definition at line 1483 of file interpolation.cc.
1492 WerrorS(
"coefficient field should be Zp or Q!");
1497 WerrorS(
"quotient ring not supported!");
1502 WerrorS(
"ordering must be global!");
1508 WerrorS(
"list and intvec must have the same length!");
1527 PrintS(
"multiplicities: ");
1539 for(
i=0;
i<L.size();
i++)
1554 Print(
"coordinate %d for point %d initialized twice!\n",pcvar+1,
i+1);
1579 PrintS(
"not a variable? ");
1598 Print(
"coordinate %d for point %d not known!\n",
j+1,
i+1);
1607 WerrorS(
"data structure is invalid");
1622 bool correct_gen=
false;
1629 Print(
"trying %d cycles mod p...\n",modp_cycles);
1665 PrintS(
"wrong generator!\n");
1678 Print(
"maximal size of output: %d, precision bound: %d.\n",maximalsize,mpz_sizeinbase(
bigcongr,10));
1681 modp_cycles=modp_cycles+10;
1691 PrintS(
"computations finished.\n");
1700 WerrorS(
"internal error - coefficient too big!");
1731 cur_gen=cur_gen->next;
1745 if (mpz_sgn(temp->polycoef[a])!=0)
1751 mpz_init_set(n->z,temp->polycoef[a]);
◆ MakeConditions()
static void MakeConditions |
( |
| ) |
|
|
static |
◆ modp_Evaluate()
◆ modp_Main()
static void modp_Main |
( |
| ) |
|
|
static |
Definition at line 1404 of file interpolation.cc.
1420 cout <<
"row produced for monomial ";
1421 WriteMono (cur_mon);
1433 cout <<
"row is zero - linear dependence found (should be seen in my_solve_row)" << endl;
1434 cout <<
"monomial added to leading terms list" << endl;
1435 cout <<
"check list updated" << endl;
1445 cout <<
"row is non-zero" << endl;
1446 cout <<
"monomial added to quotient basis list" << endl;
1447 cout <<
"new monomials added to check list" << endl;
1448 cout <<
"check list reduced by monomials from leading term list" << endl;
1453 cout <<
"row prepared and put into matrix" << endl;
◆ modp_mul()
◆ modp_PrepareProducts()
static void modp_PrepareProducts |
( |
| ) |
|
|
static |
◆ modp_SetColumnNames()
static void modp_SetColumnNames |
( |
| ) |
|
|
static |
◆ modp_sub()
◆ MonDegree()
◆ MonListAdd()
static mon_list_entry* MonListAdd |
( |
mon_list_entry * |
list, |
|
|
mono_type |
mon |
|
) |
| |
|
static |
Definition at line 298 of file interpolation.cc.
300 mon_list_entry *curptr=list;
301 mon_list_entry *prevptr=
NULL;
302 mon_list_entry *temp;
306 if (
EqualMon (mon,(*curptr).mon))
return list;
307 if (
Greater ((*curptr).mon,mon))
break;
311 temp=(mon_list_entry*)
omAlloc0(
sizeof(mon_list_entry));
315 if (prevptr==
NULL)
return temp;
◆ MonListElement()
static mono_type MonListElement |
( |
mon_list_entry * |
list, |
|
|
int |
n |
|
) |
| |
|
static |
Definition at line 323 of file interpolation.cc.
325 mon_list_entry *cur=list;
327 for (
i=0;
i<n;
i++) cur=cur->next;
◆ MultGenerators()
static void MultGenerators |
( |
| ) |
|
|
static |
Definition at line 999 of file interpolation.cc.
1001 #ifndef integerstrategy
1003 generator_entry *cur_ptr;
1005 while (cur_ptr!=
NULL)
1010 cur_ptr=cur_ptr->next;
◆ NewGenerator()
Definition at line 975 of file interpolation.cc.
977 generator_entry *cur_ptr;
978 generator_entry *prev_ptr;
979 generator_entry *temp;
982 while (cur_ptr!=
NULL)
985 cur_ptr=cur_ptr->next;
987 temp=(generator_entry*)
omAlloc0(
sizeof(generator_entry));
989 else prev_ptr->next=temp;
◆ NewResultEntry()
static void NewResultEntry |
( |
| ) |
|
|
static |
Definition at line 936 of file interpolation.cc.
938 modp_result_entry *temp;
939 temp=(modp_result_entry*)
omAlloc0(
sizeof(modp_result_entry));
◆ OneInverse()
Definition at line 221 of file interpolation.cc.
223 long u,
v, u0, u1, u2, q, r;
238 if ((u1<0)||((u1*a)%
p!=1))
244 if ((a*
i)%
p==1)
return i;
◆ PrepareChinese()
static void PrepareChinese |
( |
int |
n | ) |
|
|
static |
Definition at line 1043 of file interpolation.cc.
1046 modp_result_entry *cur_ptr;
1053 while (cur_ptr!=
NULL)
1055 *congr_ptr=cur_ptr->p;
1056 cur_ptr=cur_ptr->next;
◆ PrepareRow()
◆ ProduceRow()
◆ ReconstructGenerator()
static void ReconstructGenerator |
( |
int |
ngen, |
|
|
int |
n |
|
) |
| |
|
static |
Definition at line 1100 of file interpolation.cc.
1105 str=(
char*)
omAlloc0(
sizeof(
char)*1000);
1106 modp_result_entry *cur_ptr;
1107 generator_entry *cur_gen;
1121 while (cur_ptr!=
NULL)
1123 cur_gen=cur_ptr->generator;
1124 for (
j=0;
j<ngen;
j++) cur_gen=cur_gen->next;
1126 cur_ptr=cur_ptr->next;
1135 if (temp<0) temp=temp+
congr[
k];
1138 mpz_set_si(sol,
v[n-1]);
1139 for (
k=n-2;
k>=0;
k--)
1141 mpz_mul_ui(sol,sol,
congr[
k]);
1142 mpz_add_ui(sol,sol,
v[
k]);
1145 int s=mpz_cmpabs(sol,nsol);
1146 if (
s>0) mpz_set(sol,nsol);
1153 size=mpz_sizeinbase(sol,10);
1154 if (
size>maximal_size) maximal_size=
size;
◆ ReduceCheckListByLTs()
static void ReduceCheckListByLTs |
( |
| ) |
|
|
static |
◆ ReduceCheckListByMon()
static void ReduceCheckListByMon |
( |
mono_type |
m | ) |
|
|
static |
Definition at line 793 of file interpolation.cc.
795 mon_list_entry *c_ptr;
796 mon_list_entry *p_ptr;
797 mon_list_entry *n_ptr;
807 p_ptr->next=c_ptr->next;
◆ ReduceRow()
static void ReduceRow |
( |
| ) |
|
|
static |
Definition at line 695 of file interpolation.cc.
698 row_list_entry *row_ptr;
707 #ifdef integerstrategy
712 while (row_ptr!=
NULL)
714 cur_row_ptr=row_ptr->row_matrix;
715 solve_row_ptr=row_ptr->row_solve;
718 first_col=row_ptr->first_col;
719 cur_row_ptr=cur_row_ptr+first_col;
720 my_row_ptr=my_row_ptr+first_col;
724 #ifdef integerstrategy
725 prep_val=*cur_row_ptr;
731 if (*m_row_ptr!=0) *m_row_ptr=
modp_mul(*m_row_ptr,prep_val);
737 if (*m_row_ptr!=0) *m_row_ptr=
modp_mul(*m_row_ptr,prep_val);
746 mul_val=
modp_mul(*cur_row_ptr,red_val);
747 *my_row_ptr=
modp_sub(*my_row_ptr,mul_val);
754 if (*solve_row_ptr!=0)
756 mul_val=
modp_mul(*solve_row_ptr,red_val);
757 *my_solve_row_ptr=
modp_sub(*my_solve_row_ptr,mul_val);
763 row_ptr=row_ptr->next;
765 PrintS(
"reduction by row ");
◆ ResolveCoeff()
static void ResolveCoeff |
( |
mpq_t |
c, |
|
|
number |
m |
|
) |
| |
|
static |
Definition at line 1461 of file interpolation.cc.
1466 mpq_set_si(c,m_val,1);
1472 mpz_set(mpq_numref(c),
m->z);
1473 mpz_set(mpq_denref(c),
m->n);
1474 mpq_canonicalize(c);
◆ RowIsZero()
static bool RowIsZero |
( |
| ) |
|
|
static |
◆ RowListAdd()
static void RowListAdd |
( |
int |
first_col, |
|
|
mono_type |
mon |
|
) |
| |
|
static |
Definition at line 856 of file interpolation.cc.
859 row_list_entry *pptr;
860 row_list_entry *temp;
865 #ifndef unsortedmatrix
866 if ( first_col <= ptr->first_col )
break;
871 temp=(row_list_entry*)
omAlloc0(
sizeof(row_list_entry));
876 (*temp).first_col=first_col;
◆ TakeNextMonomial()
static void TakeNextMonomial |
( |
mono_type |
mon | ) |
|
|
static |
◆ TakePrime()
◆ UpdateCheckList()
◆ UpdateGenList()
static void UpdateGenList |
( |
| ) |
|
|
static |
Definition at line 1343 of file interpolation.cc.
1345 gen_list_entry *temp,*prev;
1364 temp=(gen_list_entry*)
omAlloc0(
sizeof(gen_list_entry));
1371 mpz_init(temp->polycoef[
i]);
◆ ZeroMonomial()
◆ bad_primes
◆ base_list
mon_list_entry* base_list |
|
static |
◆ bigcongr
◆ check_list
mon_list_entry* check_list |
|
static |
◆ column_name
◆ common_denom
◆ comparizon_p1
◆ comparizon_p2
◆ condition_list
◆ congr
◆ coord_exist
◆ cur_result
modp_result_entry* cur_result |
|
static |
◆ denom_divisible
◆ final_base_dim
◆ gen_list
gen_list_entry* gen_list =NULL |
|
static |
◆ generic_column_name
◆ generic_lt
mon_list_entry* generic_lt =NULL |
|
static |
◆ generic_n_generators
◆ good_primes
◆ in_gamma
◆ int_points
◆ last_solve_column
◆ lt_list
◆ max_coord
◆ modp_denom
◆ modp_points
◆ modp_result
modp_result_entry* modp_result |
|
static |
◆ modp_Reverse
◆ multiplicity
◆ my_row
◆ my_solve_row
◆ myp
◆ myp_index
◆ n_points
◆ n_results
◆ only_modp
◆ points
◆ polycoef
◆ polyexp
◆ protocol
◆ q_points
◆ row_list
◆ variables
static void modp_PrepareProducts()
static void FreeProcData()
static void ReduceCheckListByMon(mono_type m)
static mon_list_entry * FreeMonList(mon_list_entry *list)
static void NewGenerator(mono_type mon)
static void MultGenerators()
static poly comparizon_p1
static void int_PrepareProducts()
static void GeneralInit()
static modp_number * congr
const CanonicalForm int const CFList const Variable & y
static modp_number * my_row
static mon_list_entry * lt_list
static modp_coordinates * modp_points
static void InitProcData()
static coord_exist_table * coord_exist
static condition_type * condition_list
static void ProduceRow(mono_type mon)
static coordinates * points
static void UpdateCheckList(mono_type m)
static void modp_Evaluate(modp_number *ev, mono_type mon, condition_type con)
static void modp_SetColumnNames()
static void CheckColumnSequence()
static void TakeNextMonomial(mono_type mon)
static modp_number modp_denom
static mono_type MonListElement(mon_list_entry *list, int n)
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
static mono_type * polyexp
static void int_Evaluate(mpz_t ev, mono_type mon, condition_type con)
static bool DivisibleMon(mono_type m1, mono_type m2)
static bool Greater(mono_type m1, mono_type m2)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static void PrepareRow(mono_type mon)
static row_list_entry * row_list
static gen_list_entry * gen_list
static void ReduceCheckListByLTs()
void PrintS(const char *s)
static mono_type * column_name
static mon_list_entry * check_list
static poly comparizon_p2
void * malloc(size_t size)
static mono_type ZeroMonomial()
static modp_number * in_gamma
static mon_list_entry * base_list
static modp_number TakePrime(modp_number)
static int final_base_dim
static bool denom_divisible
static void ReconstructGenerator(int ngen, int n)
static bool EqualMon(mono_type m1, mono_type m2)
static void FreeResultEntry(modp_result_entry *e)
modp_number * coordinate_products
static q_coordinates * q_points
static void PrepareChinese(int n)
static void MakeConditions()
static void ResolveCoeff(mpq_t c, number m)
coordinate_products * coordinates
static modp_number * modp_Reverse
modp_number * modp_coordinates
static mono_type * generic_column_name
static mpz_t common_denom
static void NewResultEntry()
static mon_list_entry * MonListAdd(mon_list_entry *list, mono_type mon)
int cf_getSmallPrime(int i)
ideal idInit(int idsize, int rank)
initialise an ideal / module
static mon_list_entry * generic_lt
void WerrorS(const char *s)
static modp_result_entry * cur_result
static void UpdateGenList()
static exponent MonDegree(mono_type mon)
static modp_number OneInverse(modp_number a, modp_number p)
static int last_solve_column
static void IntegerPoints()
static void CloseChinese()
const Variable & v
< [in] a sqrfree bivariate poly
static int generic_n_generators
const CanonicalForm int s
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
static bool CheckGenerator()
static modp_number modp_mul(modp_number x, modp_number y)
static int_coordinates * int_points
int cf_getNumSmallPrimes()
static int * multiplicity
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
static BOOLEAN rField_is_Zp(const ring r)
static void RowListAdd(int first_col, mono_type mon)
static void GeneralDone()
static void ClearGenList()
static modp_number * my_solve_row
static modp_result_entry * modp_result
static modp_number modp_sub(modp_number x, modp_number y)
static BOOLEAN rField_is_Q(const ring r)