source: git/factory/ftest/insert.m4 @ 07cdd8

spielwiese
Last change on this file since 07cdd8 was 07cdd8, checked in by Jens Schmidt <schmidt@…>, 26 years ago
Initial revision git-svn-id: file:///usr/local/Singular/svn/trunk@879 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.3 KB
Line 
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
4ftestSetNameOfGame( insert, `"
5Usage: 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
21ftestPreprocInit();
22
23ftestGlobalInit();
24
25//
26// - main program.
27//
28int
29main ( 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}
Note: See TracBrowser for help on using the repository browser.