1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
2 | /* $Id: totaldegree.m4,v 1.4 1998-04-06 10:49:17 schmidt Exp $ */ |
---|
3 | |
---|
4 | ftestSetNameOfGame( totaldegree, `" |
---|
5 | Usage: totaldegree [<options>] [<envSpec>] <f> [<x> <y>] |
---|
6 | calculates total degree of canonical form <f>. If the |
---|
7 | variables <x> and <y> are specified, calculates total |
---|
8 | degree of <f> with respect to the polynomial variables |
---|
9 | between <x> and <y> (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 | if ( ftestArgGiven( x ) ) { |
---|
51 | ftestRun( result = totaldegree( f, x, y ); ); |
---|
52 | } else { |
---|
53 | ftestRun( result = totaldegree( f ); ); |
---|
54 | } |
---|
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 | } |
---|