sl_ex.cpp
Go to the documentation of this file.
00001 
00002 
00003 
00010 
00011 #define WANT_STREAM
00012 #define WANT_MATH
00013 
00014 #include "include.h"
00015 #include "solution.h"
00016 
00017 #ifdef use_namespace
00018 using namespace RBD_LIBRARIES;
00019 #endif
00020 
00021 
00022 // the cube class
00023 
00024 class Cube : public R1_R1
00025 { Real operator()() { return x*x*x; } };
00026 
00027 
00028 int my_main()
00029 {
00030    // construct the Cube object
00031    Cube cube;
00032    // and then the solve object
00033    OneDimSolve cube_root(cube);
00034    // Now do the solves
00035    for (int i=-10; i<=10; i++)
00036       cout << i << "   "  << cube_root.Solve(i,0,1.5) << endl;
00037    return 0;
00038 }
00039 
00040 // call my_main() - use this to catch exceptions
00041 int main()
00042 {
00043    Try
00044    {
00045       return my_main();
00046    }
00047    Catch(BaseException)
00048    {
00049       cout << BaseException::what() << "\n";
00050    }
00051    CatchAll
00052    {
00053       cout << "\nProgram fails - exception generated\n\n"; 
00054    }
00055    return 0;
00056 }
00057 
00058 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


kni
Author(s): Neuronics AG (see AUTHORS.txt); ROS wrapper by Martin Günther
autogenerated on Tue May 28 2013 14:52:54