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

Method lift

kernel/numeric/mpr_base.cc:670–715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668}
669
670void pointSet::lift( int l[] )
671{
672 bool outerL= true;
673 int i, j;
674 int sum;
675
676 dim++;
677
678 if ( l==NULL )
679 {
680 outerL= false;
681 l= (int *)omAlloc( (dim+1) * sizeof(int) ); // [1..dim-1]
682
683 for(i = 1; i < dim; i++)
684 {
685 l[i]= 1 + siRand() % LIFT_COOR;
686 }
687 }
688 for ( j=1; j <= num; j++ )
689 {
690 sum= 0;
691 for ( i=1; i < dim; i++ )
692 {
693 sum += (int)points[j]->point[i] * l[i];
694 }
695 points[j]->point[dim]= sum;
696 }
697
698#ifdef mprDEBUG_ALL
699 PrintS(" lift vector: ");
700 for ( j=1; j < dim; j++ ) Print(" %d ",l[j] );
701 PrintLn();
702#ifdef mprDEBUG_ALL
703 PrintS(" lifted points: \n");
704 for ( j=1; j <= num; j++ )
705 {
706 Print("%d: <",j);print_exp(points[j],dim);PrintS(">\n");
707 }
708 PrintLn();
709#endif
710#endif
711
712 lifted= true;
713
714 if ( !outerL ) omFreeSize( (void *) l, (dim+1) * sizeof(int) );
715}
716//<-
717
718//-> global functions

Callers 1

resMatrixSparseMethod · 0.80

Calls 5

siRandFunction · 0.85
PrintSFunction · 0.85
print_expFunction · 0.85
PrintFunction · 0.50
PrintLnFunction · 0.50

Tested by

no test coverage detected