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