QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
issuer.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008, 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_issuer_hpp
26#define quantlib_issuer_hpp
27
28#include <ql/experimental/credit/defaultevent.hpp>
29#include <ql/experimental/credit/defaultprobabilitykey.hpp>
30#include <ql/termstructures/defaulttermstructure.hpp>
31#include <set>
32#include <vector>
33
34namespace QuantLib {
35
36 typedef std::set<ext::shared_ptr<DefaultEvent>,
37 earlier_than<ext::shared_ptr<DefaultEvent> > >
39
40 class Issuer {
41 public:
42 typedef std::pair<DefaultProbKey,
55 Issuer(std::vector<key_curve_pair> probabilities = std::vector<key_curve_pair>(),
57
58 Issuer(const std::vector<std::vector<ext::shared_ptr<DefaultType> > >& eventTypes,
59 const std::vector<Currency>& currencies,
60 const std::vector<Seniority>& seniorities,
61 const std::vector<Handle<DefaultProbabilityTermStructure> >& curves,
63
65
67 defaultProbability(const DefaultProbKey& key) const;
68
70
72
73
74 // restructuring type is found, it is returned for
75 // inspection; otherwise, the method returns an empty pointer.
76 ext::shared_ptr<DefaultEvent>
77 defaultedBetween(const Date& start,
78 const Date& end,
79 const DefaultProbKey& key,
80 bool includeRefDate = false
81 ) const;
82
84 std::vector<ext::shared_ptr<DefaultEvent> >
85 defaultsBetween(const Date& start,
86 const Date& end,
87 const DefaultProbKey& contractKey,
88 bool includeRefDate
89 ) const ;
90 private:
92 // vector of pairs preferred over maps for performance
93 std::vector<std::pair<DefaultProbKey,
96 // for the same event to occur on the same bond several times along
97 // time.
99 };
100
101}
102
103#endif
Concrete date class.
Definition: date.hpp:125
Shared handle to an observable.
Definition: handle.hpp:41
ext::shared_ptr< DefaultEvent > defaultedBetween(const Date &start, const Date &end, const DefaultProbKey &key, bool includeRefDate=false) const
If a default event with the required seniority and.
Definition: issuer.cpp:68
std::pair< DefaultProbKey, Handle< DefaultProbabilityTermStructure > > key_curve_pair
Definition: issuer.hpp:44
DefaultEventSet events_
History of past events affecting this issuer. Notice it is possible.
Definition: issuer.hpp:98
const Handle< DefaultProbabilityTermStructure > & defaultProbability(const DefaultProbKey &key) const
Definition: issuer.cpp:60
std::vector< std::pair< DefaultProbKey, Handle< DefaultProbabilityTermStructure > > > probabilities_
probabilities of events for each bond collection
Definition: issuer.hpp:94
std::vector< ext::shared_ptr< DefaultEvent > > defaultsBetween(const Date &start, const Date &end, const DefaultProbKey &contractKey, bool includeRefDate) const
Definition: issuer.cpp:84
Issuer(std::vector< key_curve_pair > probabilities=std::vector< key_curve_pair >(), DefaultEventSet events=DefaultEventSet())
Definition: any.hpp:35
std::set< ext::shared_ptr< DefaultEvent >, earlier_than< ext::shared_ptr< DefaultEvent > > > DefaultEventSet
Definition: issuer.hpp:38