source: git/factory/ftest/deriv.m4 @ ab660b

fieker-DuValspielwiese
Last change on this file since ab660b was ab660b, checked in by Jens Schmidt <schmidt@…>, 27 years ago
* deriv.m4: doc fix git-svn-id: file:///usr/local/Singular/svn/trunk@739 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: deriv.m4,v 1.2 1997-09-24 10:49:52 schmidt Exp $ */
3
4ftestSetNameOfGame( deriv,
5        `"Usage: deriv [<options>] [<envSpec>] <f> [<x>]\n"
6        "  calculates df/dx or derivation of f with respect to main\n"
7        "  variable if x is not present.\n"' )
8
9//{{{ docu
10//
11// ftestAlgorithm.m4 - ftestAlgorithm test program.
12//
13// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
14// the following way:
15//
16// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc'
17//
18//}}}
19
20ftestPreprocInit();
21
22ftestGlobalInit();
23
24//
25// - main program.
26//
27int
28main ( int argc, char ** argv )
29{
30    // initialization
31    ftestMainInit();
32
33    // declare input and output variables
34    ftestOutVar( CanonicalForm, result );
35    ftestInVar( CanonicalForm, f );
36    ftestInVar( Variable, x );
37
38    // process argument list and set environment
39    ftestGetOpts();
40    ftestGetEnv();
41    ftestGetInVar( f );
42    ftestGetInVar( x, Variable() );
43
44    // do the test!
45    ftestRun(
46        if ( x.level() > 0 )
47            result = f.deriv( x );
48        else
49            result = f.deriv(); );
50
51    // print results
52    if ( x.level() > 0 ) {
53        ftestOutput( "df/dx", result );
54    } else {
55        ftestOutput( "df", result );
56    }
57
58    // clean up
59    ftestMainExit();
60}
Note: See TracBrowser for help on using the repository browser.