source: git/libfac/test.cc @ 1a80b4

spielwiese
Last change on this file since 1a80b4 was 1a80b4, checked in by Hans Schönemann <hannes@…>, 27 years ago
This commit was generated by cvs2svn to compensate for changes in r229, which included commits to RCS files with non-trunk default branches. git-svn-id: file:///usr/local/Singular/svn/trunk@230 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.6 KB
RevLine 
[1a80b4]1//static char rcsid[] = "$Id: test.cc,v 1.1.1.1 1997-05-02 17:00:43 Singular Exp $";
2///////////////////////////////////////////////////////////////////////////////
3// FACTORY - Includes
4//       (x+y+z)*(x+y-z)*(x-y+z)*(x-y-z)*x*y;
5#include <factory.h>
6// Factor - Includes
7#include "factor.h"
8#include "tmpl_inst.h"
9#include "helpstuff.h"
10
11extern char * libfac_name;
12extern char * libfac_version;
13extern char * libfac_date;
14extern char * libfac_author;
15
16void
17setVarNames ( char * vnames )
18{
19    int i, n = strlen( vnames );
20    Variable dummy;
21    for ( i = 0; i < n; i++ )
22        dummy = Variable( i+1, vnames[i] );
23}
24
25main()
26{
27    CanonicalForm f,g;
28    int charac;
29    CFFList Factorlist;
30    CFFactor copy;
31
32cout << libfac_name  <<", Version " << libfac_version << endl;
33//    cout << " Characteristic = ";
34    cin >> charac;
35    setCharacteristic(charac);
36    On(SW_SYMMETRIC_FF);
37    On(SW_USE_EZGCD);
38//////////////////////////////////////////////////////////////
39//  char vnames[30];
40////  cout << " vnames = ";
41//  cin >> vnames;
42//
43//  setVarNames( vnames );
44//
45//////////////////////////////////////////////////////////////
46//    cout << " f = ";
47    cin >> f;
48    cout << f  << " mod " << charac << " = " ;
49    Factorlist= Factorize( f,0 );
50     cout << Factorlist ;//<< endl;
51// Ueberpruefen:
52    g=1;
53    for ( CFFListIterator i=Factorlist ; i.hasItem(); i++){
54        copy = i.getItem();
55        if ( getNumVars(copy.factor()) > 0 )
56             for ( int j=1; j<=copy.exp(); j++)
57             g *= copy.factor();
58        else g *= copy.factor();
59    }
60    if ( (f-g) != f.genZero() ){
61        cerr << "\nList and f differ: f= " << f << "  g= " << g << endl;
62    }
63}
Note: See TracBrowser for help on using the repository browser.