xerus
a general purpose tensor library
uqAdf.h
Go to the documentation of this file.
1 // Xerus - A General Purpose Tensor Library
2 // Copyright (C) 2014-2017 Benjamin Huber and Sebastian Wolf.
3 //
4 // Xerus is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as published
6 // by the Free Software Foundation, either version 3 of the License,
7 // or (at your option) any later version.
8 //
9 // Xerus is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
13 //
14 // You should have received a copy of the GNU Affero General Public License
15 // along with Xerus. If not, see <http://www.gnu.org/licenses/>.
16 //
17 // For further information on Xerus visit https://libXerus.org
18 // or contact us at contact@libXerus.org.
19 
25 #pragma once
26 
27 #include "../index.h"
28 #include "../ttNetwork.h"
29 #include "../performanceData.h"
30 #include "../measurments.h"
31 
32 namespace xerus {
33 
34 
36  public:
37  std::vector<std::vector<double>> randomVectors;
38  std::vector<Tensor> solutions;
39 
40  std::vector<std::vector<double>> initialRandomVectors;
41  std::vector<Tensor> initialSolutions;
42 
43  UQMeasurementSet() = default;
44  UQMeasurementSet(const UQMeasurementSet& _other) = default;
45  UQMeasurementSet( UQMeasurementSet&& _other) = default;
46 
47  void add(const std::vector<double>& _rndvec, const Tensor& _solution);
48 
49  void add_initial(const std::vector<double>& _rndvec, const Tensor& _solution);
50  };
51 
52 
53 
54  void uq_adf(TTTensor& _x, const std::vector<std::vector<double>>& _randomVariables, const std::vector<Tensor>& _solutions);
55 
56  TTTensor uq_adf(const UQMeasurementSet& _measurments, const TTTensor& _guess);
57 
58  Tensor uq_avg(const TTTensor& _x, const size_t _N, const size_t _numSpecial);
59 
60  std::pair<std::vector<std::vector<double>>, std::vector<Tensor>> uq_mc(const TTTensor& _x, const size_t _N, const size_t _numSpecial);
61 }
62 
std::vector< Tensor > solutions
Definition: uqAdf.h:38
void add_initial(const std::vector< double > &_rndvec, const Tensor &_solution)
Definition: uqAdf.cpp:419
void add(const std::vector< double > &_rndvec, const Tensor &_solution)
Definition: uqAdf.cpp:414
std::vector< std::vector< double > > initialRandomVectors
Definition: uqAdf.h:40
The main namespace of xerus.
Definition: basic.h:37
Class that handles simple (non-decomposed) tensors in a dense or sparse representation.
Definition: tensor.h:70
Tensor uq_avg(const TTTensor &_x, const size_t _N, const size_t _numSpecial)
Definition: uqAdf.cpp:451
void uq_adf(TTTensor &_x, const std::vector< std::vector< double >> &_randomVariables, const std::vector< Tensor > &_solutions)
Definition: uqAdf.cpp:327
std::vector< std::vector< double > > randomVectors
Definition: uqAdf.h:37
std::vector< Tensor > initialSolutions
Definition: uqAdf.h:41
std::pair< std::vector< std::vector< double > >, std::vector< Tensor > > uq_mc(const TTTensor &_x, const size_t _N, const size_t _numSpecial)
Definition: uqAdf.cpp:425