Changeset 8627ad in git


Ignore:
Timestamp:
Jun 26, 2008, 6:05:21 PM (16 years ago)
Author:
Christian Eder
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
cf4f984ee6d7c9c1a66934b0144d4e0d64c11b01
Parents:
4bf7611fbd40e148feb7eae45c84e0cfe66f2ad0
Message:
*** empty log message ***


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

Legend:

Unmodified
Added
Removed
  • kernel/f5gb.cc

    r4bf7611 r8627ad  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: f5gb.cc,v 1.6 2008-06-01 15:14:37 ederc Exp $ */
     4/* $Id: f5gb.cc,v 1.7 2008-06-26 16:05:07 ederc Exp $ */
    55/*
    66* ABSTRACT: f5gb interface
    77*/
    8 
    98#include "mod2.h"
    109#include "kutil.h"
     
    2423#ifdef HAVE_F5
    2524
     25/*2
     26* all functions working on the class lpoly for labeled polynomials
     27*/
    2628
    27 
    28 void lpoly::setPoly(poly* p){
    29         p_ptr = p;
     29void lpoly::setPoly(poly p){
     30        polynomial = p;
    3031}
    3132
    32 void lpoly::setTerm(poly* t){
    33         t_ptr = t;
     33void lpoly::setTerm(poly t){
     34        term = t;
    3435}
    3536
    36 void lpoly::setIndex(long* i){
    37         i_ptr = i;
     37void lpoly::setIndex(long i){
     38        index = i;
    3839}
    3940
    40 poly* lpoly::getPoly(){
    41         return p_ptr;
     41poly lpoly::getPoly(){
     42        return polynomial;
    4243}
    4344
    44 poly* lpoly::getTerm(){
    45         return t_ptr;
     45poly lpoly::getTerm(){
     46        return term;
    4647}
    4748
    48 long* lpoly::getIndex(){
    49         return i_ptr;
     49long lpoly::getIndex(){
     50        return index;
    5051}
    5152
     
    6364        poly* ptr2 = right;
    6465        poly p1,p2;
    65 
    6666        p2 = *(left + (right - left >> 1));
    6767        do{
     
    9090
    9191/*2
     92* computes incrementally gbs of subsets of the input
     93* gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1}
     94*/ 
     95lpoly* f5_inc(lpoly* lp, lpoly* g_prev)
     96{
     97       
     98       
     99        return lp;
     100}   
     101
     102
     103/*2
    92104* computes a gb of the ideal i in the ring r with our f5
    93105* implementation
     
    95107ideal F5main(ideal i, ring r)
    96108{
    97       ideal iTmp, g;
    98       int j;     
    99       lpoly* lp;
     109      ideal iTmp, g_basis;
     110      long j, k;
     111      poly one = pInit();
     112      pSetCoeff(one, nInit(1));
     113      pWrite(one);
     114      lpoly *lp, *gb;
    100115      intvec* sort;
    101116      iTmp = idInit(IDELEMS(i),i->rank);
     
    114129     
    115130      lp = new lpoly[IDELEMS(iTmp)];
     131     
    116132      for(j=0; j <IDELEMS(iTmp); j++){
    117                 lp[j].setPoly(&iTmp->m[j]);
     133                lp[j].setPoly(iTmp->m[j]);
     134               
     135                if(pComparePolys(lp[j].getPoly(), one)){
     136                                Print("1 in GB");
     137                                return(NULL);
     138                }
     139               
     140                lp[j].setIndex(j+1);
     141                lp[j].setTerm(one);
    118142                Print("Labeled Polynomial %d: ",j+1);
    119                 pWrite(*(lp[j].getPoly()));
     143                Print("Signature Term: ");
     144                pWrite(lp[j].getTerm());
     145                Print("Signature Index: %d\n", lp[j].getIndex());
     146                pWrite(lp[j].getPoly());
     147                Print("\n\n");
     148                         
     149      }
     150     
     151      // PROBLEM: muss signatur mitliefern, daher datentyp
     152      //          ideal nicht zu gebrauchen?
     153      gb = new lpoly;
     154      gb = &lp[IDELEMS(iTmp)-1];
     155      pWrite((*gb).getPoly());
     156
     157      for(j=IDELEMS(iTmp)-2; j>0; j--){
     158             //PROBLEM: muss dynamisch Speicher allozieren
     159             gb = f5_inc(&lp[j], gb);
     160             for(k=0; k< IDELEMS(iTmp); k++){
     161                    if(gb[k].getPoly()){
     162                    }
     163             }
     164
     165
     166
     167               
    120168      }
    121169               
    122 
    123            
     170                       
    124171
    125172
  • kernel/f5gb.h

    r4bf7611 r8627ad  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: f5gb.h,v 1.5 2008-06-01 15:15:00 ederc Exp $ */
     4/* $Id: f5gb.h,v 1.6 2008-06-26 16:05:21 ederc Exp $ */
    55/*
    66* ABSTRACT: f5gb interface
     
    1313
    1414
     15// structure of the rules, i.e. index and term
     16struct rule{
     17        long index;
     18        poly term;
     19};
     20
     21
     22// class of a labeled polynomial
    1523class lpoly {
    1624        private:
    17                 poly* t_ptr;
    18                 long* i_ptr;
    19                 poly* p_ptr;
     25                poly term;
     26                long index;
     27                poly polynomial;
    2028
    2129        public:
    22                 void setPoly(poly* p);
    23                 poly* getPoly();
    24                 void setTerm(poly* t);
    25                 poly* getTerm();
    26                 void setIndex(long* i);
    27                 long* getIndex();
     30                void setPoly(poly p);
     31                poly getPoly();
     32                void setTerm(poly t);
     33                poly getTerm();
     34                void setIndex(long i);
     35                long getIndex();
    2836};
    2937
     
    3442void qsort_degree(poly* left, poly* right);
    3543
     44
     45// computes incrementally gbs of subsets of the input
     46// gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1} 
     47lpoly* f5_inc(lpoly* lp, lpoly* g_prev);
     48
     49
    3650// main function of our f5 implementation
    3751ideal F5main(ideal i, ring r);
Note: See TracChangeset for help on using the changeset viewer.