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

Function id_ReadOutPivot

kernel/ideals.cc:2695–2772  ·  view source on GitHub ↗

3 * searches for the next unit in the components of the module arg and * returns the first one; */

Source from the content-addressed store, hash-verified

2693* returns the first one;
2694*/
2695static int id_ReadOutPivot(ideal arg,int* comp, const ring r)
2696{
2697 int i=0,j, generator=-1;
2698 int rk_arg=arg->rank; //idRankFreeModule(arg);
2699 int * componentIsUsed =(int *)omAlloc((rk_arg+1)*sizeof(int));
2700 poly p;
2701
2702 while ((generator<0) && (i<IDELEMS(arg)))
2703 {
2704 memset(componentIsUsed,0,(rk_arg+1)*sizeof(int));
2705 p = arg->m[i];
2706 if (rField_is_Ring(r))
2707 {
2708 while (p!=NULL)
2709 {
2710 j = __p_GetComp(p,r);
2711 if (componentIsUsed[j]==0)
2712 {
2713 if (p_LmIsConstantComp(p,r) &&
2714 n_IsUnit(pGetCoeff(p),r->cf))
2715 {
2716 generator = i;
2717 componentIsUsed[j] = 1;
2718 }
2719 else
2720 {
2721 componentIsUsed[j] = -1;
2722 }
2723 }
2724 else if (componentIsUsed[j]>0)
2725 {
2726 (componentIsUsed[j])++;
2727 }
2728 pIter(p);
2729 }
2730 }
2731 else
2732 {
2733 while (p!=NULL)
2734 {
2735 j = __p_GetComp(p,r);
2736 if (componentIsUsed[j]==0)
2737 {
2738 if (p_LmIsConstantComp(p,r))
2739 {
2740 generator = i;
2741 componentIsUsed[j] = 1;
2742 }
2743 else
2744 {
2745 componentIsUsed[j] = -1;
2746 }
2747 }
2748 else if (componentIsUsed[j]>0)
2749 {
2750 (componentIsUsed[j])++;
2751 }
2752 pIter(p);

Callers 1

idMinEmbedding1Function · 0.85

Calls 2

p_LmIsConstantCompFunction · 0.85
n_IsUnitFunction · 0.85

Tested by

no test coverage detected