solution.h
Go to the documentation of this file.00001
00002
00003 #include "myexcept.h"
00004
00005 #ifdef use_namespace
00006 namespace RBD_COMMON {
00007 #endif
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 class R1_R1
00019 {
00020
00021
00022
00023
00024
00025
00026 virtual ~R1_R1();
00027 protected:
00028 Real x;
00029 bool xSet;
00030
00031 public:
00032 Real minX, maxX;
00033 bool minXinf, maxXinf;
00034 R1_R1() : xSet(false), minXinf(true), maxXinf(true) {}
00035 virtual Real operator()() = 0;
00036
00037 virtual void Set(Real X);
00038 Real operator()(Real X) { Set(X); return operator()(); }
00039
00040 virtual bool IsValid(Real X);
00041 operator Real();
00042 };
00043
00044 class SolutionException : public BaseException
00045 {
00046 public:
00047 static unsigned long Select;
00048 SolutionException(const char* a_what = 0);
00049 };
00050
00051 class OneDimSolve
00052 {
00053 R1_R1& function;
00054 Real accX;
00055 Real accY;
00056 int lim;
00057
00058 public:
00059 OneDimSolve(R1_R1& f, Real AccY = 0.0001, Real AccX = 0.0)
00060 : function(f), accX(AccX), accY(AccY) {}
00061
00062 Real Solve(Real Y, Real X, Real Dev, int Lim=100);
00063
00064
00065
00066
00067
00068
00069 private:
00070 Real x[3], y[3];
00071 int L,C,U,Last;
00072 int vpol, hpol;
00073 Real YY;
00074 int i;
00075 void LookAt(int);
00076 bool Finish;
00077 bool Captured;
00078 void VFlip();
00079 void HFlip();
00080 void Flip();
00081 void State(int I, int J, int K);
00082 void Linear(int, int, int);
00083 void Quadratic(int, int, int);
00084 };
00085
00086
00087 #ifdef use_namespace
00088 }
00089 #endif
00090
00091
00092
00093
00094