Coverage Report

Created: 2025-10-14 06:32

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/experimental/credit/midpointcdoengine.hpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
 Copyright (C) 2008 Roland Lichters
5
 Copyright (C) 2009, 2014 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
 <https://www.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
21
#ifndef quantlib_midpoint_cdo_engine_hpp
22
#define quantlib_midpoint_cdo_engine_hpp
23
24
#include <ql/qldefines.hpp>
25
26
#ifndef QL_PATCH_SOLARIS
27
28
#include <ql/experimental/credit/syntheticcdo.hpp>
29
#    include <utility>
30
31
namespace QuantLib {
32
33
    class YieldTermStructure;
34
35
    //! CDO base engine taking schedule steps
36
37
    /* The engine obtains the cdo reference basket from its arguments and it 
38
    is expecting it to have a default model assigned. 
39
    */
40
    /* FIX ME: ASSUMES basket->expectedTrancheLoss(endDate) includes past 
41
    realized losses (between cdo inception and calculation time) .... what if 
42
    basket inception is not the same as CDO's ?????
43
44
    \todo non tested under realized defaults. JTD metrics might be invalid
45
    */
46
    class MidPointCDOEngine : public SyntheticCDO::engine {
47
    public:
48
      explicit MidPointCDOEngine(Handle<YieldTermStructure> discountCurve)
49
0
      : discountCurve_(std::move(discountCurve)) {}
50
      void calculate() const override;
51
52
    protected:
53
      Handle<YieldTermStructure> discountCurve_;
54
    };
55
56
}
57
58
#endif
59
60
#endif