QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
basisincompleteordered.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2007, 2008 Mark Joshi
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20
21#ifndef quantlib_basis_incomplete_ordered_hpp
22#define quantlib_basis_incomplete_ordered_hpp
23
24#include <ql/math/matrix.hpp>
25#include <valarray>
26
27namespace QuantLib {
28
30 public:
33 bool addVector(const Array& newVector);
34 Size basisSize() const;
37 private:
38 std::vector<Array> currentBasis_;
41 };
42
55 {
56 public:
57 OrthogonalProjections(const Matrix& originalVectors,
58 Real multiplierCutOff,
59 Real tolerance );
60
61 const std::valarray<bool>& validVectors() const;
62 const std::vector<Real>& GetVector(Size index) const;
63
65
66
67 private:
68
75
77 std::valarray<bool> validVectors_;
78 std::vector<std::vector<Real> > projectedVectors_;
79
82
83
84 };
85
86}
87
88#endif
1-D array used in linear algebra.
Definition: array.hpp:52
bool addVector(const Array &newVector)
return value indicates if the vector was linearly independent
Matrix used in linear algebra.
Definition: matrix.hpp:41
const std::valarray< bool > & validVectors() const
const std::vector< Real > & GetVector(Size index) const
std::valarray< bool > validVectors_
outputs
std::vector< std::vector< Real > > projectedVectors_
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