HOPS
HOPS class reference
source
cpp_src
Plugins
MatplotPlugin
include
MHO_PlotDataExtractor.hh
Go to the documentation of this file.
1
#ifndef MHO_PlotDataExtractor_HH__
2
#define MHO_PlotDataExtractor_HH__
3
4
#include "
MHO_JSONHeaderWrapper.hh
"
5
6
#include <algorithm>
7
#include <cmath>
8
#include <iomanip>
9
#include <numeric>
10
#include <sstream>
11
#include <string>
12
#include <vector>
13
14
namespace
hops
15
{
16
20
class
MHO_PlotDataExtractor
21
{
22
public
:
29
static
std::vector< double >
extract_vector
(
const
mho_json
& plot_dict,
const
std::string& key);
30
36
static
std::vector< double >
create_index_vector
(
size_t
size);
37
44
static
std::string
format_scientific
(
double
value
,
int
precision = 3);
45
46
static
std::string
format_standard
(
double
value
,
int
minDigits,
int
roundPlaces);
47
55
static
int
extract_int
(
const
mho_json
& plot_dict,
const
std::string& key,
int
default_value = 0);
56
64
static
std::string
extract_string
(
const
mho_json
& plot_dict,
const
std::string& key,
65
const
std::string& default_value =
""
);
66
74
static
double
extract_double
(
const
mho_json
& plot_dict,
const
std::string& key,
double
default_value = 0.0);
75
};
76
77
}
// namespace hops
78
79
#endif
/* end of include guard: MHO_PlotDataExtractor_HH__ */
MHO_JSONHeaderWrapper.hh
mho_json
nlohmann::json mho_json
Definition:
MHO_JSONHeaderWrapper.hh:5
hops::MHO_PlotDataExtractor
Utility class for extracting and processing plot data from JSON.
Definition:
MHO_PlotDataExtractor.hh:21
hops::MHO_PlotDataExtractor::extract_vector
static std::vector< double > extract_vector(const mho_json &plot_dict, const std::string &key)
Extracts a vector of doubles from JSON plot dictionary.
Definition:
MHO_PlotDataExtractor.cc:8
hops::MHO_PlotDataExtractor::format_scientific
static std::string format_scientific(double value, int precision=3)
Formats a double as scientific notation string.
Definition:
MHO_PlotDataExtractor.cc:34
hops::MHO_PlotDataExtractor::format_standard
static std::string format_standard(double value, int minDigits, int roundPlaces)
Definition:
MHO_PlotDataExtractor.cc:41
hops::MHO_PlotDataExtractor::extract_int
static int extract_int(const mho_json &plot_dict, const std::string &key, int default_value=0)
Extracts integer value from JSON with fallback.
Definition:
MHO_PlotDataExtractor.cc:51
hops::MHO_PlotDataExtractor::extract_double
static double extract_double(const mho_json &plot_dict, const std::string &key, double default_value=0.0)
Extracts double value from JSON with fallback.
Definition:
MHO_PlotDataExtractor.cc:94
hops::MHO_PlotDataExtractor::extract_string
static std::string extract_string(const mho_json &plot_dict, const std::string &key, const std::string &default_value="")
Extracts string value from JSON with fallback.
Definition:
MHO_PlotDataExtractor.cc:74
hops::MHO_PlotDataExtractor::create_index_vector
static std::vector< double > create_index_vector(size_t size)
Creates an index vector (0, 1, 2, ..., size-1)
Definition:
MHO_PlotDataExtractor.cc:27
hops
Definition:
MHO_AdhocFlagging.hh:18
value
Definition:
vex.h:175
Generated on Thu Jun 18 2026 20:58:26 for HOPS by
1.9.1