Changeset 9e9b7c in git for libfac


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


git-svn-id: file:///usr/local/Singular/svn/trunk@10732 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
libfac
Files:
4 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
  • libfac/factor/Factor.cc

    r2c3cda r9e9b7c  
    11/* Copyright 1996 Michael Messollen. All rights reserved. */
    22///////////////////////////////////////////////////////////////////////////////
    3 /* $Id: Factor.cc,v 1.45 2008-04-08 16:19:10 Singular Exp $ */
     3/* $Id: Factor.cc,v 1.46 2008-05-31 17:20:10 Singular Exp $ */
    44static const char * errmsg = "\nYou found a bug!\nPlease inform singular@mathematik.uni-kl.de\nPlease include above information and your input (the ideal/polynomial and characteristic) in your bug-report.\nThank you.";
    55///////////////////////////////////////////////////////////////////////////////
     
    880880CFFList Factorize(const CanonicalForm & F, int is_SqrFree )
    881881{
     882  out_cf("Factorize ",F,"\n");
    882883  CFFList Outputlist,SqrFreeList,Intermediatelist,Outputlist2;
    883884  ListIterator<CFFactor> i,j;
     
    893894  DEBINCLEVEL(CERR, "Factorize");
    894895  DEBOUTLN(CERR, "Called with F= ", F);
    895   if ( getCharacteristic() == 0 )
     896  if (( getCharacteristic() == 0 ) || (F.isUnivariate()))
    896897  { // char == 0
    897898    TIMING_START(factorize_time);
     
    910911  // search an "optimal" main variavble
    911912  int mv=F.level();
    912   if ((mv != LEVELBASE) && (! F.isUnivariate()) )
     913  if ((mv != LEVELBASE) /* && (! F.isUnivariate()) */)
    913914  {
    914915     mv=find_mvar(F);
     
    940941  else
    941942    SqrFreeList.append(CFFactor(F,1));
     943
    942944  DEBOUTLN(CERR, "SqrFreeMV= ", SqrFreeList);
    943945  for ( i=SqrFreeList; i.hasItem(); i++ )
     
    952954      if ( g.isUnivariate() )
    953955      {
     956        out_cf("univ. poly: ",g,"\n");
    954957        Intermediatelist=factorize(g,1); // poly is sqr-free!
    955958        for ( j=Intermediatelist; j.hasItem(); j++ )
     
    10091012    swapvar(F,Variable(mv),F.mvar());
    10101013  }
    1011 
    10121014  DEBDECLEVEL(CERR, "Factorize");
    10131015  TIMING_END(factorize_time);
     
    13331335/*
    13341336$Log: not supported by cvs2svn $
     1337Revision 1.45  2008/04/08 16:19:10  Singular
     1338*hannes: removed rcsid
     1339
    13351340Revision 1.44  2008/03/18 17:46:15  Singular
    13361341*hannes: gcc 4.2
  • libfac/factor/Factor.h

    r2c3cda r9e9b7c  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: Factor.h,v 1.5 2002-08-19 11:11:33 Singular Exp $
     4// $Id: Factor.h,v 1.6 2008-05-31 17:20:10 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef FACTOR_H
     
    1111CFFList Factorize( const CanonicalForm & F, int is_SqrFree=0 ) ;
    1212CFFList Factorize( const CanonicalForm & F, const CanonicalForm & mi, int is_SqrFree=0 ) ;
     13CFFList Factorize2(CanonicalForm F, const CanonicalForm & minpoly );
    1314/*ENDPUBLIC*/
    1415
     
    1819/*
    1920$Log: not supported by cvs2svn $
     21Revision 1.5  2002/08/19 11:11:33  Singular
     22* hannes/pfister: alg_gcd etc.
     23
    2024Revision 1.4  2002/07/30 15:05:38  Singular
    2125*hannes: added Factorize for alg. ext.
  • libfac/factor/SqrFree.cc

    r2c3cda r9e9b7c  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 /* $Id: SqrFree.cc,v 1.20 2008-05-14 12:38:26 Singular Exp $ */
     4/* $Id: SqrFree.cc,v 1.21 2008-05-31 17:20:10 Singular Exp $ */
    55static const char * errmsg = "\nYou found a bug!\nPlease inform singular@mathematik.uni-kl.de\n Please include above information and your input (the ideal/polynomial and characteristic) in your bug-report.\nThank you.";
    66///////////////////////////////////////////////////////////////////////////////
     
    388388        if (!mipo.isZero())
    389389        {
    390           #if 1
     390          #if 0
    391391          Variable alpha=rootOf(mipo);
    392392          CanonicalForm ff=replacevar(f,mipo.mvar(),alpha);
     
    455455/*
    456456$Log: not supported by cvs2svn $
     457Revision 1.20  2008/05/14 12:38:26  Singular
     458*hannes: swapvar ->replacevar
     459
    457460Revision 1.19  2008/05/05 14:54:29  Singular
    458461*hannes: switch representation and normalize in SqrFreeMV
Note: See TracChangeset for help on using the changeset viewer.