Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

DirichletProblem.h

Go to the documentation of this file.
00001 /* WARANTY NOTICE AND COPYRIGHT
00002 This program is free software; you can redistribute it and/or
00003 modify it under the terms of the GNU General Public License
00004 as published by the Free Software Foundation; either version 2
00005 of the License, or (at your option) any later version.
00006 
00007 This program is distributed in the hope that it will be useful,
00008 but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 GNU General Public License for more details.
00011 
00012 You should have received a copy of the GNU General Public License
00013 along with this program; if not, write to the Free Software
00014 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00015 
00016 Copyright (C) Michael J. Meyer
00017 
00018 matmjm@mindspring.com
00019 spyqqqdia@yahoo.com
00020 
00021 */
00022 
00023 #ifndef martingale_dirichletproblem_h
00024 #define martingale_dirichletproblem_h
00025 
00026 #include "TypedefsMacros.h"
00027 #include "Matrix.h"                           // typedef problem in forward declarations
00028 
00029 MTGL_BEGIN_NAMESPACE(Martingale) 
00030 
00031 
00032 // we are using
00033 class DirichletProblemExample;
00034 class EuclideanRegion;
00035 class Ball;
00036 class VectorBrownianMotion;
00037 class StoppingTime;
00038 // class RealVector
00039 
00040 
00064 class DirichletProblem {
00065         
00066 protected:
00067         
00068         int dim;                    // dimension
00069         EuclideanRegion* G;         // region on which it is solved
00070         VectorBrownianMotion* X;
00071         StoppingTime* tau;          // the first exit time of X from G
00072 
00073 public: 
00074         
00076         virtual Real boundaryFunction(const RealVector& u) = 0;
00077         
00078 // CONSTRUCTOR
00079         
00091         DirichletProblem(EuclideanRegion* D, int T, Real dt=0.01);
00092         
00093         
00100         Real solution(const RealVector& x, int nPath=50000, bool reportHits=false);
00101         
00102         
00103 }; // end DirichletProblem
00104 
00105 
00106 
00107 // AN EXAMPLE
00108 
00109 
00114 class DirichletProblemExample : public DirichletProblem {
00115         
00116 public:
00117         
00123         DirichletProblemExample(int dim, int T, Real dt=0.01);
00124         
00125         Real boundaryFunction(const RealVector& u);
00126                 
00127         
00139         static void runExample(int d, int T);
00140         
00141         
00142 }; // end DirichletProblemExample
00143                 
00144 
00145 
00146 MTGL_END_NAMESPACE(Martingale) 
00147 
00148 
00149 #endif
00150 

Generated on Mon Sep 22 02:16:32 2003 for Libor-Library by doxygen1.3-rc3