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