source: git/factory/ftest/totaldegree.m4 @ a40e7b

spielwiese
Last change on this file since a40e7b was fa8420, checked in by Jens Schmidt <schmidt@…>, 26 years ago
***** merge from branch `factory-gcd' to main trunk git-svn-id: file:///usr/local/Singular/svn/trunk@1328 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.5 KB
Line 
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
4ftestSetNameOfGame( totaldegree, `"
5Usage: 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
23ftestPreprocInit();
24
25ftestGlobalInit();
26
27//
28// - main program.
29//
30int
31main ( 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}
Note: See TracBrowser for help on using the repository browser.