source: git/libfac/factor/test.cc @ b87513c

spielwiese
Last change on this file since b87513c was 3e55bc, checked in by Hans Schönemann <hannes@…>, 27 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.3 KB
Line 
1//static char rcsid[] = "@(#) $Id: test.cc,v 1.2 1997-06-09 15:56:11 Singular Exp $";
2///////////////////////////////////////////////////////////////////////////////
3// CLAP - Includes
4//       (x+y+z)*(x+y-z)*(x-y+z)*(x-y-z)*x*y;
5#include <clap.h>
6// Factor - Includes
7#include "tmpl_inst.h"
8#include "Factor.h"
9#include "SqrFree.h"
10
11main()
12{
13    CanonicalForm f,g;
14    int charac;
15    CFFList Factorlist;
16    CFFactor copy;
17
18//    cout << " Characteristic = ";
19    cin >> charac;
20    setCharacteristic(charac);
21    On(SW_SYMMETRIC_FF);
22    g=1;
23//    cout << " f = ";
24    cin >> f;
25//    cout << " f = " << f  << endl;
26//    cout << " f(SqrFree)= " << endl;
27//    cout << SqrFree(f) << endl << endl;
28//cout << "gcd(f,f.deriv())= gcd(" << f << "," << f.deriv() << ")= " << gcd(f,f.deriv()) << endl;
29//cout << "mygcd(f,f.deriv())= mygcd(" << f << "," << f.deriv() << ")= " << mygcd(f,f.deriv()) << endl;
30        Factorlist = Factorize( f );
31        cout << Factorlist ;//<< endl;
32// Ueberpruefen:
33    for ( CFFListIterator i=Factorlist ; i.hasItem(); i++){
34        copy = i.getItem();
35        if ( getNumVars(copy.factor()) > 0 )
36             for ( int j=1; j<=copy.exp(); j++)
37             g *= copy.factor();
38        else g *= copy.factor();
39    }
40    if ( (f-g) != f.genZero() ){
41        cerr << "\nList and f differ: f= " << f << "  g= " << g << endl;
42        cerr << "List= " << Factorlist << endl;
43    }
44}
Note: See TracBrowser for help on using the repository browser.