MCPcopy Create free account
hub / github.com/Singular/Singular / drop_elimination_variables

Method drop_elimination_variables

IntegerProgramming/binomial.cc:1376–1444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1374
1375
1376BOOLEAN binomial::drop_elimination_variables(const term_ordering& w)
1377{
1378 _number_of_variables-=w.number_of_elimination_variables();
1379 // dangerous (no compatibility check)!!
1380
1381 // copy components of interest to save memory
1382 // the leading term has to be recomputed!!
1383
1384 Integer *aux=exponent_vector;
1385 exponent_vector=new Integer[_number_of_variables];
1386
1387 if(w.weight(aux)>=0)
1388 for(short i=0;i<_number_of_variables;i++)
1389 exponent_vector[i]=aux[i];
1390 else
1391 for(short i=0;i<_number_of_variables;i++)
1392 exponent_vector[i]=-aux[i];
1393
1394 delete[] aux;
1395
1396
1397#ifdef SUPPORT_DRIVEN_METHODS
1398
1399 // Recompute head and tail.
1400 // Normally, this routine is only called for binomials that do not involve
1401 // the variables to eliminate. But if SUPPORT_VARIABLES_LAST is enabled,
1402 // the support changes in spite of this. Therefore, the support is
1403 // recomputed... For the same reasons as mentioned in the preceding
1404 // routine, the existing support information is not used.
1405
1406 head_support=0;
1407 tail_support=0;
1408 short size_of_support_vectors=CHAR_BIT*sizeof(unsigned long);
1409 if(size_of_support_vectors>_number_of_variables)
1410 size_of_support_vectors=_number_of_variables;
1411
1412
1413#ifdef SUPPORT_VARIABLES_FIRST
1414
1415 for(short i=0;i<size_of_support_vectors;i++)
1416 {
1417 Integer actual_entry=exponent_vector[i];
1418 if(actual_entry>0)
1419 head_support|=(1<<i);
1420 else if(actual_entry[i]<0)
1421 tail_support|=(1<<i);
1422 }
1423
1424#endif // SUPPORT_VARIABLES_FIRST
1425
1426
1427#ifdef SUPPORT_VARIABLES_LAST
1428
1429 for(short i=0;i<size_of_support_vectors;i++)
1430 {
1431 Integer actual_entry=exponent_vector[_number_of_variables-1-i];
1432 if(actual_entry>0)
1433 head_support|=(1<<i);

Callers 1

ideal_stuff.ccFile · 0.80

Calls 2

weightMethod · 0.45

Tested by

no test coverage detected