Changeset 2ae96e in git


Ignore:
Timestamp:
Apr 7, 2009, 3:30:01 PM (15 years ago)
Author:
Christian Eder
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
90645890f7b3880939698d798f2e0070f96285bc
Parents:
0ad81f2c92a459da3968f1add8868540fe570fb8
Message:
first exponent vector comparison procedures


git-svn-id: file:///usr/local/Singular/svn/trunk@11637 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/f5gb.cc

    r0ad81f r2ae96e  
    6464}
    6565
    66 /**
     66/*!
     67 * ======================================================================
     68 * builds the sum of the entries of the exponent vectors, i.e. the degree
     69 * of the corresponding monomial
     70 * ======================================================================
     71*/
     72long sumVector(int* v, int k) {
     73    int i;
     74    long sum =  0;
     75    for(i=1; i<=k; i++) {
     76        Print("%d\n",v[i]);
     77        Print("%ld\n",sum);
     78        sum =   sum + v[i];
     79    }
     80    return sum;
     81}
     82
     83/*!
    6784==========================================================================
    68 compare monomials, i.e. divisibility tests for criterion 1 and criterion 2
     85compares monomials, i.e. divisibility tests for criterion 1 and criterion 2
    6986==========================================================================
    7087*/
    71 bool compareMonomials(int* m1, int** m2, int numberOfRules) {
     88bool compareMonomials(int* m1, int** m2, int numberOfRules, int k) {
    7289    int i,j;
    73     int k   =   sizeof(m1) / sizeof(int);
     90    long sumM1  =   sumVector(m1,k);
     91    //int k   =   sizeof(m1) / sizeof(int);
    7492    for(i=0; i<numberOfRules; i++) {
    75         for(j=1; j<=k; j++) {
    76             if(m1[j]>m2[i][j]) {
    77                 return true;
    78             }
     93        if(sumVector(m2[i],k) <= sumM1) {
     94            for(j=1; j<=k; j++) {
     95                if(m1[j]>m2[i][j]) {
     96                    return true;
     97                }
     98            }   
    7999        }
    80100    }
     
    850870    number nOne =   nInit(1);
    851871    // tag the first element of index i-1 for criterion 1
    852     LTagList* lTag  =   new LTagList();
    853872    //Print("LTAG BEGINNING: %p\n",lTag);
    854873   
     
    857876   
    858877    int* ev = new int[r->N +1];
    859     int  ev2;
    860878    for(i=0;i<IDELEMS(id);i++) {
    861879        pGetExpV(id->m[i],ev);
    862880        //ev2  =   pGetExp(id->m[i],1);
    863881        pWrite(id->m[i]);
    864         Print("%d\n",ev2);
    865882        Print("EXP1: %d\n",ev[1]);
    866883        Print("EXP2: %d\n",ev[2]);
    867884        Print("EXP3: %d\n\n",ev[3]);
     885        Print("SUM: %ld\n\n\n",sumVector(ev,r->N));
    868886    }
    869887    delete ev;
     
    899917    //pWrite(gPrev->getFirst()->getPoly());
    900918
    901     lTag->insert(gPrev->getFirst());
     919    LTagList* lTag  =   new LTagList(gPrev->getFirst());
     920    //lTag->insert(gPrev->getFirst());
    902921    lTag->setFirstCurrentIdx(gPrev->getFirst());
    903922    // computing the groebner basis of the elements of index < actual index
     
    10381057    //gPrev->print();
    10391058    //delete lTag;
    1040     //delete rTag;
    1041     //delete gPrev;
     1059    delete rTag;
     1060    delete gPrev;
    10421061    reductionTime   =   0;
    10431062    spolsTime       =   0;
  • kernel/f5gb.h

    r0ad81f r2ae96e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: f5gb.h,v 1.35 2009-04-05 07:49:18 ederc Exp $ */
     4/* $Id: f5gb.h,v 1.36 2009-04-07 13:30:01 ederc Exp $ */
    55/*
    66* ABSTRACT: f5gb interface
     
    2020*/
    2121void qsortDegree(poly* left, poly* right);
     22
     23/*!
     24 * ======================================================================
     25 * builds the sum of the entries of the exponent vectors, i.e. the degree
     26 * of the corresponding monomial
     27 * ======================================================================
     28*/
     29long sumVector(int* v, int k);
    2230
    2331/**
Note: See TracChangeset for help on using the changeset viewer.