Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
Pattern.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef> // for size_t
4#include <utility>
5#include <vector>
6
7
8class Pattern
9{
10 public:
11
12 typedef typename std::vector<double>::iterator iterator;
13 typedef typename std::vector<double>::const_iterator const_iterator;
14
16 : m_weight (0)
17 {
18 }
19
21 {
22 }
23
25 {
26 m_input.assign (std::begin (other.m_input), std::end (other.m_input));
27 m_output.assign (std::begin (other.m_output), std::end (other.m_output));
28 m_weight = other.m_weight;
29 }
30
32 {
33 m_input = std::move (other.m_input);
34 m_output = std::move (other.m_output);
35 m_weight = other.m_weight;
36 }
37
39 {
40 m_input.assign (std::begin (other.input ()), std::end (other.input ()));
41 m_output.assign (std::begin (other.output ()), std::end (other.output ()));
42 m_weight = other.m_weight;
43 return *this;
44 }
45
46 template <typename ItValue>
53
54 template <typename ItValue>
58 {
59 m_output.push_back (outputValue);
60 }
61
62 template <typename InputContainer, typename OutputContainer>
64 : m_input (std::begin (_input), std::end (_input))
65 , m_output (std::begin (_output), std::end (_output))
67 {
68 }
69
70 const_iterator beginInput () const { return m_input.begin (); }
71 const_iterator endInput () const { return m_input.end (); }
72 const_iterator beginOutput () const { return m_output.begin (); }
73 const_iterator endOutput () const { return m_output.end (); }
74
75 double weight () const { return m_weight; }
76 void weight (double w) { m_weight = w; }
77
78 size_t inputSize () const { return m_input.size (); }
79 size_t outputSize () const { return m_output.size (); }
80
81 void addInput (double value) { m_input.push_back (value); }
82 void addOutput (double value) { m_output.push_back (value); }
83
84 std::vector<double>& input () { return m_input; }
85 std::vector<double>& output () { return m_output; }
86 const std::vector<double>& input () const { return m_input; }
87 const std::vector<double>& output () const { return m_output; }
88
89 private:
90 std::vector<double> m_input;
91 std::vector<double> m_output;
92 double m_weight;
93};
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Pattern(Pattern &&other)
Definition Pattern.h:31
const_iterator endInput() const
Definition Pattern.h:71
const std::vector< double > & output() const
Definition Pattern.h:87
Pattern(InputContainer &_input, OutputContainer &_output, double _weight=1.0)
Definition Pattern.h:63
std::vector< double > m_output
Definition Pattern.h:91
Pattern & operator=(const Pattern &other)
Definition Pattern.h:38
void weight(double w)
Definition Pattern.h:76
const_iterator beginOutput() const
Definition Pattern.h:72
double weight() const
Definition Pattern.h:75
Pattern(ItValue inputBegin, ItValue inputEnd, ItValue outputBegin, ItValue outputEnd, double _weight=1.0)
Definition Pattern.h:47
void addOutput(double value)
Definition Pattern.h:82
const std::vector< double > & input() const
Definition Pattern.h:86
~Pattern()
Definition Pattern.h:20
size_t outputSize() const
Definition Pattern.h:79
Pattern(const Pattern &other)
Definition Pattern.h:24
void addInput(double value)
Definition Pattern.h:81
size_t inputSize() const
Definition Pattern.h:78
Pattern()
Definition Pattern.h:15
std::vector< double >::iterator iterator
Definition Pattern.h:12
const_iterator beginInput() const
Definition Pattern.h:70
std::vector< double >::const_iterator const_iterator
Definition Pattern.h:13
std::vector< double > & input()
Definition Pattern.h:84
std::vector< double > m_input
Definition Pattern.h:90
double m_weight
Definition Pattern.h:92
const_iterator endOutput() const
Definition Pattern.h:73
std::vector< double > & output()
Definition Pattern.h:85
Pattern(ItValue inputBegin, ItValue inputEnd, double outputValue, double _weight=1.0)
Definition Pattern.h:55