American-transaction costs 1.0.0.0
American option pricer under proportional transaction costs
bridge.h
Go to the documentation of this file.
00001 /*
00002     American option pricer under proportional transaction costs
00003     Copyright (C) 2011 Alet Roux alet.roux@york.ac.uk
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 
00018 */
00019 
00020 #ifndef PAYOFFBRIDGE_H
00021 #define PAYOFFBRIDGE_H
00022 
00025 #include "payoff.h"
00026 
00027 #include "neg.h"
00028 
00029 class PayoffBasket;
00030 
00031 
00037 
00038 
00042 class PayoffBridge
00043 {
00044 public:
00045         PayoffBridge (const PayoffBridge& original) { _payoff = original._payoff->clone(); }
00046 
00047         PayoffBridge (const Payoff& payoff) { _payoff = payoff.clone(); }
00048 
00050         Portfolio operator() (const Spot& spot) const { return _payoff->operator() (spot); }
00051 
00053         PayoffBridge& operator= (const PayoffBridge& original)
00054         {
00055                 if (this != &original)
00056                 {
00057                         delete _payoff;
00058                         _payoff = original._payoff->clone();
00059                 }
00060 
00061                 return *this;
00062         }
00063 
00065         PayoffBridge& operator-() const
00066         {
00067                 return *(new PayoffBridge(PayoffNeg (*_payoff)));
00068         }
00069 
00070         ~PayoffBridge() { delete _payoff; }
00071 
00072 protected:
00073 
00074         Payoff* _payoff;
00075 };
00076 
00077 #endif // PAYOFFBRIDGE_H
 All Classes Namespaces Files Functions Variables Typedefs Defines