jengelh-datetimespielwiese
Last change
on this file since 3e55bc was
3e55bc,
checked in by Hans Schönemann <hannes@…>, 26 years ago
|
* hannes/michael: libfac 0.2.4
git-svn-id: file:///usr/local/Singular/svn/trunk@377 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | //static char rcsid[] = "$Id: test.cc,v 1.2 1997-06-09 15:55:50 Singular Exp $"; |
---|
2 | /////////////////////////////////////////////////////////////////////////////// |
---|
3 | // Factor - Includes |
---|
4 | #include "factor.h" |
---|
5 | |
---|
6 | |
---|
7 | void |
---|
8 | setVarNames ( char * vnames ) |
---|
9 | { |
---|
10 | int i, n = strlen( vnames ); |
---|
11 | Variable dummy; |
---|
12 | for ( i = 0; i < n; i++ ) |
---|
13 | dummy = Variable( i+1, vnames[i] ); |
---|
14 | } |
---|
15 | |
---|
16 | main() |
---|
17 | { |
---|
18 | CanonicalForm f,g; |
---|
19 | int charac; |
---|
20 | CFFList Factorlist; |
---|
21 | CFFactor copy; |
---|
22 | |
---|
23 | cout << libfac_name <<", Version " << libfac_version << endl; |
---|
24 | // cout << " Characteristic = "; |
---|
25 | cin >> charac; |
---|
26 | setCharacteristic(charac); |
---|
27 | On(SW_SYMMETRIC_FF); |
---|
28 | On(SW_USE_EZGCD); |
---|
29 | ////////////////////////////////////////////////////////////// |
---|
30 | // char vnames[30]; |
---|
31 | //// cout << " vnames = "; |
---|
32 | // cin >> vnames; |
---|
33 | // |
---|
34 | // setVarNames( vnames ); |
---|
35 | // |
---|
36 | ////////////////////////////////////////////////////////////// |
---|
37 | // cout << " f = "; |
---|
38 | cin >> f; |
---|
39 | cout << f << " mod " << charac << " = " ; |
---|
40 | Factorlist= Factorize( f,0 ); |
---|
41 | cout << Factorlist ;//<< endl; |
---|
42 | // Ueberpruefen: |
---|
43 | g=1; |
---|
44 | for ( CFFListIterator i=Factorlist ; i.hasItem(); i++){ |
---|
45 | copy = i.getItem(); |
---|
46 | if ( getNumVars(copy.factor()) > 0 ) |
---|
47 | for ( int j=1; j<=copy.exp(); j++) |
---|
48 | g *= copy.factor(); |
---|
49 | else g *= copy.factor(); |
---|
50 | } |
---|
51 | if ( (f-g) != f.genZero() ){ |
---|
52 | cerr << "\nList and f differ: f= " << f << " g= " << g << endl; |
---|
53 | } |
---|
54 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.