sl_ex.cc
Go to the documentation of this file.
00001 // This is an example of the use of solution to find the cube root of 
00002 // the integers -10 to 10
00003 
00004 // you will need to compile and link solution.cpp and except.cpp
00005 
00006 #define WANT_STREAM
00007 #define WANT_MATH
00008 
00009 #include "include.h"
00010 #include "solution.h"
00011 
00012 #ifdef use_namespace
00013 using namespace RBD_LIBRARIES;
00014 #endif
00015 
00016 
00017 // the cube class
00018 
00019 class Cube : public R1_R1
00020 { Real operator()() { return x*x*x; } };
00021 
00022 int main()
00023 {
00024    // construct the Cube object
00025    Cube cube;
00026    // and then the solve object
00027    OneDimSolve cube_root(cube);
00028    // Now do the solves
00029    for (int i=-10; i<=10; i++)
00030       cout << i << "   "  << cube_root.Solve(i,0,1.5) << endl;
00031    return 0;
00032 }
00033 


rl_agent
Author(s): Todd Hester
autogenerated on Thu Jun 6 2019 22:00:13