QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
defaultprobabilitykey.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2009 StatPro Italia srl
5 Copyright (C) 2009 Jose Aparicio
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
25#ifndef quantlib_default_probability_key_hpp
26#define quantlib_default_probability_key_hpp
27
28#include <ql/experimental/credit/defaulttype.hpp>
29#include <ql/currency.hpp>
30#include <vector>
31
32namespace QuantLib {
33
42 protected:
44 std::vector<ext::shared_ptr<DefaultType> > eventTypes_;
49
50 public:
52
53 DefaultProbKey(std::vector<ext::shared_ptr<DefaultType> > eventTypes,
54 Currency cur,
55 Seniority sen);
56
57 const Currency& currency() const {return obligationCurrency_;}
58 Seniority seniority() const {return seniority_;}
59 const std::vector<ext::shared_ptr<DefaultType> >&
60 eventTypes() const {
61 return eventTypes_;
62 }
63 Size size() const {return eventTypes_.size();}
64 };
65
66 bool operator==(const DefaultProbKey& lhs, const DefaultProbKey& rhs);
67
68
70 // Restructuring here can be set to NoRestructuring.
72 public:
73 // with only one restructuring type
75 Seniority sen,
76 Period graceFailureToPay =
77 Period(30, Days),
78 Real amountFailure = 1.e6,
79 Restructuring::Type resType =
81 };
82
83}
84
85#endif
Currency specification
Definition: currency.hpp:36
Currency obligationCurrency_
Currency of the bond and protection leg payment.
const Currency & currency() const
const std::vector< ext::shared_ptr< DefaultType > > & eventTypes() const
std::vector< ext::shared_ptr< DefaultType > > eventTypes_
aggregation of event types for which the contract is sensitive.
Seniority seniority_
Reference bonds seniority.
ISDA standard default contractual key for corporate US debt.
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
bool operator==(const Currency &c1, const Currency &c2)
Definition: currency.hpp:191
Seniority
Seniority of a bond.
Definition: defaulttype.hpp:37