Changeset 265aa7 in git for libfac/factor


Ignore:
Timestamp:
May 22, 2007, 4:49:52 PM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
44d6cf799fbfac8d0bd66c4ac5bf79e9784d726d
Parents:
17b2e2103b1022a527607ac5bd1c2c0655100596
Message:
*hannes: format


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

Legend:

Unmodified
Added
Removed
  • libfac/factor/Factor.cc

    r17b2e2 r265aa7  
    11/* Copyright 1996 Michael Messollen. All rights reserved. */
    22///////////////////////////////////////////////////////////////////////////////
    3 static char * rcsid = "$Id: Factor.cc,v 1.30 2007-05-22 14:30:53 Singular Exp $ ";
     3static char * rcsid = "$Id: Factor.cc,v 1.31 2007-05-22 14:49:52 Singular Exp $ ";
    44static char * errmsg = "\nYou found a bug!\nPlease inform (Michael Messollen) michael@math.uni-sb.de \nPlease include above information and your input (the ideal/polynomial and characteristic) in your bug-report.\nThank you.";
    55///////////////////////////////////////////////////////////////////////////////
     
    210210///////////////////////////////////////////////////////////////
    211211static CFFList
    212 not_monic( const CFFList & TheList, const CanonicalForm & ltt, const CanonicalForm & F, int levelF){
     212not_monic( const CFFList & TheList, const CanonicalForm & ltt, const CanonicalForm & F, int levelF)
     213{
    213214  CFFList Returnlist,IntermediateList;
    214215  CFFListIterator i;
     
    219220
    220221  if ( lt == lt.genOne() ) return TheList; // the poly was already monic
    221   if ( TheList.length() <= 1 ){ // only one factor to substitute back
     222  if ( TheList.length() <= 1 ) // only one factor to substitute back
     223  {
    222224    if ( totaldegree(lt) == 0 ) // lt is type numeric
    223225      Returnlist.append( CFFactor(lt*TheList.getFirst().factor(),
    224226                                  TheList.getFirst().exp()) );
    225     else {
     227    else
     228    {
    226229      intermediate = F(x*lt, levelF)/power(lt,degree(F,levelF)-1);
    227230      Returnlist.append(CFFactor(intermediate,TheList.getFirst().exp()));
    228231    }
    229232  }
    230   else { // more then one factor
     233  else // more then one factor
     234  {
    231235    IntermediateList= TheList;
    232236    if ( totaldegree(lt) == 0 ){ // lt is type numeric;(SqrFree-use, see above)
     
    236240      Returnlist= Union(Returnlist,IntermediateList);
    237241    }
    238     else{ // lt is a) a product or b) a sum of terms
    239       if ( lt_is_product(lt) ){ // case a)
     242    else // lt is a) a product or b) a sum of terms
     243    {
     244      if ( lt_is_product(lt) ) // case a)
     245      {
    240246        DEBOUTLN(CERR, "lt_is_product: ", lt);
    241247        savelc= content(lt) ; // can we simplify to savelc= lc(lt); ?
    242248        while ( getNumVars(savelc) != 0 )
    243249          savelc= content(savelc);
    244         for ( i=TheList; i.hasItem();i++ ){
     250        for ( i=TheList; i.hasItem();i++ )
     251        {
    245252          numerator= i.getItem().factor();
    246253          numerator= numerator(x*lt,levelF); // x <- x*lt
     
    259266          intermediate*= j.getItem().factor();
    260267        test1= mydivremt( intermediate,F,a,b);
    261         if ( test1 && b == intermediate.genZero() ) { // Yupp!
     268        if ( test1 && b == intermediate.genZero() ) // Yupp!
     269        {
    262270          IntermediateList.append(CFFactor(1/a,1));
    263271          Returnlist= IntermediateList;
     
    265273        else { Returnlist= IntermediateList; }
    266274      }
    267       else{ // case b)
     275      else // case b)
     276      {
    268277        DEBOUTLN(CERR, "lt_is_sum: ", lt);
    269278        CanonicalForm save_denumerator= 1;
    270         for ( i=TheList; i.hasItem(); i++ ){
     279        for ( i=TheList; i.hasItem(); i++ )
     280        {
    271281          numerator= i.getItem().factor();
    272282          numerator= numerator(x*lt,levelF); // x <- x*lt
     
    274284          test= content(numerator,x);
    275285          test1= mydivremt(denumerator,test,a,b);
    276           if ( test1 && b == numerator.genZero() ){ // Yupp!
     286          if ( test1 && b == numerator.genZero() ) // Yupp!
     287          {
    277288            save_denumerator*= a;
    278289            Returnlist.append(CFFactor(numerator/test ,1));
    279290          }
    280           else {
     291          else
     292          {
    281293#ifdef HAVE_SINGULAR_ERROR
    282294            WerrorS("libfac: ERROR: not_monic1: case lt is a sum.");
     
    297309          // the following will do what we want
    298310          Returnlist= myUnion( CFFList(CFFactor(1/a,1)),Returnlist) ;
    299         else {
     311        else
     312        {
    300313#ifdef HAVE_SINGULAR_ERROR
    301314          WerrorS("libfac: ERROR: not_monic2: case lt is a sum.");
     
    13341347/*
    13351348$Log: not supported by cvs2svn $
     1349Revision 1.30  2007/05/22 14:30:53  Singular
     1350*hannes: diophant_error
     1351
    13361352Revision 1.29  2007/05/22 13:18:57  Singular
    13371353*hannes: Factorize2: div test, sort etc.
Note: See TracChangeset for help on using the changeset viewer.