24.02.1
|
Go to the documentation of this file.
24 #ifndef ARM_COMPUTE_TEST_MEASUREMENT
25 #define ARM_COMPUTE_TEST_MEASUREMENT
87 b.v.floating_point +=
v.floating_point;
91 b.v.integer +=
v.integer;
106 b.v.floating_point -=
v.floating_point;
110 b.v.integer -=
v.integer;
125 b.v.floating_point *=
v.floating_point;
129 b.v.integer *=
v.integer;
164 v.floating_point -=
b.v.floating_point;
168 v.integer -=
b.v.integer;
183 return v.floating_point <
b.v.floating_point;
187 return v.integer <
b.v.integer;
206 return 100.0 * sqrt(
static_cast<double>(variance.
v.
integer)) / mean.
v.
integer;
227 return _value <
b.value();
241 os << measurement._value <<
" " << measurement._unit;
251 template < typename Floating, typename std::enable_if < !std::is_integral<Floating>::value,
int >
::type = 0 >
253 : _unit(
unit), _raw_data(std::move(raw)), _value(
true)
256 if(_raw_data.empty())
268 template <typename Integer, typename std::enable_if<std::is_integral<Integer>::value,
int>
::type = 0>
270 : _unit(
unit), _raw_data(std::move(raw)), _value(
false)
272 _value.
v.
integer =
static_cast<long long int>(v);
273 if(_raw_data.empty())
283 const std::string &
unit()
const
308 std::list<std::string> _raw_data;
const std::string & unit() const
Accessor for the unit of the measurement.
std::string to_string() const
Convert the value stored to string.
Value & operator-=(const Value &b)
Subtract another value and return the updated stored value.
decltype(strategy::transforms) typedef type
friend std::ostream & operator<<(std::ostream &os, const Value &value)
Add the value stored to the stream as a string.
Generic measurement that stores values as either double or long long int.
std::stringstream ss(mlgo_str)
const Value & value() const
Accessor for the stored value.
Measurement(Floating v, std::string unit, std::list< std::string > raw={})
Constructor to store a floating point value.
std::string arithmetic_to_string(T val, int decimal_places=0)
Create a string with the arithmetic value in full precision.
bool operator<(const Measurement &b) const
Compare the stored value with another value.
Value operator*(Value b) const
Multiple with another value and return the result.
bool operator<(const Value &b) const
Compare the stored value with another value.
bool is_floating_point
Is the stored value floating point or integer ?
Value(bool is_floating)
Constructor.
Value operator-(Value b) const
Subtract with another value and return the result.
friend std::ostream & operator<<(std::ostream &os, const Measurement &measurement)
Stream output operator to print the measurement.
union arm_compute::test::framework::Measurement::Value::@5 v
Stored value.
const std::list< std::string > & raw_data() const
Accessor for the raw data.
Measurement(Integer v, std::string unit, std::list< std::string > raw={})
Constructor to store an integer value.
Copyright (c) 2017-2024 Arm Limited.
Value operator+(Value b) const
Add with another value and return the sum.
Value operator/(int b) const
Return the stored value divided by an integer.
static double relative_standard_deviation(const Value &variance, const Value &mean)
Get the relative standard deviation to a given distribution as a percentage.