forked from AmbaPant/mantid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
HistogramE.h
68 lines (62 loc) · 2.84 KB
/
HistogramE.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2016 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "MantidHistogramData/Addable.h"
#include "MantidHistogramData/DllConfig.h"
#include "MantidHistogramData/FixedLengthVector.h"
#include "MantidHistogramData/Multipliable.h"
#include "MantidHistogramData/Scalable.h"
namespace Mantid {
namespace HistogramData {
class CountStandardDeviations;
class CountVariances;
class FrequencyStandardDeviations;
class FrequencyVariances;
class HistogramE;
namespace detail {
template <class CountStandardDeviations, class HistogramE> class VectorOf;
template <class CountVariances, class HistogramE> class VectorOf;
template <class FrequencyStandardDeviations, class HistogramE> class VectorOf;
template <class FrequencyVariances, class HistogramE> class VectorOf;
} // namespace detail
/** HistogramE
This class holds e-data of a histogram. The e-data can be variances or
standard deviations of counts or frequencies. To prevent breaking the
histogram, the length of HistogramE cannot be changed via the public
interface.
@author Simon Heybrock
@date 2016
*/
class MANTID_HISTOGRAMDATA_DLL HistogramE : public detail::FixedLengthVector<HistogramE>,
public detail::Addable<HistogramE>,
public detail::Multipliable<HistogramE>,
public detail::Scalable<HistogramE> {
public:
using detail::FixedLengthVector<HistogramE>::FixedLengthVector;
using detail::FixedLengthVector<HistogramE>::operator=;
HistogramE() = default;
// The copy and move constructor and assignment are not captured properly
// by
// the using declaration above, so we need them here explicitly.
HistogramE(const HistogramE &) = default;
HistogramE(HistogramE &&) = default;
HistogramE &operator=(const HistogramE &) & = default;
HistogramE &operator=(HistogramE &&) & = default;
// Multiple inheritance causes ambiguous overload, bring operators into scope.
using detail::Multipliable<HistogramE>::operator*=;
using detail::Multipliable<HistogramE>::operator/=;
using detail::Scalable<HistogramE>::operator*=;
using detail::Scalable<HistogramE>::operator/=;
// These classes are friends, such that they can modify the length.
friend class Histogram;
friend class detail::VectorOf<CountStandardDeviations, HistogramE>;
friend class detail::VectorOf<CountVariances, HistogramE>;
friend class detail::VectorOf<FrequencyStandardDeviations, HistogramE>;
friend class detail::VectorOf<FrequencyVariances, HistogramE>;
};
} // namespace HistogramData
} // namespace Mantid