Changeset a13956 in git


Ignore:
Timestamp:
Nov 9, 2010, 12:01:07 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c48726524b56e7c3adf69f25d82e664ace8c9211
Parents:
c6303a2b3f5bacd5773ec7cc726ac4487379de70
Message:
factoryError, removed dep. on SINGULAR


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

Legend:

Unmodified
Added
Removed
  • libfac/charset/charset.cc

    rc6303a ra13956  
    4141#endif
    4242#include "debug.h"
    43 
    44 #ifdef SINGULAR
    45 #define HAVE_SINGULAR_ERROR
    46 #endif
    47 
    48 #ifdef HAVE_SINGULAR_ERROR
    49    extern "C" { void WerrorS(const char *); }
    50    extern "C" { void WarnS(const char *); }
    51 #endif
    5243
    5344// the next computes a characteristic set (a basic set in Wang's sense)
  • libfac/factor/Factor.cc

    rc6303a ra13956  
    3232
    3333
    34 #ifdef SINGULAR
    35 #define HAVE_SINGULAR_ERROR
    36 #endif
    37 
    38 #ifdef HAVE_SINGULAR_ERROR
    39    extern "C" { void WerrorS(const char *); }
    40    extern "C" { void WarnS(const char *); }
    41 #endif
    42 
    4334#ifdef FACTORDEBUG
    4435#  define DEBUGOUTPUT
     
    294285          else
    295286          {
    296 #ifdef HAVE_SINGULAR_ERROR
    297             WerrorS("libfac: ERROR: not_monic1: case lt is a sum.");
    298 #else
    299 #ifndef NOSTREAMIO
    300             CERR << "libfac: ERROR: not_monic1: case lt is a sum.\n"
    301                  << errmsg << "\n";
    302 #endif
    303 #endif
     287            factoryError("libfac: ERROR: not_monic1: case lt is a sum.");
    304288          }
    305289        }
     
    314298        else
    315299        {
    316 #ifdef HAVE_SINGULAR_ERROR
    317           WerrorS("libfac: ERROR: not_monic2: case lt is a sum.");
    318 #else
    319 #ifndef NOSTREAMIO
    320           CERR << "libfac: ERROR: not_monic2: case lt is a sum.\n"
    321                << errmsg << "\n";
    322 #endif
    323 #endif
     300          factoryError("libfac: ERROR: not_monic2: case lt is a sum.");
    324301        }
    325302      }
     
    425402  else {
    426403    if ( degree(Extension) == 0 ) FFRandom gen;
    427     else {
    428 #ifdef HAVE_SINGULAR_ERROR
    429     WerrorS("libfac: evaluate: Extension not inFF() or inGF() !");
    430 #else
    431 #ifndef NOSTREAMIO
    432     CERR << "libfac: evaluate: " << Extension << " not inFF() or inGF() !"
    433          << "\n";
    434 #endif
    435 #endif
    436     FFRandom gen;
     404    else
     405    {
     406      factoryError("libfac: evaluate: Extension not inFF() or inGF() !");
    437407    }
    438408  }
     
    517487      ok= try_specializePoly(f,minpoly,deg,Substitutionlist,i,j);
    518488    }
    519     else {
    520 #ifdef HAVE_SINGULAR_ERROR
    521       WerrorS("libfac: spezializePoly ERROR: Working over given extension-field not yet implemented!");
    522 #else
    523 #ifndef NOSTREAMIO
    524       CERR << "libfac: spezializePoly ERROR: Working over given extension-field not yet implemented!\n"
    525            << errmsg << "\n";
    526 #endif
    527 #endif
     489    else
     490    {
     491      factoryError("libfac: spezializePoly ERROR: Working over given extension-field not yet implemented!");
    528492      return 0;
    529493    }
     
    552516
    553517  if ( degree(Extension) >0 ) GFRandom gen;
    554   else { if ( degree(Extension) == 0 ) FFRandom gen;
    555   else {
    556 #ifdef HAVE_SINGULAR_ERROR
    557     WerrorS("libfac: evaluate: Extension not inFF() or inGF() !");
    558 #else
    559 #ifndef NOSTREAMIO
    560     CERR << "libfac: evaluate: " << Extension << " not inFF() or inGF() !"
    561          << "\n";
    562 #endif
    563 #endif
    564     FFRandom gen; }}
     518  else
     519  {
     520    if ( degree(Extension) == 0 ) FFRandom gen;
     521    else
     522    {
     523      factoryError("libfac: evaluate: Extension not inFF() or inGF() !");
     524    }
     525  }
    565526  REvaluation k(1,n,gen);
    566527  k.nextpoint();
    567   for ( int i=1; i<=maxtries ; i++){
     528  for ( int i=1; i<=maxtries ; i++)
     529  {
    568530    // k.nextpoint();
    569531    SFormList Substitutionlist;
     
    572534    k.nextpoint();
    573535    CanonicalForm g=substitutePoly(f,Substitutionlist);
    574     if ( various_tests(g, degf,1) ){ // found a valid point
     536    if ( various_tests(g, degf,1) )
     537    { // found a valid point
    575538      failedfactor = 0; tried += 1;
    576539      if ( degree(Extension) == 0   )
     
    769732    if (success == 0 ) // No spezialisation could be found
    770733    {
    771 #ifdef HAVE_SINGULAR_ERROR
    772       WarnS("libfac: Factorize: ERROR: Not able to find a valid specialization!");
    773 #else
    774 #ifndef NOSTREAMIO
    775       CERR << "libfac: Factorize: ERROR: Not able to find a valid specialization!\n"
    776            << errmsg << "\n";
    777 #else
    778        ;
    779 #endif
    780 #endif
     734      factoryError("libfac: Factorize: ERROR: Not able to find a valid specialization!");
    781735      Outputlist.append(CFFactor(F,1));
    782736      return Outputlist;
  • libfac/factor/MVMultiHensel.cc

    rc6303a ra13956  
    2626#include "MVMultiHensel.h"
    2727
    28 #ifdef SINGULAR
    29 #define HAVE_SINGULAR_ERROR
    3028#ifndef NOSTREAMIO
    3129void out_cf(const char *s1,const CanonicalForm &f,const char *s2);
    3230#endif
    33 #endif
    34 
    35 #ifdef HAVE_SINGULAR_ERROR
     31
    3632extern int libfac_interruptflag;
    37    extern "C"
    38    {
    39      void WerrorS(const char *);
    40      void Werror(const char *fmt, ...);
    41    }
    42 #endif
    4333
    4434#ifdef HENSELDEBUG
     
    150140  if ( (degree(F1,levelU) + degree(F2,levelU) ) <= i )
    151141  {
    152 #ifdef HAVE_SINGULAR_ERROR
    153     if (!interrupt_handle()) Werror("libfac: diophant ERROR: degree too large!  (%d + %d <= %d)",degree(F1,levelU), degree(F2,levelU), i);
    154       //out_cf("F1:",F1,"\n");
    155       //out_cf("F2:",F2,"\n");
    156 #else
    157 #ifndef NOSTREAMIO
    158     CERR << "libfac: diophant ERROR: degree too large!  "
    159          << (degree(F1,levelU) + degree(F2,levelU) ) <<"\n";
    160 #else
    161     ;
    162 #endif
    163 #endif
     142    if (!interrupt_handle()) factoryError("libfac: diophant ERROR: degree too large!"); /*  (%d + %d <= %d)",degree(F1,levelU), degree(F2,levelU), i);*/
    164143    Retvalue.One=F1;Retvalue.Two=F2;
    165144    return Retvalue;
     
    194173        }
    195174      }
    196 #ifdef HAVE_SINGULAR_ERROR
    197       if (!interrupt_handle()) WerrorS("libfac: diophant ERROR: F1 and F2 are not relatively prime! ");
    198 #ifndef NOSTREAMIO
    199       out_cf("F1:",F1,"\n");
    200       out_cf("F2:",F2,"\n");
    201       out_cf("gcd:",r,"\n");
    202 #endif
    203 #else
    204 #ifndef NOSTREAMIO
    205       CERR << "libfac: diophant ERROR: " << F1 << "  and  " << F2
    206            << "  are not relatively prime!" << "\n";
    207 #else
    208      ;
    209 #endif
    210 #endif
     175      if (!interrupt_handle())
     176        factoryError("libfac: diophant ERROR: F1 and F2 are not relatively prime! ");
    211177      Retvalue.One=s/r;Retvalue.Two=t/r;
    212178      return Retvalue;
  • libfac/factor/SqrFree.cc

    rc6303a ra13956  
    2727#include "SqrFree.h"
    2828
    29 #ifdef SINGULAR
    30 #define HAVE_SINGULAR_ERROR
    31 #endif
    32 
    33 #ifdef HAVE_SINGULAR_ERROR
    34    extern "C" { void WerrorS(const char *); }
    35 #endif
    36 
    3729#ifdef SQRFREEDEBUG
    3830# define DEBUGOUTPUT
     
    195187    else return 0 ;
    196188  }
    197 #ifdef HAVE_SINGULAR_ERROR
    198   WerrorS("libfac: ERROR: SqrFreeTest: we should never fall trough here!");
    199 #else
    200 #ifndef NOSTREAMIO
    201   CERR << "\nlibfac: ERROR: SqrFreeTest: we should never fall trough here!\n"
    202        << errmsg << "\n";
    203 #endif
    204 #endif
     189  factoryError("libfac: ERROR: SqrFreeTest: we should never fall trough here!");
    205190  return 0;
    206191}
     
    347332    return Outputlist ;
    348333  }
    349 #ifdef HAVE_SINGULAR_ERROR
    350   WerrorS("libfac: ERROR: SqrFreed: we should never fall trough here!");
    351 #else
    352 #ifndef NOSTREAMIO
    353   CERR << "\nlibfac: ERROR: SqrFreed: we should never fall trough here!\n"
    354        << errmsg << "\n";
    355 #endif
    356 #endif
     334  factoryError("libfac: ERROR: SqrFreed: we should never fall trough here!");
    357335  DEBDECLEVEL(CERR, "SqrFreed");
    358336  return Outputlist; // for safety purpose
  • libfac/factor/Truefactor.cc

    rc6303a ra13956  
    2626#include "Truefactor.h"
    2727
    28 #ifdef SINGULAR
    29 #define HAVE_SINGULAR_ERROR
    30 #endif
    31 
    32 #ifdef HAVE_SINGULAR_ERROR
    33    extern "C" { void WerrorS(const char *); }
    34 #endif
    35 
    3628#ifdef TRUEFACTORDEBUG
    3729#  define DEBUGOUTPUT
     
    379371    if ( PossibleFactors.length() < n )  // a little check
    380372    {
    381 #ifdef HAVE_SINGULAR_ERROR
    382       WerrorS("libfac: ERROR: TakeNorms less then two items remaining!");
    383 #else
    384 #ifndef NOSTREAMIO
    385       CERR << "libfac: ERROR: TakeNorms less then two items remaining! "
    386            << "\n";
    387 #else
    388       ;
    389 #endif
    390 #endif
     373      factoryError("libfac: ERROR: TakeNorms less then two items remaining!");
    391374    }
    392375    while ( n < PossibleFactors.length() )
     
    432415      else
    433416      {
    434 #ifdef HAVE_SINGULAR_ERROR
    435         WerrorS("libfac: TakeNorms: somethings wrong with remaining factors!");
    436 #else
    437 #ifndef NOSTREAMIO
    438         CERR << "libfac: TakeNorms: somethings wrong with remaining factors!"
    439              << "\n";
    440 #endif
    441 #endif
     417        factoryError("libfac: TakeNorms: somethings wrong with remaining factors!");
    442418      }
    443419    }
Note: See TracChangeset for help on using the changeset viewer.