Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

testObjects.h File Reference

#include <string>
#include "../PartB/yieldCurve.h"
#include "../PartE/volsurface.h"

Go to the source code of this file.

Functions

bool maindate (void)
 test the date class

bool mainmontecarlo (void)
 test the montecarlo option pricer functionality

double mainmc (double Expiry, double Strike, double Spot, volsurface *Vol, yieldCurve *r, unsigned long nPaths, unsigned long nDates, int PrdName)
 main routine which runs the montecarlo pricer

bool mainoption (void)
 test the BS option pricing functionality

bool mainoptionstrategy (void)
 test the option strategy functionality

bool mainmatrix (void)
 test the matrix functions

bool maininterpolator (void)
 test the 2d/3d interpolator functionality

bool mainyieldcurve (void)
 test the yield curve functionality

bool mainasset (void)
 test the asset functionality

bool mainfilereader (void)
 test the file reader functionality

bool fr_basic (void)
 file reader basic test

bool mainvolsurface (void)
 test the volsurface functionality

bool maincreditcurve (void)
 test of the credit curve object

bool mainrainbowoptions (void)
 test of the credit curve object

bool mainbond (void)
 test the bond functionality

bool mainvarianceswap (void)
 test of the variance swaps object

bool mainbinomialtree (void)
 test of the binomial tree object

bool mainconvertiblebond (void)
 test of the convertible bond object

bool mainIRVanillaSwap (void)
 Test of the Vanilla Swap - Yann.


Function Documentation

bool fr_basic void   ) 
 

file reader basic test

Returns:
true if pass, otherwise fail

Definition at line 53 of file mainfilereader.cpp.

References FileReader::fileexists(), and FileReader::getdatadirasstring().

Referenced by mainfilereader().

bool mainasset void   ) 
 

test the asset functionality

Author:
Yann

Definition at line 14 of file maintestasset.cpp.

References a, FileReader::buildYieldPointArray(), EUR, asset::forwardPrice(), FileReader::getdatadirasstring(), Natural, Date::plusDays(), Date::plusMonths(), Date::plusYears(), Real, Date::setDateToToday(), and Date::toString().

Referenced by maintests().

bool mainbinomialtree void   ) 
 

test of the binomial tree object

Returns:
true if pass, otherwise fail

Definition at line 7 of file mainbinomialtree.cpp.

References Call, binomialTree::getPrice(), BlackScholes::getPrice(), binomialTree::getStockProcess(), LongNatural, mainmc(), Natural, r, Real, realsEqual(), and binomialTree::runEngineCall().

Referenced by maintests().

bool mainbond void   ) 
 

test the bond functionality

Returns:
true if pass, otherwise fail

Definition at line 12 of file mainbond.cpp.

References ACT_365, bond::convexity(), DayCountConvention, bond::duration(), bond::fairvalue(), Frequency, May, November, Real, Semiannual, and bond::yieldToMaturity().

Referenced by maintests().

bool mainconvertiblebond void   ) 
 

test of the convertible bond object

Returns:
true if pass, otherwise fail

Definition at line 5 of file mainconvertiblebond.cpp.

References ACT_365, Days, convertiblebond::fairvalue(), Months, Natural, convertiblebond::parityDelta(), convertiblebond::parityGamma(), Date::plus(), Real, realsEqual(), convertiblebond::rho(), Date::setDateToToday(), and asset::setPrice().

Referenced by maintests().

bool maincreditcurve void   ) 
 

test of the credit curve object

Returns:
true if pass, otherwise fail

Definition at line 9 of file maincreditcurves.cpp.

References FileReader::buildCreditSpreadPointArray(), FileReader::buildYieldPointArray(), creditCurve::creditSpread(), creditCurve::cumulativeDefaultProbability(), creditCurve::defaultProbability(), FileReader::getdatadirasstring(), creditCurve::hazardRate(), Natural, Real, creditCurve::riskyDiscountFactor(), and creditCurve::survivalProbability().

Referenced by maintests().

bool maindate void   ) 
 

test the date class

Returns:
true if pass, otherwise fail

Definition at line 7 of file maindate.cpp.

References Date::lastDayOfMonth(), Date::setDateToToday(), and Date::toString().

Referenced by maintests().

bool mainfilereader void   ) 
 

test the file reader functionality

Returns:
true if pass, otherwise fail

Definition at line 45 of file mainfilereader.cpp.

References fr_basic().

Referenced by maintests().

bool maininterpolator void   ) 
 

test the 2d/3d interpolator functionality

Returns:
true if pass, otherwise fail

