Skip to content

Commit

Permalink
Another refinement for vanilla.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Jul 30, 2024
1 parent 3ad421c commit e8432a7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-07-30 Dirk Eddelbuettel <[email protected]>

* src/vanilla.cpp: Refinement

2024-07-29 Dirk Eddelbuettel <[email protected]>

* DESCRIPTION (Version, Date): Roll micro release and date
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: RQuantLib
Title: R Interface to the 'QuantLib' Library
Version: 0.4.23.2
Date: 2024-07-29
Date: 2024-07-30
Maintainer: Dirk Eddelbuettel <[email protected]>
Author: Dirk Eddelbuettel, Khanh Nguyen (2009-2010), Terry Leitch (since 2016)
Description: The 'RQuantLib' package makes parts of 'QuantLib' accessible from R
Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for RQuantlib 0.4.24.
# Generated by GNU Autoconf 2.71 for RQuantlib 0.4.23.2.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -610,8 +610,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='RQuantlib'
PACKAGE_TARNAME='rquantlib'
PACKAGE_VERSION='0.4.24'
PACKAGE_STRING='RQuantlib 0.4.24'
PACKAGE_VERSION='0.4.23.2'
PACKAGE_STRING='RQuantlib 0.4.23.2'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -1232,7 +1232,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures RQuantlib 0.4.24 to adapt to many kinds of systems.
\`configure' configures RQuantlib 0.4.23.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1294,7 +1294,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of RQuantlib 0.4.24:";;
short | recursive ) echo "Configuration of RQuantlib 0.4.23.2:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1383,7 +1383,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
RQuantlib configure 0.4.24
RQuantlib configure 0.4.23.2
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1497,7 +1497,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by RQuantlib $as_me 0.4.24, which was
It was created by RQuantlib $as_me 0.4.23.2, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -4025,7 +4025,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by RQuantlib $as_me 0.4.24, which was
This file was extended by RQuantlib $as_me 0.4.23.2, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -4080,7 +4080,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
RQuantlib config.status 0.4.24
RQuantlib config.status 0.4.23.2
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AC_PREREQ([2.69])
# Process this file with autoconf to produce a configure script.

# Would like to extract R package version from R DESCRIPTION file
AC_INIT([RQuantlib],[0.4.24],[[email protected]])
AC_INIT([RQuantlib],[0.4.23.2],[[email protected]])

# Set CXX and CXXFLAGS based on the R configuration (with thanks to KH)
: ${R_HOME=`R RHOME`}
Expand Down
6 changes: 3 additions & 3 deletions src/vanilla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Rcpp::List europeanOptionEngine(std::string type,
QuantLib::Handle<QuantLib::YieldTermStructure>(rTS),
QuantLib::Handle<QuantLib::BlackVolTermStructure>(volTS));

#if QL_HEX_VERSION >= 0x013500c0 || defined(__APPLE__)
#if QL_HEX_VERSION >= 0x013500c0
auto engine = qlext::make_shared<QuantLib::AnalyticDividendEuropeanEngine>(stochProcess, QuantLib::DividendVector(discDivDates, discDividends));
QuantLib::VanillaOption option(payoff, exercise);
#else
Expand Down Expand Up @@ -149,7 +149,7 @@ Rcpp::List americanOptionEngine(std::string type,
discDividends[i] = divvalues[i];
}

#if QL_HEX_VERSION >= 0x013500c0 || defined(__APPLE__)
#if QL_HEX_VERSION >= 0x013500c0
QuantLib::VanillaOption option(payoff, exercise);
#else
QL_DEPRECATED_DISABLE_WARNING
Expand All @@ -163,7 +163,7 @@ Rcpp::List americanOptionEngine(std::string type,
}

if (engine=="CrankNicolson") { // FDDividendAmericanEngine only works with CrankNicolson
#if QL_HEX_VERSION >= 0x013500c0 || defined(__APPLE__)
#if QL_HEX_VERSION >= 0x013500c0
// see eg test-suite/americanoption.cc
option.setPricingEngine(QuantLib::MakeFdBlackScholesVanillaEngine(stochProcess).withCashDividends(discDivDates, discDividends));
#else
Expand Down

0 comments on commit e8432a7

Please sign in to comment.