Changeset 239c77 in git


Ignore:
Timestamp:
Apr 1, 2003, 2:48:31 PM (21 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
87d26115a86e30ac46b6a98bcf3476387cd6dac3
Parents:
bc91a65484e480a5becfb1d7732d074f37e61ac4
Message:
*hannes/wichmann: fglm fix for unusual orderings


git-svn-id: file:///usr/local/Singular/svn/trunk@6637 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/fglmzero.cc

    rbc91a6 r239c77  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmzero.cc,v 1.34 2001-10-09 16:36:00 Singular Exp $
     2// $Id: fglmzero.cc,v 1.35 2003-04-01 12:48:31 Singular Exp $
    33
    44/****************************************
     
    3232#include "omalloc.h"
    3333#include "kstd1.h" // for kNF (see fglmquot)
     34#include "intvec.h"
    3435#include "fglm.h"
    3536#include "fglmvec.h"
     
    331332    ideal theIdeal;
    332333    int idelems;
     334    int* varpermutation;
    333335
    334336    int basisBS;
     
    367369    theIdeal= thisIdeal;
    368370    idelems= IDELEMS( theIdeal );
     371    varpermutation = (int*)omAlloc( (pVariables+1)*sizeof(int) );
     372    // Sort ring variables by increasing values (because of weighted orderings)
     373    ideal perm = idMaxIdeal(1);
     374    intvec *iv = idSort(perm,TRUE);
     375    idDelete(&perm);
     376    for(int i = pVariables; i > 0; i--) varpermutation[pVariables+1-i] = (*iv)[i-1];
     377    delete iv;
    369378
    370379    basisBS= 100;
     
    387396fglmSdata::~fglmSdata()
    388397{
     398    omFreeSize( (ADDRESS)varpermutation, (pVariables+1)*sizeof(int) );
    389399    for ( int k = basisSize; k > 0; k-- )
    390400        pDeleteLm( basis + k );  //. rem: basis runs from basis[1]..basis[basisSize]
     
    458468//      into the list of candidates, according to the given order. If a monomial already
    459469//      exists, then "insertions" and "divisors" are updated.
    460 //     Assumes that ringvar(k) < ringvar(l) for k > l
     470//     Assumes that ringvar(varperm[k]) < ringvar(varperm[l]) for k > l
    461471void
    462472fglmSdata::updateCandidates()
     
    471481    while ( k >= 1 ) {
    472482        newmonom = pCopy( m );
    473         pIncrExp( newmonom, k );
     483        pIncrExp( newmonom, varpermutation[k] );
    474484        pSetm( newmonom );
    475485        done= FALSE;
     
    494504    while ( --k >= 1 ) {
    495505        newmonom= pCopy( m ); // HIER
    496         pIncrExp( newmonom, k );
     506        pIncrExp( newmonom, varpermutation[k] );
    497507        pSetm( newmonom );
    498508        nlist.append( fglmSelem( newmonom, k ) );
     
    661671    //    STICKYPROT("Calculating vector rep\n");
    662672    v = data.getVectorRep( p );
    663     // if ( v.isZero() )
     673    // if ( v.isZero() ) 
    664674    //   STICKYPROT("vectorrep is 0\n");
    665675    return ( data.state() );
     
    739749    int basisSize;  //. the CURRENT basisSize, i.e. basisSize <= dimen
    740750    polyset basis;  // [1]..[dimen]. The monoms of the new Vectorspace-basis
     751
     752    int* varpermutation;
    741753
    742754    int groebnerBS;
     
    778790    perm= (int *)omAlloc( (dimen+1)*sizeof( int ) );
    779791    basis= (polyset)omAlloc( (dimen+1)*sizeof( poly ) );
     792    varpermutation = (int*)omAlloc( (pVariables+1)*sizeof(int) );
     793    // Sort ring variables by increasing values (because of weighted orderings)
     794    ideal perm = idMaxIdeal(1);
     795    intvec *iv = idSort(perm,TRUE);
     796    idDelete(&perm);
     797    for(int i = pVariables; i > 0; i--) varpermutation[pVariables+1-i] = (*iv)[i-1];
     798    delete iv;
     799
    780800    groebnerBS= 16;
    781801    groebnerSize= 0;
     
    804824        pLmDelete( basis[k]);
    805825    omFreeSize( (ADDRESS)basis, (dimen+1)*sizeof( poly ) );
     826    omFreeSize( (ADDRESS)varpermutation, (pVariables+1)*sizeof(int) );
    806827}
    807828
     
    861882    while ( k >= 1 ) {
    862883        newmonom = pCopy( m );
    863         pIncrExp( newmonom, k );
     884        pIncrExp( newmonom, varpermutation[k] );
    864885        pSetm( newmonom );
    865886        done= FALSE;
     
    884905    while ( --k >= 1 ) {
    885906        newmonom= pCopy( m );
    886         pIncrExp( newmonom, k );
     907        pIncrExp( newmonom, varpermutation[k] );
    887908        pSetm( newmonom );
    888909        nlist.append( fglmDelem( newmonom, v, k ) );
     
    10201041      initv = iv;
    10211042    }
    1022 
     1043     
    10231044    poly one = pOne();
    10241045    data.updateCandidates( one, initv );
Note: See TracChangeset for help on using the changeset viewer.