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

Function changeSecondVariable

factory/facFqFactorize.cc:2543–2588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2541}
2542
2543void
2544changeSecondVariable (CanonicalForm& A, CFList& biFactors, CFList& evaluation,
2545 CFList*& oldAeval, int lengthAeval2,
2546 const CFList& uniFactors, const Variable& w)
2547{
2548 Variable y= Variable (2);
2549 A= swapvar (A, y, w);
2550 int i= A.level();
2551 CanonicalForm evalPoint;
2552 for (CFListIterator iter= evaluation; iter.hasItem(); iter++, i--)
2553 {
2554 if (i == w.level())
2555 {
2556 evalPoint= iter.getItem();
2557 iter.getItem()= evaluation.getLast();
2558 evaluation.removeLast();
2559 evaluation.append (evalPoint);
2560 break;
2561 }
2562 }
2563 for (i= 0; i < lengthAeval2; i++)
2564 {
2565 if (oldAeval[i].isEmpty())
2566 continue;
2567 if (oldAeval[i].getFirst().level() == w.level())
2568 {
2569 CFArray tmp= copy (oldAeval[i]);
2570 oldAeval[i]= biFactors;
2571 for (CFListIterator iter= oldAeval[i]; iter.hasItem(); iter++)
2572 iter.getItem()= swapvar (iter.getItem(), w, y);
2573 for (int ii= 0; ii < tmp.size(); ii++)
2574 tmp[ii]= swapvar (tmp[ii], w, y);
2575 CFArray tmp2= CFArray (tmp.size());
2576 CanonicalForm buf;
2577 for (int ii= 0; ii < tmp.size(); ii++)
2578 {
2579 buf= tmp[ii] (evaluation.getLast(),y);
2580 buf /= Lc (buf);
2581 tmp2[findItem (uniFactors, buf)-1]=tmp[ii];
2582 }
2583 biFactors= CFList();
2584 for (int j= 0; j < tmp2.size(); j++)
2585 biFactors.append (tmp2[j]);
2586 }
2587 }
2588}
2589
2590void
2591distributeLCmultiplier (CanonicalForm& A, CFList& leadingCoeffs,

Callers 3

multiFactorizeFunction · 0.85
absFactorizeMainFunction · 0.85
multiFactorizeFunction · 0.85

Calls 13

VariableFunction · 0.85
copyFunction · 0.85
LcFunction · 0.85
findItemFunction · 0.85
hasItemMethod · 0.80
removeLastMethod · 0.80
swapvarFunction · 0.70
levelMethod · 0.45
getLastMethod · 0.45
appendMethod · 0.45
isEmptyMethod · 0.45
getFirstMethod · 0.45

Tested by

no test coverage detected