American-transaction costs 1.0.0.0
American option pricer under proportional transaction costs
|
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 00025 00026 #define USE_ASSERT 00027 #ifdef USE_ASSERT 00028 #include <assert.h> 00029 #endif 00030 00032 #define VERBOSE_UNTANGLE_RESTRICTION 00033 #ifdef VERBOSE_UNTANGLE_RESTRICTION 00034 #include <iostream> 00035 #endif 00036 00038 #define VERBOSE_PIECEWISELINEAR_CHECK 00039 00041 #define VERBOSE_PIECEWISELINEAR_RESTRICT_SLOPE 00042 00044 #define VERBOSE_PIECEWISELINEAR_MAXIMUM 00045 00047 #define VERBOSE_PIECEWISELINEAR_CROSSING 00048 00050 #define VERBOSE_PIECEWISELINEAR_UNTANGLE_MAXIMUM 00051 00053 #define VERBOSE_FLEXIBLETREE_EMM_EXERCISE_FUNCTION 00054 #ifdef VERBOSE_FLEXIBLETREE_EMM_EXERCISE_FUNCTION 00055 #include <iostream> 00056 #endif 00057 00059 #define VERBOSE_FLEXIBLETREE_HEDGING_FUNCTION 00060 #ifdef VERBOSE_FLEXIBLETREE_HEDGING_FUNCTION 00061 #define VERBOSE_UNTANGLE_RESTRICTION 00062 #endif 00063 00065 #define VERBOSE_FLEXIBLETREE_EXERCISE_FUNCTION 00066 #ifdef VERBOSE_FLEXIBLETREE_EXERCISE_FUNCTION 00067 #include <iostream> 00068 #define VERBOSE_TREEPRODUCT_AMERICANBUYER_EXERCISE 00069 #endif 00070 00072 #define VERBOSE_FLEXIBLETREE_PRICING_FUNCTION 00073 #ifdef VERBOSE_FLEXIBLETREE_PRICING_FUNCTION 00074 #include <iostream> 00075 #endif 00076 00078 #define VERBOSE_TREEPRODUCT_AMERICANBUYER_EXERCISE