1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
2 | /* $Id: totaldegree.m4,v 1.3 1997-11-05 16:12:21 schmidt Exp $ */ |
---|
3 | |
---|
4 | ftestSetNameOfGame( totaldegree, `" |
---|
5 | Usage: totaldegree [<options>] [<envSpec>] <f> [<x> <y>] |
---|
6 | calculates total degree of canonical form f. If the variables |
---|
7 | x and y are specified, calculates total degree of f with |
---|
8 | respect to the polynomial variables between x and y |
---|
9 | (inclusively). |
---|
10 | "'`' ) |
---|
11 | |
---|
12 | //{{{ docu |
---|
13 | // |
---|
14 | // ftestAlgorithm.m4 - ftestAlgorithm test program. |
---|
15 | // |
---|
16 | // To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in |
---|
17 | // the following way: |
---|
18 | // |
---|
19 | // m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc |
---|
20 | // |
---|
21 | //}}} |
---|
22 | |
---|
23 | ftestPreprocInit(); |
---|
24 | |
---|
25 | ftestGlobalInit(); |
---|
26 | |
---|
27 | // |
---|
28 | // - main program. |
---|
29 | // |
---|
30 | int |
---|
31 | main ( int argc, char ** argv ) |
---|
32 | { |
---|
33 | // initialization |
---|
34 | ftestMainInit(); |
---|
35 | |
---|
36 | // declare input and output variables |
---|
37 | ftestOutVar( int, result ); |
---|
38 | ftestInVar( CanonicalForm, f ); |
---|
39 | ftestInVar( Variable, x ); |
---|
40 | ftestInVar( Variable, y ); |
---|
41 | |
---|
42 | // process argument list and set environment |
---|
43 | ftestGetOpts(); |
---|
44 | ftestGetEnv(); |
---|
45 | ftestGetInVar( f ); |
---|
46 | ftestGetInVar( x, Variable() ); |
---|
47 | ftestGetInVar( y, Variable() ); |
---|
48 | |
---|
49 | // do the test! |
---|
50 | ftestRun( |
---|
51 | if ( ftestArgGiven( x ) ) |
---|
52 | result = totaldegree( f, x, y ); |
---|
53 | else |
---|
54 | result = totaldegree( f ); ); |
---|
55 | |
---|
56 | // print results |
---|
57 | if ( ftestArgGiven( x ) ) { |
---|
58 | ftestOutput( "totaldegree(f, x, y)", result ); |
---|
59 | } else { |
---|
60 | ftestOutput( "totaldegree(f)", result ); |
---|
61 | } |
---|
62 | |
---|
63 | // clean up |
---|
64 | ftestMainExit(); |
---|
65 | } |
---|