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

Bond.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 /*
00025  * LiborMarketModel.h
00026  *
00027  * Created on April 11, 2003, 12;45 AM
00028  */
00029 
00030 #ifndef martingale_bond_h    
00031 #define martingale_bond_h
00032 
00033 #include "TypedefsMacros.h"
00034 #include "Array.h"                // problem with typedefs in forward declarations
00035 
00036 MTGL_BEGIN_NAMESPACE(Martingale)
00037 
00038 
00039 // dependencies
00040 class LiborMarketModel;
00041 
00042 
00049 /*******************************************************************************
00050  *
00051  *                          BONDS
00052  *
00053  ******************************************************************************/
00054 
00055 
00056 
00064 class Bond {
00065    
00066         LiborMarketModel* LMM;  // the object generating the Libors
00067 
00068         int n,                  // number of Libors including L_0
00069             p,q;                // coupon periods [T_p,T_q]
00070 
00071         RealArray1D c;          // c_j units of B_j(t), j=p,...,q-1
00072         RealArray1D b;          // b_j=c_p+...+c_j, j=p,...,q-1
00073 
00074              
00075 public: 
00076         
00078 LiborMarketModel* getLMM() const { return LMM; }
00079         
00081 void setLMM(LiborMarketModel* lmm){ LMM=lmm; }
00082         
00084 int get_p() const { return p; }
00085         
00087 int get_q() const { return q; }
00088         
00090 const RealArray1D& get_c() const { return c; }
00091         
00093 const RealArray1D& get_b() const { return b; }
00094 
00095 // CONSTRUCTOR
00096 
00104 Bond(int k, int m, const RealArray1D& d, LiborMarketModel* lmm);
00105         
00106         
00112 Bond(int i, LiborMarketModel* lmm);
00113 
00114 
00115 // PPRICE
00116         
00120 Real forwardPrice(int t) const;
00121 
00123 Real forwardPrice() const;
00124          
00128 Real cashPrice(int t) const;
00129 
00131 Real cashPrice() const;
00132          
00134 std::ostream& printSelf(std::ostream& os) const;
00135         
00136 }; // end Bond
00137 
00138 
00139 
00140 MTGL_END_NAMESPACE(Martingale)  
00141 
00142 #endif
00143 
00144 

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