source: git/factory/libfac/test.cc @ 16055bd

jengelh-datetimespielwiese
Last change on this file since 16055bd was 16055bd, checked in by Martin Lee <martinlee84@…>, 11 years ago
chg: move libfac into factory
  • Property mode set to 100644
File size: 1.6 KB
Line 
1//static char rcsid[] = "$Id$";
2///////////////////////////////////////////////////////////////////////////////
3// Factor - Includes
4#include "libfac.h"
5#include <string.h>
6
7#ifdef HAVE_IOSTREAM
8#include <iostream>
9#define CERR std::cerr
10#define COUT std::cout
11#define CIN std::cin
12#elif defined(HAVE_IOSTREAM_H)
13#include <iostream.h>
14#define CERR cerr
15#define COUT cout
16#define CIN cin
17#endif
18
19
20
21void
22setVarNames ( char * vnames )
23{
24    int i, n = strlen( vnames );
25    Variable dummy;
26    for ( i = 0; i < n; i++ )
27        dummy = Variable( i+1, vnames[i] );
28}
29
30main()
31{
32    CanonicalForm f,g;
33    int charac;
34    CFFList Factorlist;
35    CFFactor copy;
36
37COUT << libfac_name  <<", Version " << libfac_version << "\n";
38//    COUT << " Characteristic = ";
39    CIN >> charac;
40    setCharacteristic(charac);
41    On(SW_SYMMETRIC_FF);
42    On(SW_USE_EZGCD);
43//////////////////////////////////////////////////////////////
44//  char vnames[30];
45////  cout << " vnames = ";
46//  cin >> vnames;
47//
48//  setVarNames( vnames );
49//
50//////////////////////////////////////////////////////////////
51//    COUT << " f = ";
52//    CIN >> f;
53//    COUT << f  << " mod " << charac << " = " ;
54//    Factorlist= Factorize( f,0 );
55//     COUT << Factorlist ;//<< "\n";
56// Ueberpruefen:
57//    g=1;
58//    for ( CFFListIterator i=Factorlist ; i.hasItem(); i++){
59//      copy = i.getItem();
60//      if ( getNumVars(copy.factor()) > 0 )
61//           for ( int j=1; j<=copy.exp(); j++)
62//           g *= copy.factor();
63//      else g *= copy.factor();
64 //   }
65//    if ( (f-g) != f.genZero() ){
66//      CERR << "\nList and f differ: f= " << f << "  g= " << g << "\n";
67 //   }
68}
Note: See TracBrowser for help on using the repository browser.