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