sl_ex.cpp
Go to the documentation of this file.
1 
10 
11 #define WANT_STREAM
12 #define WANT_MATH
13 
14 #include "include.h"
15 #include "solution.h"
16 
17 #ifdef use_namespace
18 using namespace RBD_LIBRARIES;
19 #endif
20 
21 
22 // the cube class
23 
24 class Cube : public R1_R1
25 { Real operator()() { return x*x*x; } };
26 
27 
28 int my_main()
29 {
30  // construct the Cube object
31  Cube cube;
32  // and then the solve object
33  OneDimSolve cube_root(cube);
34  // Now do the solves
35  for (int i=-10; i<=10; i++)
36  cout << i << " " << cube_root.Solve(i,0,1.5) << endl;
37  return 0;
38 }
39 
40 // call my_main() - use this to catch exceptions
41 int main()
42 {
43  Try
44  {
45  return my_main();
46  }
48  {
49  cout << BaseException::what() << "\n";
50  }
51  CatchAll
52  {
53  cout << "\nProgram fails - exception generated\n\n";
54  }
55  return 0;
56 }
57 
58 
#define Try
Definition: myexcept.h:190
#define Catch
Definition: myexcept.h:193
double Real
Definition: include.h:307
#define CatchAll
Definition: myexcept.h:194
Definition: solution.h:22
Definition: sl_ex.cpp:24
int my_main()
Definition: sl_ex.cpp:28
Real operator()()
Definition: sl_ex.cpp:25
static const char * what()
Definition: myexcept.h:93
int main()
Definition: sl_ex.cpp:41
Real Solve(Real Y, Real X, Real Dev, int Lim=100)
Definition: solution.cpp:99


kni
Author(s): Martin Günther
autogenerated on Fri Jan 3 2020 04:01:16