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