source: git/factory/libfac/testcs.cc @ 6ce030f

fieker-DuValspielwiese
Last change on this file since 6ce030f was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[0479e09]1
2#include <factory.h>
[e65b1a4]3#include <libfac.h>
[e2ca88]4#ifdef HAVE_IOSTREAM
5#include <iostream>
6#define COUT std::cout
7#define CIN std::cin
8#elif defined(HAVE_IOSTREAM_H)
9#include <iostream.h>
10#define COUT cout
11#define CIN cin
12#endif
13
[0479e09]14
15// testing: Characteristic Sets
16void
17setVarNames ( char * vnames )
18{
19    int i, n = strlen( vnames );
20    Variable dummy;
21    for ( i = 0; i < n; i++ )
22        dummy = Variable( i+1, vnames[i] );
23}
24
25main()
26{
27  int reord=0; // use strategy for reordering?
28  int charac;
[e2ca88]29  COUT << " Characteristic = "; CIN >> charac;
[0479e09]30  setCharacteristic(charac);
31  On(SW_SYMMETRIC_FF);
32  char vnames[30];
[e2ca88]33  COUT << " vnames = "; CIN >> vnames;
[0479e09]34
35  setVarNames( vnames );
36
37  CFList F1,F2;
38  ListCFList Q;
39  CanonicalForm f;
40  CFListIterator I ;
41  int i = 1;
42  PremForm Remembern;
43  Varlist betterorder;
44
[e2ca88]45  COUT << " f[" << i << "] = "; cin >> f;
[0479e09]46  while ( f != 0 ) {
47    F1.append( f ); i++;
[e2ca88]48    COUT << " f[" << i << "] = "; cin >> f;
[0479e09]49  }
50  F2=F1;
[e2ca88]51  COUT << "\n";
[0479e09]52
[e2ca88]53  COUT << "F = " << F1 << "\n";
[0479e09]54  if (reord){
55    betterorder= neworder(F1);
[e2ca88]56    COUT << "new orderd vars: " << betterorder << "\n";
[0479e09]57    F1=reorder(betterorder,F1);
[e2ca88]58    COUT << "new F= " << F1 << "\n";
[0479e09]59  }
[e2ca88]60//   COUT << "\nUsing Modified CharSet:" << "\n";
[0479e09]61//   F2 = MCharSetN( F1, Remembern );
[e2ca88]62//   COUT << "MCsN(F) = " << F2 << "\n";
63//   COUT << "Factors removed: " << Remembern.FS2 << "\n";
64//   COUT << "Possible Factors considered: " << Remembern.FS1 << "\n";
[0479e09]65//   for ( I = F2; I.hasItem(); I++ )
[e2ca88]66//     COUT << "  vars: " << getVars( I.getItem() ) << "\n";
67  COUT << "\nUsing IrrCharSeries:" << "\n";
[0479e09]68  Q= IrrCharSeries( F1 );
[e2ca88]69  COUT << "ics(F) = " << Q << "\n";
[0479e09]70  if (reord){
71    Q=reorder(betterorder,Q);
[e2ca88]72    COUT << "reorderd ics(F) = " << Q << "\n";
[0479e09]73  }
74}
75
Note: See TracBrowser for help on using the repository browser.