source: git/factory/examples/factorize.cc @ 4fee0ed

fieker-DuValspielwiese
Last change on this file since 4fee0ed was 362fc67, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg: remove $Id$
  • Property mode set to 100644
File size: 982 bytes
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2
3//{{{ docu
4//
5// factorize.cc - sample Factory application.
6//
7//}}}
8
9#include <factory.h>
10
11int
12main()
13{
14    Variable x( 'x' );
15    Variable y( 'y' );
16    Variable z( 'z' );
17    CanonicalForm f;
18
19    cout << "Do not forget to terminate canonical forms with `;' in input!" << endl;
20
21    setCharacteristic( 0 );
22    cout << "Multivariate factorization in characteristic 0." << endl;
23    cout << "Please enter a multivariate polynomial over Z." << endl;
24    cout << "f(x, y, z) = ";
25    cin >> f;
26    cout << "f                  = " << f << endl;
27    cout << "factorize(f)       = " << factorize( f ) << endl << endl;
28
29    setCharacteristic( 29 );
30    cout << "Univariate factorization in GF(29)." << endl;
31    cout << "Please enter an univariate polynomial over GF(29)." << endl;
32    cout << "f(x) = ";
33    cin >> f;
34    cout << "f (mod 29)         = " << f << endl;
35    cout << "factorize(f)       = " << factorize( f ) << endl;
36}
Note: See TracBrowser for help on using the repository browser.