QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
projection.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) 2007 François du Vignaud
5 Copyright (C) 2007 Giorgio Facchinetti
6 Copyright (C) 2013 Peter Caspers
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/*! \file projection.hpp
23 \brief Parameter projection
24*/
25
26#ifndef quantlib_math_projection_h
27#define quantlib_math_projection_h
28
29#include <ql/math/array.hpp>
30
31namespace QuantLib {
32
33 class Projection {
34 public:
35 Projection(const Array& parameterValues,
36 std::vector<bool> fixParameters = std::vector<bool>());
37
38 //! returns the subset of free parameters corresponding
39 // to set of parameters
40 virtual Array project(const Array &parameters) const;
41
42 //! returns whole set of parameters corresponding to the set
43 // of projected parameters
44 virtual Array include(const Array &projectedParameters) const;
45 virtual ~Projection() = default;
46
47 protected:
48 void mapFreeParameters(const Array &parameterValues) const;
52 std::vector<bool> fixParameters_;
53 };
54
55}
56
57#endif
1-D array used in linear algebra.
1-D array used in linear algebra.
Definition: array.hpp:52
const Array fixedParameters_
Definition: projection.hpp:50
virtual Array include(const Array &projectedParameters) const
returns whole set of parameters corresponding to the set
Definition: projection.cpp:67
virtual ~Projection()=default
std::vector< bool > fixParameters_
Definition: projection.hpp:52
virtual Array project(const Array &parameters) const
returns the subset of free parameters corresponding
Definition: projection.cpp:54
void mapFreeParameters(const Array &parameterValues) const
Definition: projection.cpp:43
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35