Changeset 518620 in git for libfac


Ignore:
Timestamp:
Jun 19, 2001, 5:29:04 PM (23 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
Children:
a29d092aead668e4b42f61b65a02c917cba27025
Parents:
b6bd558c32f6b1ed1f45d9a2ab9d560c970244e5
Message:
*hannes: optim.


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

Legend:

Unmodified
Added
Removed
  • libfac/factor/helpstuff.cc

    rb6bd55 r518620  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // static char * rcsid = "$Id: helpstuff.cc,v 1.3 1997-09-12 07:19:56 Singular Exp $";
     4// static char * rcsid = "$Id: helpstuff.cc,v 1.4 2001-06-19 15:29:04 Singular Exp $";
    55////////////////////////////////////////////////////////////
    66// FACTORY - Includes
     
    1111#include "helpstuff.h"
    1212
    13 bool 
     13bool
    1414mydivremt ( const CanonicalForm& f, const CanonicalForm& g, CanonicalForm& a, CanonicalForm& b ){
    1515  bool retvalue;
     
    5151    if ( copy.factor() == TheFactor.factor() )
    5252      exp += copy.exp();
    53     else 
     53    else
    5454      Outputlist.append(copy);
    5555  }
     
    7474Powerup( const int base , const int exp){
    7575  int retvalue=1;
    76   if ( exp == 0 )  return retvalue ; 
     76  if ( exp == 0 )  return retvalue ;
    7777  else for ( int i=1 ; i <= exp; i++ ) retvalue *= base ;
    7878
     
    9090// modpower: the real work is done here; called by mod_power //
    9191///////////////////////////////////////////////////////////////
    92 static void 
    93 modpower( const CanonicalForm & f, int k , int td, 
    94           const CanonicalForm & t, CanonicalForm & result){
     92static void
     93modpower( const CanonicalForm & f, int k , int td,
     94          const CanonicalForm & t, CanonicalForm & result){
    9595
    9696  if ( td >= k ) return;
     
    103103}
    104104
    105 CanonicalForm 
     105CanonicalForm
    106106mod_power( const CanonicalForm & f, int k, int levelU){
    107107  CanonicalForm result,dummy;
     
    128128// Return the deg of F in the Variables x_1,..,x_(levelF-1)  //
    129129///////////////////////////////////////////////////////////////
    130 int 
     130int
    131131subvardegree( const CanonicalForm & F, int levelF ){
    132132  int n=0,m=degree(F,levelF),newn=0;
     
    142142// Change poly:  x_i <- x_i +- a_i    for i= 1,..,level(f)-1 //
    143143///////////////////////////////////////////////////////////////
    144 CanonicalForm 
     144CanonicalForm
    145145change_poly( const CanonicalForm & f , const SFormList & Substitutionlist ,int directionback ){
    146146  CanonicalForm F=f,g,k;
     
    153153  // ==> g = x_i ; k = a_i
    154154    level_i=level(i.getItem().factor());
    155     g = power( 
    156                        Variable(level_i),1
    157                        );
     155    g = power(
     156                       Variable(level_i),1
     157                       );
    158158    k= i.getItem().exp();
    159     if ( directionback ){
     159    if ( directionback )
     160    {
    160161      if ( degree(F, level_i) != 0 )
    161         F=F(g-k, level(i.getItem().factor())); // x_i <-- x_i - a_i
     162        F=F(g-k, level_i /*level(i.getItem().factor())*/); // x_i <-- x_i - a_i
    162163    }
    163     else{
     164    else
     165    {
    164166      if ( degree(F, level_i) != 0 )
    165         F=F(g+k, level(i.getItem().factor())); // x_i <-- x_i +a_i
     167        F=F(g+k, level_i /*level(i.getItem().factor())*/); // x_i <-- x_i +a_i
    166168    }
    167169  }
     
    173175/*
    174176$Log: not supported by cvs2svn $
     177Revision 1.3  1997/09/12 07:19:56  Singular
     178* hannes/michael: libfac-0.3.0
     179
    175180Revision 1.3  1997/04/25 22:20:45  michael
    176181Version for libfac-0.2.1
Note: See TracChangeset for help on using the changeset viewer.