Changeset 95aee2 in git for Singular/LIB/classify.lib


Ignore:
Timestamp:
Jan 24, 1997, 11:23:07 AM (27 years ago)
Author:
Kai Krüger <krueger@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
d8481133e44f75748584129b7113d0d4bea86315
Parents:
59aca638db0adc8827cc5d2dc7c24f2b09c83ed7
Message:
*** empty log message ***


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/classify.lib

    r59aca63 r95aee2  
     1// $Id: classify.lib,v 1.5 1997-01-24 10:23:07 krueger Exp $
    12//=============================================================================
    2 // $Id: classify.lib,v 1.4 1995-02-09 13:52:14 krueger Exp $
    33//
    44// Please send bugs and comments to krueger@mathematik.uni-kl.de
    55//
    66//=============================================================================
    7 LIB "lib0";
    8 LIB "lib1";
     7// required libraries
     8//LIB "lib0";
     9//LIB "lib1";
    910LIB "lib_Setring";
    1011LIB "lib_ReOrder";
    1112LIB "lib_RandomPoly";
    12 LIB "lib_Morse";
    13 LIB "lib_tools";
    14 LIB "lib_Kclass";
    15 LIB "lib_Ausgaben";
    16 LIB "lib_WorkOn";
    17 LIB "lib_HKclass";
     13LIB "Morse.lib";
     14LIB "tools.lib";
     15LIB "Kclass.lib";
     16LIB "Ausgaben.lib";
     17LIB "HKclass.lib";
     18LIB "NFlist.lib";
     19LIB "Hilbert.lib";
    1820
    19 //=============================================================================
    20 //
    21 //
    22 proc ShowLibs
    23 {
    24   string @Required = LIB;
    25   int @len = size(@Required);
    26   int @i;
    27   int @k;
    28   int @j;
    29   string @s;
    30   string @s1;
    31 
    32   for(@i=1;@i<@len;@i=@i+@k) {
    33     @s = @Required[@i..@len];
    34     @k = find(@s, ",");
    35     if(@k>0) {
    36       @s = @Required[@i,@k-1];
    37     }
    38     else {
    39       @k = size(@s);
    40     }
    41     @s1 = "@j = defined(SLib_"+@s+");";
    42     execute @s1;
    43     if( @j != 0) {
    44       @s1 = "SLib_"+@s+";";
    45       execute @s1;
    46     }
    47   }
     21//=========================================================================
     22proc Classify_lib
     23{
     24"
     25  Classify(poly f);    determine the typ of the singularity f
     26";
    4827}
    4928
     
    5332proc Classify
    5433{
    55   if( #ARGS != 1 ) {
     34  if( size(#) != 1 ) {
    5635//=============================================================================
    5736    " USAGE:   Classify(<poly>)";
     
    6342    "";
    6443    " REMARK:  This version of Classify is only pre-alpha.";
    65     "          Please reports bugs and comments to: ";
     44    "          Please send bugs and comments to: ";
    6645    "          \"Kai Krueger\" <krueger@mathematik.uni-kl.de>";
    6746    "";
     
    7150    return();
    7251  }
    73   if( typeof(#1) != "poly") {
     52  if(system("version")<922) {
     53    "Sorry. You need to have at least Singular version 0.9.2.c"
     54    return;
     55  }
     56  if( typeof(#[1]) != "poly") {
    7457    "Classify: argv(1) must be poly";
    75     return(#1);
     58    return(#[1]);
    7659  }
    77   int @show_nf = 1;    // return Normal-form if set to '1'
     60  // Get characteristics of ring set it as default.
     61  if(defined(CharOfRing) == 1) { kill CharOfRing; }
     62  int CharOfRing = char(basering);
     63  export CharOfRing;
    7864
    79   poly @f_in = #1;
     65  if(checkring()) { return(#[1]); }
     66  int @show_nf = 1;    // return normal form if set to '1'
     67
     68  poly @f_in = #[1];
    8069  int @n = nvars(basering);
    8170
     
    8675
    8776  // if trace/debug mode not set, do it!
    88   if( defined(DeBug) == 0) { int DeBug = 0; }
    89   if(system("version")>=91) { global DeBug; }
     77  if( defined(DeBug) == 0) {
     78    string s=system("getenv", "SG_DEBUG");
     79    if( s != "" ) {
     80      s="int DeBug="+s;
     81      execute s;
     82    }
     83    else { int DeBug = 0; }
     84  }
     85  export DeBug;
    9086
    9187  // define new ring
    9288  if( defined(Rtop) == 1) { kill Rtop; }
    9389  execute Setring(@n, "Rtop");
     90  export Rtop;
     91
    9492  @tmp = @tmp + string(maxideal(1)) + ";";
    9593  execute @tmp;
    96   if(system("version")>=91) { global Rtop; }
    9794
    9895  execute @RingInput;
     96
     97  if(defined(ShowPoly) == 1) { kill ShowPoly; }
    9998  map ShowPoly=Rtop,maxideal(1);
    100   if(system("version")>=91) { global ShowPoly; }
     99  export ShowPoly;
     100
    101101  setring Rtop;
    102102  init();
     103
    103104  string RingDisplay = @RingInput;
    104   if(system("version")>=91) { global RingDisplay; }
     105  export RingDisplay;
    105106
    106107  string @s1;
     
    108109  string @s3;
    109110  string @s4;
     111//listvar();
     112//basering;
    110113  @s1,@s2=Klassifiziere(@Conv(@f_in));
     114  // @s1: f nach saemtlichen Koordinatentransformationen
     115  // @s2: Typ des Polynoms f z.b: E[18]
    111116  @s4 = "poly @f_out="+@s1+";";
     117//"Corang:"+ string(CoRang);
    112118
    113   setring RingB;
    114   execute @s4;
    115   setring Rtop;
     119  if( @s2[1,2]=="f " || @s2[1,4]=="The " || @s2=="Fehler!" || @s2=="A[0]") {
     120    if( @s2 != "Fehler!") { @s2; }
     121    if(@s1=="1" || @s2[1,4]=="The " || @s2=="Fehler!" ) {
     122      execute @RingInput;
     123      return(@f_in);
     124    }
     125    setring Rtop;
     126    execute @s4;
     127    map @ConvUp=Rtop,maxideal(1);
     128  }
     129  else {
     130    setring RingB;
     131    execute @s4;
     132    setring Rtop;
     133    map @ConvUp=RingB,maxideal(1);
     134  }
     135//"Corang:"+ string(CoRang);
    116136
    117   poly @f_nf = NormalForm(@s2);
    118   for(@i=5;@i<=@n;@i=@i+1) {
    119     @f_nf = @f_nf + x(@i)^2;
     137  if(@show_nf==1) {
     138    poly @f_nf = NormalForm(@s2);
     139    for(@i=4;@i<=@n;@i=@i+1) {
     140      @f_nf = @f_nf + x(@i)^2;
     141    }
     142    if(DeBug>1) { "Normal form NF(f)=", @f_nf; }
    120143  }
    121   if(DeBug>1) { "Normal form NF(f)=", @f_nf; }
    122 
    123   map @ConvUp=RingB,maxideal(1);
     144//"Corang:"+ string(CoRang);
     145//listvar();
     146//"------------------------------";
     147//"Classify() Controlpoint Test----";
    124148  poly @f_out = @ConvUp(@f_out);
     149//listvar();
     150//"------------------------------";
     151//"Corang:"+ string(CoRang);
     152//"Classify() Controlpoint Test----";
     153//listvar();
     154//"------------------------------";
    125155  for(@i=CoRang+1;@i<=@n;@i=@i+1) {
    126156    @f_out = @f_out + x(@i)^2;
    127157  }
     158//"Classify() Controlpoint Test----";
    128159  execute @RingInput;
    129160  map @ConvBack=Rtop,maxideal(1);
     161//"Classify() Controlpoint Test----";
    130162
    131163  if(@show_nf == 1) {
Note: See TracChangeset for help on using the changeset viewer.