Changeset 9e9b7c in git for libfac/charset/charset.cc


Ignore:
Timestamp:
May 31, 2008, 7:20:10 PM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
434e4154dbfea91da1283c2a039af70b75a4e85e
Parents:
2c3cda8da51049289f57702038ff42c44f290497
Message:
hannes: minor irras changes


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

Legend:

Unmodified
Added
Removed
  • libfac/charset/charset.cc

    r2c3cda r9e9b7c  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 /* $Id: charset.cc,v 1.14 2008-04-08 16:19:09 Singular Exp $ */
     4/* $Id: charset.cc,v 1.15 2008-05-31 17:20:10 Singular Exp $ */
    55/////////////////////////////////////////////////////////////
    66// FACTORY - Includes
     
    530530
    531531static CFList
    532 irras( CFList & AS, int & ja, CanonicalForm & reducible){
     532irras( CFList & AS, int & ja, CanonicalForm & reducible)
     533{
    533534  CFFList qs;
    534535  CFList ts,as;
     
    539540  ja = 0;
    540541  DEBOUTLN(CERR, "irras: called with: AS= ", AS);
    541   for ( i=AS; i.hasItem(); i++ ){
     542  for ( i=AS; i.hasItem(); i++ )
     543  {
    542544    elem = i.getItem();
    543545    nr += 1;
     
    545547    if ( degree(elem) > 1 ) // linear poly's are irreduzible
    546548    {
     549      //qs = Factorize2(elem,CanonicalForm(0));
    547550      qs = Factorize(elem);
    548     }
    549     else{
     551      // remove a constant
     552      if (qs.getFirst().factor().degree()==0) qs.removeFirst();
     553    }
     554    else
     555    {
    550556      qs=(CFFactor(elem,1));
    551       qs.insert(CFFactor(CanonicalForm(1),1));
    552557    }
    553558    DEBOUTLN(CERR, "  = ", qs);
     
    555560    if ( interrupt_handle() ) return CFList() ;
    556561    // INTERRUPTHANDLER
    557     qs.removeFirst();
    558     if ( (qs.length() >= 2 ) || (qs.getFirst().exp() > 1)){
     562
     563    if ( (qs.length() >= 2 ) || (qs.getFirst().exp() > 1))
     564    {
    559565      DEBOUTLN(CERR, "irras: Setting ind=0, ja= ", nr);
    560566      ja=nr; ind=0; reducible= elem;
     
    564570  }
    565571  //  CERR << "ind= " << ind << "\n";
    566   if ( (ind == 1) ){ //&& ( as.length() > 1) ){
    567     if ( irreducible(AS) ){ // as quasilinear? => irreducible!
     572  if ( (ind == 1) ) //&& ( as.length() > 1) )
     573  {
     574    if ( irreducible(AS) )
     575    { // as quasilinear? => irreducible!
    568576      ja = 0;
    569577      DEBOUTLN(CERR, "as is irreducible. as= ", AS);
    570578    }
    571     else {
     579    else
     580    {
    572581      i=AS;
    573       for ( nr=1; nr< AS.length(); nr++){
     582      for ( nr=1; nr< AS.length(); nr++)
     583      {
    574584        as.append(i.getItem());
    575585        i++;
    576         if ( degree(i.getItem()) > 1 ){// search for a non linear elem
     586        if ( degree(i.getItem()) > 1 )
     587        {  // search for a non linear elem
    577588          elem=i.getItem();
    578 //          CERR << "f=  " << elem << "\n";
    579 //        CERR << "as= " << as << "\n";
    580           qs= newfactoras(elem,as,success);
    581 //          CERR << "irras:newfactoras    qs= " << qs << "\n";
    582 //          qs= factoras(elem,as,success);
    583 //          CERR << "irras:factoras qs= " << qs << "\n";
    584           if ( qs.length() > 1 || qs.getFirst().exp() > 1 ){ //found elem is reducible
     589          if (as.length()==1)
     590            qs = Factorize2(elem,as.getFirst());
     591          else
     592            qs= newfactoras(elem,as,success);
     593          if ( qs.length() > 1 || qs.getFirst().exp() > 1 )
     594          { //found elem is reducible
    585595            reducible=elem;
    586596            ja=nr+1;
     
    595605  return ts;
    596606}
     607
    597608///////////////////////////////////////////////////////////////////////////////
    598609/*
    599610$Log: not supported by cvs2svn $
     611Revision 1.14  2008/04/08 16:19:09  Singular
     612*hannes: removed rcsid
     613
    600614Revision 1.13  2008/03/18 17:46:14  Singular
    601615*hannes: gcc 4.2
Note: See TracChangeset for help on using the changeset viewer.