source: git/factory/libfac/testcs.cc @ e65b1a4

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