Changeset cc3e5e in git


Ignore:
Timestamp:
Jul 8, 1996, 10:17:22 AM (27 years ago)
Author:
Rüdiger Stobbe <stobbe@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
d675c7716d78a6d5c5238c8820480fc2f09a860e
Parents:
995f1cc5ea98223893365bb03608bc85b99ade76
Message:
"New function compress( f, g, M, N ) that maps the common variables to be
the ones with the lowest level.
"


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

Legend:

Unmodified
Added
Removed
  • factory/cf_map.cc

    r995f1c rcc3e5e  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: cf_map.cc,v 1.0 1996-05-17 10:59:44 stobbe Exp $
     2// $Id: cf_map.cc,v 1.1 1996-07-08 08:17:22 stobbe Exp $
    33
    44/*
    55$Log: not supported by cvs2svn $
     6Revision 1.0  1996/05/17 10:59:44  stobbe
     7Initial revision
     8
    69*/
    710
     
    1013#include "cf_map.h"
    1114#include "cf_iter.h"
     15#include "templates/functions.h"
    1216
    1317
     
    138142}
    139143
     144void compress ( const CanonicalForm & f, const CanonicalForm & g, CFMap & M, CFMap & N )
     145{
     146    int n = tmax( f.level(), g.level() );
     147    int i, k, m;
     148    int * degsf = new int[n+1];
     149    int * degsg = new int[n+1];
     150
     151    for ( i = 0; i <= n; i++ ) {
     152        degsf[i] = degsg[i] = 0;
     153    }
     154    degsf = degrees( f, degsf );
     155    degsg = degrees( g, degsg );
     156    i = 1; k = 1; m = n;
     157    while ( i <= n ) {
     158        if ( degsf[i] > 0 && degsg[i] > 0 ) {
     159            if ( i != k ) {
     160                M.newpair( Variable(i), Variable(k) );
     161                N.newpair( Variable(k), Variable(i) );
     162            }
     163            k++;
     164        }
     165        else {
     166            M.newpair( Variable(i), Variable(m) );
     167            N.newpair( Variable(m), Variable(i) );
     168            m--;
     169        }
     170        i++;
     171    }
     172    delete [] degsf;
     173    delete [] degsg;
     174}
     175
    140176// static functions
    141177
  • factory/cf_map.h

    r995f1c rcc3e5e  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: cf_map.h,v 1.0 1996-05-17 10:59:38 stobbe Exp $
     2// $Id: cf_map.h,v 1.1 1996-07-08 08:17:22 stobbe Exp $
    33
    44#ifndef INCL_CF_MAP_H
     
    77/*
    88$Log: not supported by cvs2svn $
     9Revision 1.0  1996/05/17 10:59:38  stobbe
     10Initial revision
     11
    912*/
    1013
     
    5659CanonicalForm compress ( const CanonicalForm & f, CFMap & m );
    5760void compress ( const CFArray & a, CFMap & M, CFMap & N );
     61void compress ( const CanonicalForm & f, const CanonicalForm & g, CFMap & M, CFMap & N );
    5862
    5963/*ENDPUBLIC*/
Note: See TracChangeset for help on using the changeset viewer.