Definition at line 5 of file maininterpolator.cpp.

References Integer, interpolator::interpolate(), and Real.

Referenced by maintests().

bool mainIRVanillaSwap void   ) 
 

Test of the Vanilla Swap - Yann.

Author:
Yann

Definition at line 9 of file mainIRVanillaSwap.cpp.

References FileReader::buildYieldPointArray(), FileReader::getdatadirasstring(), CashFlow::getFairValue(), Date::plusMonths(), Date::plusYears(), Real, VanillaSwap::returnPrice(), and Date::setDateToToday().

Referenced by maintests().

bool mainmatrix void   ) 
 

test the matrix functions

Author:
Yann

Definition at line 16 of file mainmatrix.cpp.

References Matrix::CholeskyDecomposition(), Matrix::GetTransposed(), Natural, Matrix::SetValue(), transform1DvalarrayToColumnMatrix(), transform2DvalarrayToMatrix(), transformColumnMatrixTo1Dvalarray(), and transformMatrixTo2Dvalarray().

Referenced by maintests().

double mainmc double  Expiry,
double  Strike,
double  Spot,
volsurface Vol,
yieldCurve r,
unsigned long  nPaths,
unsigned long  nDates,
int  PrdName
 

main routine which runs the montecarlo pricer

bool mainmontecarlo void   ) 
 

test the montecarlo option pricer functionality

Returns:
true if pass, otherwise fail

Definition at line 19 of file mainmontecarlo.cpp.

References LongNatural, mainmc(), and Real.

Referenced by maintests().

bool mainoption void   ) 
 

test the BS option pricing functionality

Returns:
true if pass, otherwise fail

Definition at line 5 of file mainoptionstrategy.cpp.

References Call, BlackScholes::getDelta(), BlackScholes::getGamma(), BlackScholes::getPrice(), BlackScholes::getRho(), BlackScholes::getTheta(), BlackScholes::getVega(), BlackScholes::getVolatility(), and LongNatural.

Referenced by maintests().

bool mainoptionstrategy void   ) 
 

test the option strategy functionality

Returns:
true if pass, otherwise fail

Definition at line 26 of file mainoptionstrategy.cpp.

References OptionStrategy::addLongButterflySpread(), OptionStrategy::getGlobalDelta(), and OptionStrategy::returnPrice().

Referenced by maintests().

bool mainrainbowoptions void   ) 
 

test of the credit curve object

Author:
Yann

* Types (MonteCarlo, ClosedForm )

Definition at line 13 of file mainrainbowoptions.cpp.

References AssetsBasketMax, BestOf2AssetsCash, BetterOf2Assets, ClosedForm, RainbowOption::getCorrelRisk(), RainbowOption::getPartialDelta(), RainbowOption::getPartialGamma(), RainbowOption::getPartialVega(), RainbowOption::getPrice(), RainbowOption::getRho(), Max2AssetsCall, Max2AssetsPut, Min2AssetsCall, Min2AssetsPut, MonteCarlo, Real, Date::setDateToToday(), RainbowOption::setRainbowType(), SpreadOptionMax, WorseOf2Assets, and WorstOf2AssetsCash.

Referenced by maintests().

bool mainvarianceswap void   ) 
 

test of the variance swaps object

Returns:
true if pass, otherwise fail

Definition at line 9 of file mainvarianceswap.cpp.

References OptionStrategy::addLongButterflySpread(), OptionStrategy::addOneBlackScholesObject(), Call, VarianceSwap::getPrice(), Natural, Put, and Real.

Referenced by maintests().

bool mainvolsurface void   ) 
 

test the volsurface functionality

Returns:
true if pass, otherwise fail

Definition at line 12 of file mainvolsurface.cpp.

References FileReader::buildVolSurfaceParams(), December, July, March, Real, September, volsurface::setvolsurface(), Date::toString(), and volsurface::volatility().

Referenced by maintests().

bool mainyieldcurve void   ) 
 

test the yield curve functionality

Author:
Yann

Definition at line 13 of file mainyieldcurves.cpp.

References FileReader::buildYieldPointArray(), Continuous, Discrete, FileReader::getdatadirasstring(), yieldCurve::getMaturitiesInTheZCBCurve(), Month, Natural, Date::plusMonths(), Real, yieldCurve::rotateZCBRateCurve(), Date::setDateToToday(), yieldCurve::shiftZCBRateCurve(), and yieldCurve::spotRate().

Referenced by maintests().


Note: Generated nightly - reload for latest version
Generated on Thu Dec 22 23:12:38 2005 for terreneuve by doxygen 1.3.6