Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
method_mt.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006, 2007 Ferdinando Ametrano
5 Copyright (C) 2001, 2002, 2003 Nicolas Di C�sar�
6 Copyright (C) 2007 Fran�ois du Vignaud
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
22/*
23 Copyright (C) 2016 Quaternion Risk Management Ltd.
24 All rights reserved.
25
26 This file is part of ORE, a free-software/open-source library
27 for transparent pricing and risk analysis - http://opensourcerisk.org
28
29 ORE is free software: you can redistribute it and/or modify it
30 under the terms of the Modified BSD License. You should have received a
31 copy of the license along with this program.
32 The license is also available online at <http://opensourcerisk.org>
33
34 This program is distributed on the basis that it will form a useful
35 contribution to risk analytics and model standardisation, but WITHOUT
36 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
37 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
38*/
39
40/*! \file method_mt.hpp
41 \brief Abstract multithreaded optimization method class
42*/
43
44#ifndef quantext_optimization_method_mt_h
45#define quantext_optimization_method_mt_h
46
47#include <ql/math/optimization/endcriteria.hpp>
48
50
51namespace QuantExt {
52using namespace QuantLib;
53
54 class Problem_MT;
55
56 //! Abstract class for constrained optimization method
57
58 // the mt variants of method and problem are separated from
59 // the standard variants currently, the inheritance here at
60 // least allows to have a common base class for both variants
61 // of methods, but the minimize call is still not compatible
62 // between mt and standard variants.
63
65 public:
67
68 //! minimize the optimization problem P
69 virtual EndCriteria::Type minimize(Problem_MT& P,
70 const EndCriteria& endCriteria) = 0;
71
72 EndCriteria::Type minimize(Problem&, const EndCriteria&) override {
73 QL_FAIL("OptimizationMethod_MT requires Problem_MT, got Problem");
74 }
75
76 };
77
78}
79
80#endif
Abstract class for constrained optimization method.
Definition: method_mt.hpp:64
virtual EndCriteria::Type minimize(Problem_MT &P, const EndCriteria &endCriteria)=0
minimize the optimization problem P
EndCriteria::Type minimize(Problem &, const EndCriteria &) override
Definition: method_mt.hpp:72
Constrained optimization problem.
Definition: problem_mt.hpp:64
const P2_< E1, E2 > P(const E1 &e1, const E2 &e2)
Abstract optimization problem class (for multithreaded optimization methods)