source: git/libfac/test.cc @ 4a81ec

fieker-DuValspielwiese
Last change on this file since 4a81ec was 4a81ec, checked in by Hans Schönemann <hannes@…>, 27 years ago
* hannes/michael: libfac-0.3.0 git-svn-id: file:///usr/local/Singular/svn/trunk@708 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.3 1997-09-12 07:19:34 Singular Exp $";
2///////////////////////////////////////////////////////////////////////////////
3// Factor - Includes
4#include "factor.h"
5
6
7void
8setVarNames ( 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
16main()
17{
18    CanonicalForm f,g;
19    int charac;
20    CFFList Factorlist;
21    CFFactor copy;
22
23cout << 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.