Update of /cvsroot/quantlibaddin/QuantLibAddin/Clients/C
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17144/Clients/C
Modified Files:
ClientCDemo_vc8.vcproj qlademo.c
Log Message:
merge R000313f0-branch
Index: qlademo.c
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/Clients/C/qlademo.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** qlademo.c 16 Jul 2006 10:42:39 -0000 1.2
--- qlademo.c 28 Aug 2006 10:05:22 -0000 1.3
***************
*** 1,5 ****
/*
! Copyright (C) 2004, 2005 Eric Ehlers
This file is part of QuantLib, a free-software/open-source library
--- 1,5 ----
/*
! Copyright (C) 2004, 2005, 2006 Eric Ehlers
This file is part of QuantLib, a free-software/open-source library
***************
*** 26,43 ****
double underlying = 36;
double strike = 40;
! long exerciseDate = 43903; // (13, March, 2020);
! long settlementDate = 43537; // (13, March, 2019);
char returnString[100];
! Boolean returnCode;
Varies dummy;
- Varies logLevel;
dummy.type = LONG;
dummy.data.AsLong = 0;
- logLevel.type = LONG;
- logLevel.data.AsLong = 4;
! ohSetLogFile("quantlib.log", logLevel, &returnCode); // specify log file
! ohSetConsole(1, logLevel, &returnCode); // log messages to stdout
! ohLogMessage("begin example program", logLevel, &returnCode);
if (qlBlackConstantVol(
--- 26,42 ----
double underlying = 36;
double strike = 40;
! long exerciseDate = 36297; // (17, May, 1999);
! long settlementDate = 35932; // (17, May, 1998);
char returnString[100];
! long logLevel = 4;
! Boolean result;
Varies dummy;
dummy.type = LONG;
dummy.data.AsLong = 0;
! initialize();
! ohSetLogFile("quantlib.log", logLevel, returnString); // specify log file
! ohSetConsole(1, logLevel, &result); // log messages to stdout
! ohLogMessage("begin example program", logLevel, &result);
if (qlBlackConstantVol(
***************
*** 45,51 ****
settlementDate,
volatility,
! "Actual360",
returnString) != SUCCESS) {
! ohLogMessage("Error on call to qlBlackConstantVol", logLevel, &returnCode);
goto fail;
}
--- 44,51 ----
settlementDate,
volatility,
! "Actual/365 (Fixed)",
! dummy,
returnString) != SUCCESS) {
! ohLogMessage("Error on call to qlBlackConstantVol", logLevel, &result);
goto fail;
}
***************
*** 55,74 ****
"my_blackconstantvol",
underlying,
! "Actual360",
settlementDate,
riskFreeRate,
dividendYield,
returnString) != SUCCESS) {
! ohLogMessage("Error on call to qlBlackScholesProcess", logLevel, &returnCode);
goto fail;
}
! if (qlAmericanExercise(
"my_exercise",
! settlementDate,
! exerciseDate,
dummy,
returnString) != SUCCESS) {
! ohLogMessage("Error on call to qlAmericanExercise", logLevel, &returnCode);
goto fail;
}
--- 55,94 ----
"my_blackconstantvol",
underlying,
! "Actual/365 (Fixed)",
settlementDate,
riskFreeRate,
dividendYield,
+ dummy,
returnString) != SUCCESS) {
! ohLogMessage("Error on call to qlBlackScholesProcess", logLevel, &result);
goto fail;
}
! if (qlEuropeanExercise(
"my_exercise",
! exerciseDate,
dummy,
returnString) != SUCCESS) {
! ohLogMessage("Error on call to qlAmericanExercise", logLevel, &result);
! goto fail;
! }
!
! if (qlStrikedTypePayoff(
! "my_payoff",
! "vanilla",
! "put",
! strike,
! dummy,
! returnString) != SUCCESS) {
! ohLogMessage("Error on call to qlAmericanExercise", logLevel, &result);
! goto fail;
! }
!
! if (qlPricingEngine(
! "my_engine",
! "AE", // analytic european
! dummy,
! returnString) != SUCCESS) {
! ohLogMessage("Error on call to qlAmericanExercise", logLevel, &result);
goto fail;
}
***************
*** 77,95 ****
"my_option", // option object ID
"my_stochastic", // stochastic process object ID
! "Put", // option type
! "Vanilla", // payoff type
! strike, // strike price
"my_exercise", // exercise object ID
! "JR", // engine type (jarrow rudd)
dummy, // time steps
returnString) != SUCCESS) {
! ohLogMessage("Error on call to qlVanillaOption", logLevel, &returnCode);
goto fail;
}
! ohLogMessage("high-level interrogation - after qlVanillaOption", logLevel, &returnCode);
! ohLogObject("my_option", &returnCode);
! ohLogMessage("end example program", logLevel, &returnCode);
return 0;
--- 97,113 ----
"my_option", // option object ID
"my_stochastic", // stochastic process object ID
! "my_payoff", // payoff object ID
"my_exercise", // exercise object ID
! "my_engine", // engine object ID
dummy, // time steps
returnString) != SUCCESS) {
! ohLogMessage("Error on call to qlVanillaOption", logLevel, &result);
goto fail;
}
! ohLogMessage("high-level interrogation - after qlVanillaOption", logLevel, &result);
! ohLogObject("my_option", &result);
! ohLogMessage("end example program", logLevel, &result);
return 0;
Index: ClientCDemo_vc8.vcproj
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/Clients/C/ClientCDemo_vc8.vcproj,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ClientCDemo_vc8.vcproj 11 Jun 2006 18:16:49 -0000 1.3
--- ClientCDemo_vc8.vcproj 28 Aug 2006 10:05:22 -0000 1.4
***************
*** 45,49 ****
Optimization="2"
InlineFunctionExpansion="1"
! AdditionalIncludeDirectories="$(OBJECT_HANDLER_DIR),$(QL_DIR),$(QUANTLIBADDIN_DIR)"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
--- 45,49 ----
Optimization="2"
InlineFunctionExpansion="1"
! AdditionalIncludeDirectories="$(OBJECT_HANDLER_DIR),$(QL_DIR),..\.."
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
***************
*** 137,141 ****
Name="VCCLCompilerTool"
Optimization="0"
! AdditionalIncludeDirectories="$(OBJECT_HANDLER_DIR),$(QL_DIR),$(QUANTLIBADDIN_DIR)"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
--- 137,141 ----
Name="VCCLCompilerTool"
Optimization="0"
! AdditionalIncludeDirectories="$(OBJECT_HANDLER_DIR),$(QL_DIR),..\.."
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
***************
*** 232,236 ****
Optimization="2"
InlineFunctionExpansion="1"
! AdditionalIncludeDirectories="$(OBJECT_HANDLER_DIR),$(QL_DIR),$(QUANTLIBADDIN_DIR)"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
--- 232,236 ----
Optimization="2"
InlineFunctionExpansion="1"
! AdditionalIncludeDirectories="$(OBJECT_HANDLER_DIR),$(QL_DIR),..\.."
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="true"
***************
*** 324,328 ****
Name="VCCLCompilerTool"
Optimization="0"
! AdditionalIncludeDirectories="$(OBJECT_HANDLER_DIR),$(QL_DIR),$(QUANTLIBADDIN_DIR)"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
--- 324,328 ----
Name="VCCLCompilerTool"
Optimization="0"
! AdditionalIncludeDirectories="$(OBJECT_HANDLER_DIR),$(QL_DIR),..\.."
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
|