pax_global_header 0000666 0000000 0000000 00000000064 15073132404 0014511 g ustar 00root root 0000000 0000000 52 comment=4964faa6bac471fb941b7fb0c5ea1de470c691b3
QuantLib-SWIG-1.40/ 0000775 0000000 0000000 00000000000 15073132404 0013723 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.40/.ci/ 0000775 0000000 0000000 00000000000 15073132404 0014374 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.40/.ci/csharp.build 0000775 0000000 0000000 00000000164 15073132404 0016701 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
./autogen.sh
./configure CC=clang CXX=clang++ CXXFLAGS='-O2'
make -C CSharp SWIGFLAGS='-Werror'
QuantLib-SWIG-1.40/.ci/csharp.check 0000775 0000000 0000000 00000000051 15073132404 0016652 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
make -C CSharp check
QuantLib-SWIG-1.40/.ci/csharp.install 0000775 0000000 0000000 00000000023 15073132404 0017242 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
QuantLib-SWIG-1.40/.ci/java-new.build 0000775 0000000 0000000 00000000510 15073132404 0017124 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
./autogen.sh
./configure --disable-java-finalizer --enable-java-autocloseable \
--with-jdk-include=/usr/lib/jvm/default-java/include \
--with-jdk-system-include=/usr/lib/jvm/default-java/include/linux \
CC=clang CXX=clang++ CXXFLAGS='-O2'
make -C Java SWIGFLAGS='-Werror'
QuantLib-SWIG-1.40/.ci/java-new.check 0000775 0000000 0000000 00000000047 15073132404 0017107 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
make -C Java check
QuantLib-SWIG-1.40/.ci/java-new.install 0000775 0000000 0000000 00000000023 15073132404 0017472 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
QuantLib-SWIG-1.40/.ci/java-old.build 0000775 0000000 0000000 00000000405 15073132404 0017114 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
./autogen.sh
./configure --with-jdk-include=/usr/lib/jvm/default-java/include \
--with-jdk-system-include=/usr/lib/jvm/default-java/include/linux \
CC=clang CXX=clang++ CXXFLAGS='-O2'
make -C Java SWIGFLAGS='-Werror'
QuantLib-SWIG-1.40/.ci/java-old.check 0000775 0000000 0000000 00000000047 15073132404 0017074 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
make -C Java check
QuantLib-SWIG-1.40/.ci/java-old.install 0000775 0000000 0000000 00000000023 15073132404 0017457 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
QuantLib-SWIG-1.40/.ci/python.build 0000775 0000000 0000000 00000000302 15073132404 0016734 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
python3 -m venv .venv
. .venv/bin/activate
pip install setuptools build tox
./autogen.sh
./configure CC=clang CXX=clang++ CXXFLAGS='-O1'
make -C Python SWIGFLAGS='-Werror'
QuantLib-SWIG-1.40/.ci/python.check 0000775 0000000 0000000 00000000220 15073132404 0016711 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
. .venv/bin/activate
make -C Python check
for i in Python/examples/*.py
do
echo "$i"
python "$i" || break -1
done
QuantLib-SWIG-1.40/.ci/python.install 0000775 0000000 0000000 00000000304 15073132404 0017305 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
. .venv/bin/activate
pip install Python/dist/*.whl
grep -v QuantLib binder/requirements.txt > Python/examples/requirements.txt
pip install -r Python/examples/requirements.txt
QuantLib-SWIG-1.40/.ci/r.build 0000775 0000000 0000000 00000000255 15073132404 0015663 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
mkdir -p ~/.R
echo 'CC=clang' > ~/.R/Makevars
echo 'CXX=clang++' >> ~/.R/Makevars
./autogen.sh
./configure CXXFLAGS='-O0'
make -C R SWIGFLAGS='-Werror'
QuantLib-SWIG-1.40/.ci/r.check 0000775 0000000 0000000 00000000203 15073132404 0015632 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
echo Execute Scripts in demo folder
for fn in ./R/demo/*.R
do
echo $fn
Rscript "$fn" || break -1
done
QuantLib-SWIG-1.40/.ci/r.install 0000775 0000000 0000000 00000000066 15073132404 0016232 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
R CMD INSTALL ./R.Rcheck/QuantLib
QuantLib-SWIG-1.40/.ci/scala.build 0000775 0000000 0000000 00000000342 15073132404 0016502 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
./autogen.sh
./configure --with-jdk-include=/usr/lib/jvm/default-java/include \
--with-jdk-system-include=/usr/lib/jvm/default-java/include/linux CXXFLAGS='-O2'
make -C Java SWIGFLAGS='-Werror'
QuantLib-SWIG-1.40/.ci/scala.check 0000775 0000000 0000000 00000000050 15073132404 0016454 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
make -C Scala check
QuantLib-SWIG-1.40/.ci/scala.install 0000775 0000000 0000000 00000000023 15073132404 0017045 0 ustar 00root root 0000000 0000000 #!/bin/bash
set -e
QuantLib-SWIG-1.40/.github/ 0000775 0000000 0000000 00000000000 15073132404 0015263 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.40/.github/boring-cyborg.yml 0000664 0000000 0000000 00000001145 15073132404 0020552 0 ustar 00root root 0000000 0000000
# Comment to be posted to welcome users when they open their first PR
firstPRWelcomeComment: >
Thanks for opening this pull request! It might take a while before we look at it, so don't worry if there seems to be no feedback. We'll get to it.
# Comment to be posted to congratulate user on their first merged PR
firstPRMergeComment: >
Congratulations on your first merged pull request!
# Comment to be posted to on first time issues
firstIssueWelcomeComment: >
Thanks for posting! It might take a while before we look at your issue, so don't worry if there seems to be no feedback. We'll get to it.
QuantLib-SWIG-1.40/.github/dependabot.yml 0000664 0000000 0000000 00000000261 15073132404 0020112 0 ustar 00root root 0000000 0000000 version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "weekly"
QuantLib-SWIG-1.40/.github/workflows/ 0000775 0000000 0000000 00000000000 15073132404 0017320 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.40/.github/workflows/copyrights.yml 0000664 0000000 0000000 00000001267 15073132404 0022244 0 ustar 00root root 0000000 0000000 name: Update copyright list
on:
push:
branches-ignore:
- 'dependabot/**'
jobs:
copyrights:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Check
run: |
./tools/check_copyrights.sh
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: update-copyright-list-${{ github.ref_name }}
delete-branch: true
commit-message: 'Update copyright list in license'
title: 'Update copyright list in license'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.40/.github/workflows/devenv-images.yml 0000664 0000000 0000000 00000006024 15073132404 0022577 0 ustar 00root root 0000000 0000000 name: Build quantlib-swig-devenv Docker images
on:
schedule:
- cron: '0 0 * * 6'
workflow_dispatch:
jobs:
docker-images-base:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Checkout latest QuantLib master
uses: actions/checkout@v5
with:
repository: lballabio/QuantLib
path: dockerfiles/QuantLib
- name: Build Docker images
working-directory: dockerfiles
run: |
rm -rf QuantLib/.git
docker build -f ci.base.Dockerfile --build-arg tag=noble -t ghcr.io/lballabio/quantlib-swig-devenv:base .
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Push Docker images
run: |
docker push ghcr.io/lballabio/quantlib-swig-devenv:base
docker-images-ql:
runs-on: ubuntu-latest
needs: docker-images-base
strategy:
matrix:
tag: [default, threadsafe]
steps:
- uses: actions/checkout@v5
- name: Build Docker images
working-directory: dockerfiles
run: |
docker build -f ci.${{ matrix.tag }}.Dockerfile -t ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.tag }} .
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Push Docker images
run: |
docker push ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.tag }}
docker-images-base-languages:
runs-on: ubuntu-latest
needs: docker-images-ql
strategy:
matrix:
lang: [python, csharp, java, r]
steps:
- uses: actions/checkout@v5
- name: Build Docker images
working-directory: dockerfiles
run: |
docker build -f ci.${{ matrix.lang }}.Dockerfile -t ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.lang }} .
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Push Docker images
run: |
docker push ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.lang }}
docker-images-dependent-languages:
runs-on: ubuntu-latest
needs: docker-images-base-languages
strategy:
matrix:
lang: [scala]
steps:
- uses: actions/checkout@v5
- name: Build Docker images
working-directory: dockerfiles
run: |
docker build -f ci.${{ matrix.lang }}.Dockerfile -t ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.lang }} .
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Push Docker images
run: |
docker push ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.lang }}
QuantLib-SWIG-1.40/.github/workflows/license-url.yml 0000664 0000000 0000000 00000001500 15073132404 0022261 0 ustar 00root root 0000000 0000000 name: Update old license links
on:
push:
branches-ignore:
- 'dependabot/**'
jobs:
license-urls:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Check
run: |
shopt -s globstar
sed -i -e 's|http://quantlib\.org/license\.shtml|https://www.quantlib.org/license.shtml|g' **/*.i **/*.ac **/*.cs **/*.java **/*.py **/*.scala **/*.in
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: update-license-links-${{ github.ref_name }}
delete-branch: true
commit-message: 'Update old license links'
title: 'Update old license links'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.40/.github/workflows/linux.yml 0000664 0000000 0000000 00000001501 15073132404 0021177 0 ustar 00root root 0000000 0000000 name: Linux build
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- language: python
- language: java
config: -old
- language: java
config: -new
- language: csharp
- language: r
- language: scala
container: ghcr.io/lballabio/quantlib-swig-devenv:${{ matrix.language }}
steps:
- uses: actions/checkout@v5
- name: Build
run: |
./.ci/${{ matrix.language }}${{ matrix.config }}.build
- name: Install
run: |
./.ci/${{ matrix.language }}${{ matrix.config }}.install
- name: Check
run: |
./.ci/${{ matrix.language }}${{ matrix.config }}.check
QuantLib-SWIG-1.40/.github/workflows/misspell.yml 0000664 0000000 0000000 00000001207 15073132404 0021673 0 ustar 00root root 0000000 0000000 name: Misspell fixer
on:
push:
branches-ignore:
- 'dependabot/**'
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: sobolevn/misspell-fixer-action@master
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: misspell-fixes-${{ github.ref_name }}
delete-branch: true
commit-message: 'Fixes by misspell-fixer'
title: 'Typos fixed by misspell-fixer'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.40/.github/workflows/namespaces.yml 0000664 0000000 0000000 00000003003 15073132404 0022156 0 ustar 00root root 0000000 0000000 name: Fix uses of boost and/or ext namespace
on:
push:
branches-ignore:
- 'dependabot/**'
jobs:
namespaces:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Check
run: |
sed -i -e 's/boost::shared_ptr\b/ext::shared_ptr/g' SWIG/*
sed -i -e 's/boost::make_shared\b/ext::make_shared/g' SWIG/*
sed -i -e 's/boost::dynamic_pointer_cast\b/ext::dynamic_pointer_cast/g' SWIG/*
sed -i -e 's/ext::tuple\b/std::tuple/g' SWIG/*
sed -i -e 's/ext::make_tuple\b/std::make_tuple/g' SWIG/*
sed -i -e 's/ext::get\b/std::get/g' SWIG/*
sed -i -e 's/ext::tie\b/std::tie/g' SWIG/*
sed -i -e 's/ext::function\b/std::function/g' SWIG/*
sed -i -e 's/ext::bind\b/std::bind/g' SWIG/*
sed -i -e 's/ext::ref\b/std::ref/g' SWIG/*
sed -i -e 's/ext::cref\b/std::cref/g' SWIG/*
sed -i -e 's/ext::placeholders\b/std::placeholders/g' SWIG/*
sed -i -e 's/boost::optional\b/ext::optional/g' SWIG/*
sed -i -e 's/boost::none\b/ext::nullopt/g' SWIG/*
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: fix-boost-namespace-${{ github.ref_name }}
delete-branch: true
commit-message: 'Fix uses of boost and/or ext namespace'
title: 'Fix uses of boost and/or ext namespace'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.40/.github/workflows/prepare-release-candidate.yml 0000664 0000000 0000000 00000003651 15073132404 0025036 0 ustar 00root root 0000000 0000000 name: Prepare release candidate
on:
workflow_dispatch:
jobs:
update-for-rc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
- name: Setup git
run: |
git config user.name 'lballabio[bot]'
git config user.email '224797326+lballabio-bot@users.noreply.github.com'
- name: Calculate versions
env:
GH_TOKEN: ${{ github.token }}
run: |
export LATEST_RELEASE=`gh release list --json name,isLatest --jq '.[] | select(.isLatest)|.name'`
echo ${LATEST_RELEASE} | awk -F '.' '{ print "LATEST_MINOR=" $2 }' | tee -a $GITHUB_ENV
echo ${LATEST_RELEASE} | awk -F '.' '{ print "NEXT_MINOR=" $2 + 1 }' | tee -a $GITHUB_ENV
- name: Update version numbers
run: |
sed -i -e "s/^AC_INIT(\[QuantLib-SWIG\].*$/AC_INIT([QuantLib-SWIG], [1.${NEXT_MINOR}-rc],/g" configure.ac
sed -i -e "s/^ version=.*$/ version=\"1.${NEXT_MINOR}-rc\",/g" Python/setup.py
sed -i -e "s/^#if QL_HEX_VERSION < .*$/#if QL_HEX_VERSION < 0x01${NEXT_MINOR}0000/g" SWIG/ql.i
sed -i -e "s/^ #error at least QuantLib.*$/ #error at least QuantLib 1.${NEXT_MINOR} required, please update/g" SWIG/ql.i
git commit -a -m "Set version to 1.${NEXT_MINOR}-rc"
- name: Update ChangeLog
run: |
git log --pretty=medium --date=rfc --stat --grep='Merge [^p]' --grep='[Mm]erged' --grep='[Pp]ull from' --invert-grep v1.${LATEST_MINOR}... > ChangeLog.txt
git commit -a -m "Update changelog"
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: set-to-rc-${{ github.ref_name }}
delete-branch: true
title: 'Set version to 1.${{ env.NEXT_MINOR }}-rc'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.40/.github/workflows/prepare-release.yml 0000664 0000000 0000000 00000003300 15073132404 0023113 0 ustar 00root root 0000000 0000000 name: Prepare release
on:
workflow_dispatch:
jobs:
update-for-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
- name: Setup git
run: |
git config user.name 'lballabio[bot]'
git config user.email '224797326+lballabio-bot@users.noreply.github.com'
- name: Calculate versions
env:
GH_TOKEN: ${{ github.token }}
run: |
export LATEST_RELEASE=`gh release list --json name,isLatest --jq '.[] | select(.isLatest)|.name'`
echo ${LATEST_RELEASE} | awk -F '.' '{ print "LATEST_MINOR=" $2 }' | tee -a $GITHUB_ENV
echo ${LATEST_RELEASE} | awk -F '.' '{ print "NEXT_MINOR=" $2 + 1 }' | tee -a $GITHUB_ENV
- name: Update version numbers
run: |
sed -i -e "s/^AC_INIT(\[QuantLib-SWIG\].*$/AC_INIT([QuantLib-SWIG], [1.${NEXT_MINOR}],/g" configure.ac
sed -i -e "s/^ version=.*$/ version=\"1.${NEXT_MINOR}\",/g" Python/setup.py
git commit -a -m "Set version to 1.${NEXT_MINOR}"
- name: Update ChangeLog
run: |
git log --pretty=medium --date=rfc --stat --grep='Merge [^p]' --grep='[Mm]erged' --grep='[Pp]ull from' --invert-grep v1.${LATEST_MINOR}... > ChangeLog.txt
git commit -a -m "Update changelog"
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
branch: update-version-for-release-${{ github.ref_name }}
delete-branch: true
title: 'Set version to 1.${{ env.NEXT_MINOR }} final'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
QuantLib-SWIG-1.40/.github/workflows/publish-release.yml 0000664 0000000 0000000 00000004345 15073132404 0023135 0 ustar 00root root 0000000 0000000 name: Draft new release
on:
push:
tags:
- 'v1.[0-9]+'
permissions:
contents: write
packages: write
jobs:
draft-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
- name: Setup
env:
SWIG_VERSION: 4.3.1
run: |
sudo apt update
sudo apt install -y libpcre2-dev libboost-dev tofrodos
wget http://downloads.sourceforge.net/project/swig/swig/swig-${SWIG_VERSION}/swig-${SWIG_VERSION}.tar.gz \
&& tar xfz swig-${SWIG_VERSION}.tar.gz \
&& rm swig-${SWIG_VERSION}.tar.gz \
&& cd swig-${SWIG_VERSION} \
&& ./configure --prefix=/usr CXXFLAGS=-O3 \
&& make -j 4 && sudo make install \
&& cd .. && rm -rf swig-${SWIG_VERSION}
- name: Configure
run: |
./autogen.sh
./configure
- name: Make tarballs
run: |
mkdir tarballs
make dist
mv QuantLib-*.tar.gz tarballs
cd tarballs && ../tools/tgz2zip *.tar.gz && ls -lh
- name: Extract version
run: |
echo ${{ github.ref_name }} | awk -F '[v-]' '{ print "VERSION_NUMBER=" $2 }' | tee -a $GITHUB_ENV
- name: Prepare release notes
run: |
echo "Downloads:" >> tarballs/notes.txt
echo "==========" >> tarballs/notes.txt
echo "" >> tarballs/notes.txt
echo "- [QuantLib-SWIG-1.${VERSION_NUMBER}.tar.gz](https://github.com/lballabio/QuantLib/releases/download/v1.${VERSION_NUMBER}/QuantLib-SWIG-1.${VERSION_NUMBER}.tar.gz)" >> tarballs/notes.txt
echo "- [QuantLib-SWIG-1.${VERSION_NUMBER}.zip](https://github.com/lballabio/QuantLib/releases/download/v1.${VERSION_NUMBER}/QuantLib-SWIG-1.${VERSION_NUMBER}.zip)" >> tarballs/notes.txt
echo "" >> tarballs/notes.txt
awk '/Full list of pull requests/{ exit } { print }' News.md >> tarballs/notes.txt
- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create ${{ github.ref_name }} \
--title "${VERSION_NUMBER}" \
--draft \
--notes-file tarballs/notes.txt \
--generate-notes \
tarballs/*.tar.gz tarballs/*.zip
QuantLib-SWIG-1.40/.github/workflows/stale.yml 0000664 0000000 0000000 00000002224 15073132404 0021153 0 ustar 00root root 0000000 0000000 name: Close stale issues and PR
on:
schedule:
- cron: '30 1 * * *'
jobs:
staleness-check:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v10
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue was automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment, or this will be closed in two weeks.'
close-issue-message: 'This issue was automatically closed because it has been stalled for two weeks with no further activity.'
stale-pr-message: 'This PR was automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment, or this will be closed in two weeks.'
close-pr-message: 'This PR was automatically closed because it has been stalled for two weeks with no further activity.'
days-before-stale: 60
days-before-close: 14
stale-issue-label: 'stale'
stale-pr-label: 'stale'
exempt-issue-labels: 'help wanted,in progress'
exempt-pr-labels: 'help wanted,in progress'
exempt-all-milestones: true
QuantLib-SWIG-1.40/.gitignore 0000664 0000000 0000000 00000001011 15073132404 0015704 0 ustar 00root root 0000000 0000000 # Compilation artifacts
configure
aclocal.m4
autom4te.cache
config.log
config.status
config/
# Build outputs
**/x64/Debug
**/x64/Release
**/Debug
**/Release
**/bin/*.xml
**/bin/*.manifest
# IDEs
.idea
.vscode
cmake-build-debug
# Artifacts created in multiple directories
Makefile
Makefile.in
.build-stamp
testCaseCollection.xml
.deps
.libs
*.la
*.lo
*.o
*.so
*.dylib
*.exe
*.dll
*.exp
*.lib
*.pdb
*.ilk
*.class
*~
*.ncb
*.suo
*.vcproj.*.user
*.vcxproj.user
*.VC.db
*.VC.opendb
*.log
*.sdf
*.opensdf
*.pch
*.idb
*.ipch
QuantLib-SWIG-1.40/.misspell-fixer.ignore 0000664 0000000 0000000 00000000022 15073132404 0020143 0 ustar 00root root 0000000 0000000 ^./ChangeLog.txt
QuantLib-SWIG-1.40/CSharp/ 0000775 0000000 0000000 00000000000 15073132404 0015103 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.40/CSharp/.gitignore 0000664 0000000 0000000 00000000174 15073132404 0017075 0 ustar 00root root 0000000 0000000 cpp/quantlib_wrap.cpp
cpp/quantlib_wrap.h
csharp/*.cs
NQuantLib.dll
cpp/build
csharp/obj
examples/*/bin
examples/*/obj
.vs/
QuantLib-SWIG-1.40/CSharp/Makefile.am 0000664 0000000 0000000 00000006017 15073132404 0017143 0 ustar 00root root 0000000 0000000
CLEANFILES = cpp/quantlib_wrap.* cpp/*.so cpp/*.dylib csharp/*.cs *.dll
BUILT_SOURCES = cpp/quantlib_wrap.cpp cpp/quantlib_wrap.h
if HAVE_DOTNET
if BUILD_DOTNET
all-local: cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@ csharp/bin/Release/net6.0/NQuantLib.dll
cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@: cpp/quantlib_wrap.o
$(CXX) -shared cpp/quantlib_wrap.o -o cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@ `quantlib-config --libs`
cpp/quantlib_wrap.o: $(BUILT_SOURCES)
$(CXX) -c -fpic $(CXXFLAGS) cpp/quantlib_wrap.cpp -o cpp/quantlib_wrap.o `quantlib-config --cflags`
csharp/bin/Release/net6.0/NQuantLib.dll: $(BUILT_SOURCES)
$(DOTNET) build --nologo -c Release -p:Version=$(PACKAGE_VERSION) csharp/NQuantLib.csproj
nupkg: cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@ csharp/bin/Release/net6.0/NQuantLib.dll
$(DOTNET) pack --no-build -c Release -p:PackageVersion=$(PACKAGE_VERSION) --include-symbols --include-source csharp/NQuantLib.csproj
check-local: cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@ csharp/bin/Release/net6.0/NQuantLib.dll
ln -f cpp/libNQuantLibc.@SHARED_LIB_EXTENSION@ examples/
cd examples && LD_LIBRARY_PATH=. $(DOTNET) run -c Release --project BermudanSwaption/BermudanSwaption.csproj
cd examples && LD_LIBRARY_PATH=. $(DOTNET) run -c Release --project EquityOption/EquityOption.csproj
cd examples && LD_LIBRARY_PATH=. $(DOTNET) run -c Release --project FiniteDifferenceMethods/FiniteDifferenceMethods.csproj
cd examples && LD_LIBRARY_PATH=. $(DOTNET) run -c Release --project Times/Times.csproj
rm -f examples/libNQuantLibc.@SHARED_LIB_EXTENSION@
clean-local:
rm -rf csharp/bin csharp/obj examples/*/bin examples/*/obj
endif
endif
$(BUILT_SOURCES): ../SWIG/*.i
rm -f csharp/*.cs
$(SWIG) $(SWIGFLAGS) -csharp -c++ -outdir csharp \
-namespace QuantLib -o cpp/quantlib_wrap.cpp ../SWIG/quantlib.i
dist-hook: $(BUILT_SOURCES)
mkdir -p $(distdir)/cpp
cp ./cpp/*.vcxproj $(distdir)/cpp
cp ./cpp/quantlib_wrap.cpp $(distdir)/cpp
cp ./cpp/quantlib_wrap.h $(distdir)/cpp
mkdir -p $(distdir)/csharp
cp ./csharp/*.csproj $(distdir)/csharp
cp ./csharp/*.cs $(distdir)/csharp
mkdir -p $(distdir)/examples
mkdir -p $(distdir)/examples/BermudanSwaption
cp ./examples/BermudanSwaption/BermudanSwaption.csproj $(distdir)/examples/BermudanSwaption
cp ./examples/BermudanSwaption/BermudanSwaption.cs $(distdir)/examples/BermudanSwaption
mkdir -p $(distdir)/examples/EquityOption
cp ./examples/EquityOption/EquityOption.csproj $(distdir)/examples/EquityOption
cp ./examples/EquityOption/EquityOption.cs $(distdir)/examples/EquityOption
mkdir -p $(distdir)/examples/FiniteDifferenceMethods
cp ./examples/FiniteDifferenceMethods/FiniteDifferenceMethods.csproj $(distdir)/examples/FiniteDifferenceMethods
cp ./examples/FiniteDifferenceMethods/FiniteDifferenceMethods.cs $(distdir)/examples/FiniteDifferenceMethods
mkdir -p $(distdir)/examples/Times
cp ./examples/Times/Times.csproj $(distdir)/examples/Times
cp ./examples/Times/Times.cs $(distdir)/examples/Times
EXTRA_DIST = \
QuantLib.sln \
QuantLib.props \
swig.cmd \
README.txt
QuantLib-SWIG-1.40/CSharp/QuantLib.props 0000664 0000000 0000000 00000001653 15073132404 0017714 0 ustar 00root root 0000000 0000000
v100
v110
v120
v130
v140
v141
v142
v143
QuantLib-SWIG-1.40/CSharp/QuantLib.sln 0000664 0000000 0000000 00000013746 15073132404 0017353 0 ustar 00root root 0000000 0000000 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31515.178
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BermudanSwaption", "examples\BermudanSwaption\BermudanSwaption.csproj", "{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}"
ProjectSection(ProjectDependencies) = postProject
{21183104-9963-4D4F-B7E8-C8A6169FD053} = {21183104-9963-4D4F-B7E8-C8A6169FD053}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EquityOption", "examples\EquityOption\EquityOption.csproj", "{1FD947F1-D99E-46FB-8890-04E11E8340C2}"
ProjectSection(ProjectDependencies) = postProject
{21183104-9963-4D4F-B7E8-C8A6169FD053} = {21183104-9963-4D4F-B7E8-C8A6169FD053}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FiniteDifferenceMethods", "examples\FiniteDifferenceMethods\FiniteDifferenceMethods.csproj", "{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}"
ProjectSection(ProjectDependencies) = postProject
{21183104-9963-4D4F-B7E8-C8A6169FD053} = {21183104-9963-4D4F-B7E8-C8A6169FD053}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NQuantLib", "csharp\NQuantLib.csproj", "{928F98EE-7D50-457F-9304-A6818DCF1079}"
ProjectSection(ProjectDependencies) = postProject
{21183104-9963-4D4F-B7E8-C8A6169FD053} = {21183104-9963-4D4F-B7E8-C8A6169FD053}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NQuantLibc", "cpp\QuantLibWrapper.vcxproj", "{21183104-9963-4D4F-B7E8-C8A6169FD053}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Times", "examples\Times\Times.csproj", "{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Debug|Win32.ActiveCfg = Debug|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Debug|Win32.Build.0 = Debug|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Debug|x64.ActiveCfg = Debug|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Debug|x64.Build.0 = Debug|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Release|Win32.ActiveCfg = Release|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Release|Win32.Build.0 = Release|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Release|x64.ActiveCfg = Release|Any CPU
{1BEC49E8-122D-4CC9-9DAC-DD59F551E5E9}.Release|x64.Build.0 = Release|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Debug|Win32.ActiveCfg = Debug|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Debug|Win32.Build.0 = Debug|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Debug|x64.ActiveCfg = Debug|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Debug|x64.Build.0 = Debug|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Release|Win32.ActiveCfg = Release|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Release|Win32.Build.0 = Release|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Release|x64.ActiveCfg = Release|Any CPU
{1FD947F1-D99E-46FB-8890-04E11E8340C2}.Release|x64.Build.0 = Release|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Debug|Win32.ActiveCfg = Debug|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Debug|Win32.Build.0 = Debug|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Debug|x64.ActiveCfg = Debug|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Debug|x64.Build.0 = Debug|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Release|Win32.ActiveCfg = Release|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Release|Win32.Build.0 = Release|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Release|x64.ActiveCfg = Release|Any CPU
{EF2AFADF-B632-4E95-BEB5-7B7109A9E4FD}.Release|x64.Build.0 = Release|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Debug|Win32.ActiveCfg = Debug|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Debug|Win32.Build.0 = Debug|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Debug|x64.ActiveCfg = Debug|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Debug|x64.Build.0 = Debug|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Release|Win32.ActiveCfg = Release|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Release|Win32.Build.0 = Release|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Release|x64.ActiveCfg = Release|Any CPU
{928F98EE-7D50-457F-9304-A6818DCF1079}.Release|x64.Build.0 = Release|Any CPU
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Debug|Win32.ActiveCfg = Debug|Win32
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Debug|Win32.Build.0 = Debug|Win32
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Debug|x64.ActiveCfg = Debug|x64
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Debug|x64.Build.0 = Debug|x64
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Release|Win32.ActiveCfg = Release|Win32
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Release|Win32.Build.0 = Release|Win32
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Release|x64.ActiveCfg = Release|x64
{21183104-9963-4D4F-B7E8-C8A6169FD053}.Release|x64.Build.0 = Release|x64
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Debug|Win32.ActiveCfg = Debug|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Debug|Win32.Build.0 = Debug|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Debug|x64.ActiveCfg = Debug|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Debug|x64.Build.0 = Debug|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Release|Win32.ActiveCfg = Release|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Release|Win32.Build.0 = Release|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Release|x64.ActiveCfg = Release|Any CPU
{C93F5204-5BC9-4AB3-AC06-C2CCE166CEBD}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D5A8DD18-AC31-4E40-A70A-11339ED8FAE8}
EndGlobalSection
EndGlobal
QuantLib-SWIG-1.40/CSharp/README.txt 0000664 0000000 0000000 00000000606 15073132404 0016603 0 ustar 00root root 0000000 0000000
Visual Studio .NET projects are provided; note that before launching
the IDE, you'll have to define an environment variable QL_DIR whose
value must equal the path to your QuantLib installation, e.g.,
"C:\Lib\QuantLib".
The interfaces also work with .Net on Linux and macOS; run 'make' in
this directory after running './autogen.sh' and './configure' in the
main QuantLib-SWIG directory.
QuantLib-SWIG-1.40/CSharp/cpp/ 0000775 0000000 0000000 00000000000 15073132404 0015665 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.40/CSharp/cpp/QuantLibWrapper.vcxproj 0000664 0000000 0000000 00000026604 15073132404 0022372 0 ustar 00root root 0000000 0000000
Debug
Win32
Debug
x64
Release
Win32
Release
x64
NQuantLibc
{21183104-9963-4D4F-B7E8-C8A6169FD053}
NQuantLibc
Win32Proj
DynamicLibrary
MultiByte
DynamicLibrary
MultiByte
DynamicLibrary
MultiByte
DynamicLibrary
MultiByte
<_ProjectFileVersion>10.0.30319.1
bin\$(Platform)\Debug\
build\$(Platform)\Debug\
true
bin\$(Platform)\Release\
build\$(Platform)\Release\
false
AllRules.ruleset
AllRules.ruleset
Disabled
stdcpp17
$(QL_DIR);%(AdditionalIncludeDirectories)
WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTLIBWRAPPER_EXPORTS;_cplusplus;NOMINMAX;%(PreprocessorDefinitions)
true
EnableFastChecks
MultiThreadedDebugDLL
true
Level3
EditAndContinue
/bigobj %(AdditionalOptions)
$(OutDir)NQuantLibc.dll
$(QL_DIR)\lib;%(AdditionalLibraryDirectories)
true
$(OutDir)QuantlibWrapper.pdb
Windows
false
$(OutDir)NQuantLibc.lib
MachineX86
copy "$(OutDir)NQuantLibc.dll" "$(ProjectDir)"
Disabled
stdcpp17
$(QL_DIR);%(AdditionalIncludeDirectories)
WIN32;_DEBUG;_WINDOWS;_USRDLL;QUANTLIBWRAPPER_EXPORTS;_cplusplus;NOMINMAX;%(PreprocessorDefinitions)
EnableFastChecks
MultiThreadedDebugDLL
true
Level3
ProgramDatabase
/bigobj %(AdditionalOptions)
$(OutDir)NQuantLibc.dll
$(QL_DIR)\lib;%(AdditionalLibraryDirectories)
true
$(OutDir)QuantlibWrapper.pdb
Windows
false
$(OutDir)NQuantLibc.lib
copy "$(OutDir)NQuantLibc.dll" "$(ProjectDir)"
stdcpp17
$(QL_DIR);%(AdditionalIncludeDirectories)
WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTLIBWRAPPER_EXPORTS;%(PreprocessorDefinitions)
MultiThreadedDLL
true
true
Level3
ProgramDatabase
4244;%(DisableSpecificWarnings)
/bigobj %(AdditionalOptions)
$(OutDir)NQuantLibc.dll
$(QL_DIR)\lib;%(AdditionalLibraryDirectories)
true
Windows
true
true
false
$(OutDir)NQuantLibc.lib
MachineX86
copy "$(OutDir)NQuantLibc.dll" "$(ProjectDir)"
stdcpp17
$(QL_DIR);%(AdditionalIncludeDirectories)
WIN32;NDEBUG;_WINDOWS;_USRDLL;QUANTLIBWRAPPER_EXPORTS;%(PreprocessorDefinitions)
MultiThreadedDLL
true
true
Level3
ProgramDatabase
4244;%(DisableSpecificWarnings)
/bigobj %(AdditionalOptions)
$(OutDir)NQuantLibc.dll
$(QL_DIR)\lib;%(AdditionalLibraryDirectories)
true
Windows
true
true
false
$(OutDir)NQuantLibc.lib
copy "$(OutDir)NQuantLibc.dll" "$(ProjectDir)"
QuantLib-SWIG-1.40/CSharp/cpp/QuantLibWrapper.vcxproj.filters 0000664 0000000 0000000 00000002041 15073132404 0024026 0 ustar 00root root 0000000 0000000
{4FC737F1-C7A5-4376-A066-2A32D752A2FF}
cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx
{93995380-89BD-4b04-88EB-625FBE52EBFB}
h;hpp;hxx;hm;inl;inc;xsd
{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx
Source Files
Header Files
QuantLib-SWIG-1.40/CSharp/csharp/ 0000775 0000000 0000000 00000000000 15073132404 0016363 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.40/CSharp/csharp/NQuantLib.csproj 0000664 0000000 0000000 00000002110 15073132404 0021434 0 ustar 00root root 0000000 0000000
net6.0
QuantLib
runtimes/win-x64/native
runtimes/linux-x64/native
runtimes/osx-x64/native
QuantLib-SWIG-1.40/CSharp/examples/ 0000775 0000000 0000000 00000000000 15073132404 0016721 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.40/CSharp/examples/BermudanSwaption/ 0000775 0000000 0000000 00000000000 15073132404 0022203 5 ustar 00root root 0000000 0000000 QuantLib-SWIG-1.40/CSharp/examples/BermudanSwaption/BermudanSwaption.cs 0000664 0000000 0000000 00000027525 15073132404 0026027 0 ustar 00root root 0000000 0000000 /*
Copyright (C) 2005 Dominic Thuillier
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it
under the terms of the QuantLib license. You should have received a
copy of the license along with this program; if not, please email
. The license is also available online at
.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
using System;
using QuantLib;
namespace BermudanSwaption
{
class Run
{
private const int numRows = 5;
private const int numCols = 5;
private static int[] swapLengths = { 1, 2, 3, 4, 5 };
private static double[] swaptionVols = {
0.1490, 0.1340, 0.1228, 0.1189, 0.1148,
0.1290, 0.1201, 0.1146, 0.1108, 0.1040,
0.1149, 0.1112, 0.1070, 0.1010, 0.0957,
0.1047, 0.1021, 0.0980, 0.0951, 0.1270,
0.1000, 0.0950, 0.0900, 0.1230, 0.1160 };
private static void calibrateModel(
ShortRateModel model,
CalibrationHelperVector helpers,
double lambda )
{
Simplex om = new Simplex( lambda );
model.calibrate(helpers, om,
new EndCriteria(1000, 250, 1e-7, 1e-7, 1e-7));
// Output the implied Black volatilities
for (int i=0; i
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
DateTime startTime = DateTime.Now;
Date todaysDate = new Date(15, Month.February, 2002);
Calendar calendar = new TARGET();
Date settlementDate = new Date(19, Month.February, 2002);
Settings.instance().setEvaluationDate( todaysDate );
// flat yield term structure impling 1x5 swap at 5%
Quote flatRate = new SimpleQuote(0.04875825);
FlatForward myTermStructure = new FlatForward(
settlementDate,
new QuoteHandle( flatRate ),
new Actual365Fixed() );
RelinkableYieldTermStructureHandle rhTermStructure =
new RelinkableYieldTermStructureHandle();
rhTermStructure.linkTo( myTermStructure );
// Define the ATM/OTM/ITM swaps
Period fixedLegTenor = new Period(1,TimeUnit.Years);
BusinessDayConvention fixedLegConvention =
BusinessDayConvention.Unadjusted;
BusinessDayConvention floatingLegConvention =
BusinessDayConvention.ModifiedFollowing;
DayCounter fixedLegDayCounter =
new Thirty360( Thirty360.Convention.European );
Period floatingLegTenor = new Period(6,TimeUnit.Months);
double dummyFixedRate = 0.03;
IborIndex indexSixMonths = new Euribor6M( rhTermStructure );
Date startDate = calendar.advance(settlementDate,1,TimeUnit.Years,
floatingLegConvention);
Date maturity = calendar.advance(startDate,5,TimeUnit.Years,
floatingLegConvention);
Schedule fixedSchedule = new Schedule(startDate,maturity,
fixedLegTenor,calendar,fixedLegConvention,fixedLegConvention,
DateGeneration.Rule.Forward,false);
Schedule floatSchedule = new Schedule(startDate,maturity,
floatingLegTenor,calendar,floatingLegConvention,
floatingLegConvention,DateGeneration.Rule.Forward,false);
VanillaSwap swap = new VanillaSwap(
Swap.Type.Payer, 1000.0,
fixedSchedule, dummyFixedRate, fixedLegDayCounter,
floatSchedule, indexSixMonths, 0.0,
indexSixMonths.dayCounter());
DiscountingSwapEngine swapEngine =
new DiscountingSwapEngine(rhTermStructure);
swap.setPricingEngine(swapEngine);
double fixedATMRate = swap.fairRate();
double fixedOTMRate = fixedATMRate * 1.2;
double fixedITMRate = fixedATMRate * 0.8;
VanillaSwap atmSwap = new VanillaSwap(
Swap.Type.Payer, 1000.0,
fixedSchedule, fixedATMRate, fixedLegDayCounter,
floatSchedule, indexSixMonths, 0.0,
indexSixMonths.dayCounter() );
VanillaSwap otmSwap = new VanillaSwap(
Swap.Type.Payer, 1000.0,
fixedSchedule, fixedOTMRate, fixedLegDayCounter,
floatSchedule, indexSixMonths, 0.0,
indexSixMonths.dayCounter());
VanillaSwap itmSwap = new VanillaSwap(
Swap.Type.Payer, 1000.0,
fixedSchedule, fixedITMRate, fixedLegDayCounter,
floatSchedule, indexSixMonths, 0.0,
indexSixMonths.dayCounter());
atmSwap.setPricingEngine(swapEngine);
otmSwap.setPricingEngine(swapEngine);
itmSwap.setPricingEngine(swapEngine);
// defining the swaptions to be used in model calibration
PeriodVector swaptionMaturities = new PeriodVector();
swaptionMaturities.Add( new Period(1, TimeUnit.Years) );
swaptionMaturities.Add( new Period(2, TimeUnit.Years) );
swaptionMaturities.Add( new Period(3, TimeUnit.Years) );
swaptionMaturities.Add( new Period(4, TimeUnit.Years) );
swaptionMaturities.Add( new Period(5, TimeUnit.Years) );
CalibrationHelperVector swaptions = new CalibrationHelperVector();
// List of times that have to be included in the timegrid
DoubleVector times = new DoubleVector();
for ( int i=0; iparams()[0] << ", "
// << "sigma = " << modelHW2->params()[1]
// << std::endl << std::endl;
Console.WriteLine( "Black-Karasinski (numerical) calibration" );
for (int i=0; iparams()[0] << ", "
// << "sigma = " << modelBK->params()[1]
// << std::endl << std::endl;
// ATM Bermudan swaption pricing
Console.WriteLine( "Payer bermudan swaption struck at {0} (ATM)",
fixedATMRate );
DateVector bermudanDates = new DateVector();
Schedule schedule = new Schedule(startDate,maturity,
new Period(3,TimeUnit.Months),calendar,
BusinessDayConvention.Following,
BusinessDayConvention.Following,
DateGeneration.Rule.Forward,false);
for (uint i=0; i