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

Node.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 
00024 #ifndef martingale_node_h    
00025 #define martingale_node_h
00026 
00027 // implementation is in header
00028 #include "TypedefsMacros.h"
00029 #include "Array.h" 
00030 
00031 MTGL_BEGIN_NAMESPACE(Martingale)
00032 
00033 
00034 
00035 
00051 /**********************************************************************************
00052  *
00053  *            NODES A STOCHASTIC LATTICE
00054  *
00055  *********************************************************************************/
00056 
00057 
00058 
00059 
00069 class StandardBrownianNode {
00070         
00071 protected:
00072         
00074         int* k_;
00075 
00077         Real  value;               
00078         
00080         Array1D<StandardBrownianNode*> edges; 
00081         
00082 public:
00083         
00085 int* getIntegerTicks(){ return k_; }
00086         
00088 Real getValue() const { return value; }
00090 void setValue(Real x){ value=x; }
00091         
00093 Array1D<StandardBrownianNode*>& getEdges() { return edges; }
00094         
00095         
00096 // CONSTRUCTOR
00097         
00100 StandardBrownianNode(int nEdge, const IntArray1D& k) : 
00101 k_(new int[k.getDimension()]),
00102 value(-1.0),
00103 edges(nEdge)
00104 {
00105         for(int i=0;i<k.getDimension();i++) k_[i]=k[i];
00106 }
00107         
00108 virtual ~StandardBrownianNode(){ delete[] k_; };
00109 
00110 
00112 std::ostream& printSelf(std::ostream& os)
00113 {
00114         return
00115         os << "\n\nStandardBrownianNode, value V =  " << value;
00116 }
00117          
00118 }; // end StandardBrownianNode
00119 
00120 
00121 
00122 
00123         
00124 MTGL_END_NAMESPACE(Martingale)
00125 
00126 #endif
00127  

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