source: git/factory/libfac/factor/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.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.