Tomographer  v5.4
Tomographer C++ Framework Documentation
densellh.h
Go to the documentation of this file.
1 /* This file is part of the Tomographer project, which is distributed under the
2  * terms of the MIT license.
3  *
4  * The MIT License (MIT)
5  *
6  * Copyright (c) 2016 ETH Zurich, Institute for Theoretical Physics, Philippe Faist
7  * Copyright (c) 2017 Caltech, Institute for Quantum Information and Matter, Philippe Faist
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a copy
10  * of this software and associated documentation files (the "Software"), to deal
11  * in the Software without restriction, including without limitation the rights
12  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13  * copies of the Software, and to permit persons to whom the Software is
14  * furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included in
17  * all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  * SOFTWARE.
26  */
27 
28 #ifndef TOMOGRAPHER_DENSEDM_DENSELLH_H
29 #define TOMOGRAPHER_DENSEDM_DENSELLH_H
30 
31 #include <cstddef>
32 #include <cmath>
33 
34 #include <random>
35 
36 #include <boost/math/constants/constants.hpp>
37 
45 namespace Tomographer {
46 namespace DenseDM {
47 
51 enum {
52 
57 
62 
67 
68 };
69 
70 
71 
72 
73 
74 
75 
76 
84 class TOMOGRAPHER_EXPORT InvalidMeasData : public std::exception
85 {
86  std::string _msg;
87  std::string _fullmsg;
88 public:
95  : _msg(msg), _fullmsg("Invalid Measurement Data: " + _msg) { }
96 
100  : _msg(std::move(msg)), _fullmsg("Invalid Measurement Data: " + _msg) { }
101 
102  virtual ~InvalidMeasData() throw() { }
103 
105  inline std::string msg() const noexcept { return _msg; }
107  inline std::string fullMsg() const noexcept { return _fullmsg; }
108 
110  virtual const char * what() const noexcept { return _msg.c_str(); }
111 };
112 
113 
114 
115 } // namespace DenseDM
116 } // namespace Tomographer
117 
118 
119 
120 #endif
Base namespace for the Tomographer project.
Definition: densellh.h:45
std::string fullMsg() const noexcept
Get the full error message.
Definition: densellh.h:107
STL namespace.
InvalidMeasData(const std::string &msg)
Constructor with error message.
Definition: densellh.h:94
std::string msg() const noexcept
Get the message provided to the constructor.
Definition: densellh.h:105
InvalidMeasData(std::string &&msg)
Constructor with error message (given as rvalue reference)
Definition: densellh.h:99
STL class.
Exception class notifying of invalid measurement data.
Definition: densellh.h:84
STL class.
The DenseLLH-compatible type cannot calculate the LLH function; it is useless.
Definition: densellh.h:56
The DenseLLH-compatible object exposes a method logLikelihoodRho(), taking as argument a (const ref t...
Definition: densellh.h:61
virtual const char * what() const noexcept
Get the full error message as a pointer to a C string.
Definition: densellh.h:110
The DenseLLH-compatible object exposes a method logLikelihoodX(), taking as argument a (const ref to ...
Definition: densellh.h:66