Gazebo Math
API Reference
7.4.0
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
include
gz
math
gz/math/SignalStats.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2015 Open Source Robotics Foundation
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
*/
17
#ifndef GZ_MATH_SIGNALSTATS_HH_
18
#define GZ_MATH_SIGNALSTATS_HH_
19
20
#include <map>
21
#include <memory>
22
#include <string>
23
#include <
gz/math/Helpers.hh
>
24
#include <gz/math/config.hh>
25
26
namespace
gz
27
{
28
namespace
math
29
{
30
// Inline bracket to help doxygen filtering.
31
inline
namespace
GZ_MATH_VERSION_NAMESPACE {
32
//
34
class
SignalStatisticPrivate;
35
38
class
GZ_MATH_VISIBLE
SignalStatistic
39
{
41
public
:
SignalStatistic
();
42
44
public
:
virtual
~SignalStatistic
();
45
48
public
:
SignalStatistic
(
const
SignalStatistic
&_ss);
49
52
public
:
virtual
double
Value
()
const
= 0;
53
56
public
:
virtual
std::string
ShortName
()
const
= 0;
57
60
public
:
virtual
size_t
Count
()
const
;
61
64
public
:
virtual
void
InsertData
(
const
double
_data) = 0;
65
67
public
:
virtual
void
Reset
();
68
69
#ifdef _WIN32
70
// Disable warning C4251 which is triggered by
71
// std::unique_ptr
72
#pragma warning(push)
73
#pragma warning(disable: 4251)
74
#endif
76
protected
:
std::unique_ptr<SignalStatisticPrivate>
dataPtr
;
77
#ifdef _WIN32
78
#pragma warning(pop)
79
#endif
80
};
81
84
class
GZ_MATH_VISIBLE
SignalMaximum
:
public
SignalStatistic
85
{
86
// Documentation inherited.
87
public
:
virtual
double
Value
()
const override
;
88
91
public
:
virtual
std::string
ShortName
()
const override
;
92
93
// Documentation inherited.
94
public
:
virtual
void
InsertData
(
const
double
_data)
override
;
95
};
96
99
class
GZ_MATH_VISIBLE
SignalMean
:
public
SignalStatistic
100
{
101
// Documentation inherited.
102
public
:
virtual
double
Value
()
const override
;
103
106
public
:
virtual
std::string
ShortName
()
const override
;
107
108
// Documentation inherited.
109
public
:
virtual
void
InsertData
(
const
double
_data)
override
;
110
};
111
114
class
GZ_MATH_VISIBLE
SignalMinimum
:
public
SignalStatistic
115
{
116
// Documentation inherited.
117
public
:
virtual
double
Value
()
const override
;
118
121
public
:
virtual
std::string
ShortName
()
const override
;
122
123
// Documentation inherited.
124
public
:
virtual
void
InsertData
(
const
double
_data)
override
;
125
};
126
130
class
GZ_MATH_VISIBLE
SignalRootMeanSquare
:
public
SignalStatistic
131
{
132
// Documentation inherited.
133
public
:
virtual
double
Value
()
const override
;
134
137
public
:
virtual
std::string
ShortName
()
const override
;
138
139
// Documentation inherited.
140
public
:
virtual
void
InsertData
(
const
double
_data)
override
;
141
};
142
148
class
GZ_MATH_VISIBLE
SignalMaxAbsoluteValue
:
public
SignalStatistic
149
{
150
// Documentation inherited.
151
public
:
virtual
double
Value
()
const override
;
152
155
public
:
virtual
std::string
ShortName
()
const override
;
156
157
// Documentation inherited.
158
public
:
virtual
void
InsertData
(
const
double
_data)
override
;
159
};
160
164
class
GZ_MATH_VISIBLE
SignalVariance
:
public
SignalStatistic
165
{
166
// Documentation inherited.
167
public
:
virtual
double
Value
()
const override
;
168
171
public
:
virtual
std::string
ShortName
()
const override
;
172
173
// Documentation inherited.
174
public
:
virtual
void
InsertData
(
const
double
_data)
override
;
175
};
176
178
class
SignalStatsPrivate;
179
182
class
GZ_MATH_VISIBLE
SignalStats
183
{
185
public
:
SignalStats
();
186
188
public
:
~SignalStats
();
189
192
public
:
SignalStats
(
const
SignalStats
&_ss);
193
199
public
:
size_t
Count
()
const
;
200
205
public
:
std::map<std::string, double>
Map
()
const
;
206
209
public
:
void
InsertData
(
const
double
_data);
210
220
public
:
bool
InsertStatistic
(
const
std::string
&_name);
221
229
public
:
bool
InsertStatistics
(
const
std::string
&_names);
230
232
public
:
void
Reset
();
233
237
public
:
SignalStats
&
operator=
(
const
SignalStats
&_s);
238
239
#ifdef _WIN32
240
// Disable warning C4251 which is triggered by
241
// std::unique_ptr
242
#pragma warning(push)
243
#pragma warning(disable: 4251)
244
#endif
246
private
:
std::unique_ptr<SignalStatsPrivate>
dataPtr;
247
#ifdef _WIN32
248
#pragma warning(pop)
249
#endif
250
};
251
}
252
}
253
}
254
#endif