source: git/libfac/factor/test.cc @ 18500b

spielwiese
Last change on this file since 18500b was 18500b, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg: moved libfac back
  • Property mode set to 100644
File size: 1.2 KB
Line 
1///////////////////////////////////////////////////////////////////////////////
2// factory - Includes
3//       (x+y+z)*(x+y-z)*(x-y+z)*(x-y-z)*x*y;
4#include <factory.h>
5// Factor - Includes
6#include "tmpl_inst.h"
7#include "Factor.h"
8#include "SqrFree.h"
9
10main()
11{
12    CanonicalForm f,g;
13    int charac;
14    CFFList Factorlist;
15    CFFactor copy;
16
17//    cout << " Characteristic = ";
18    cin >> charac;
19    setCharacteristic(charac);
20    On(SW_SYMMETRIC_FF);
21    g=1;
22//    cout << " f = ";
23    cin >> f;
24//    cout << " f = " << f  << endl;
25//    cout << " f(SqrFree)= " << endl;
26//    cout << SqrFree(f) << endl << endl;
27//cout << "gcd(f,f.deriv())= gcd(" << f << "," << f.deriv() << ")= " << gcd(f,f.deriv()) << endl;
28//cout << "gcd(f,f.deriv())= gcd(" << f << "," << f.deriv() << ")= " << gcd(f,f.deriv()) << endl;
29        Factorlist = Factorize( f );
30        cout << Factorlist ;//<< endl;
31// Ueberpruefen:
32    for ( CFFListIterator i=Factorlist ; i.hasItem(); i++){
33        copy = i.getItem();
34        if ( getNumVars(copy.factor()) > 0 )
35             for ( int j=1; j<=copy.exp(); j++)
36             g *= copy.factor();
37        else g *= copy.factor();
38    }
39    if ( (f-g) != f.genZero() ){
40        cerr << "\nList and f differ: f= " << f << "  g= " << g << endl;
41        cerr << "List= " << Factorlist << endl;
42    }
43}
Note: See TracBrowser for help on using the repository browser.