38 #include <drain/util/Histogram.h>
39 #include <drain/prog/Command.h>
43 #include "resources.h"
52 getParameters().link(
"index", index);
53 getParameters().link(
"range", binRange.tuple());
54 getParameters().link(
"range.min", binRange.min);
55 getParameters().link(
"range.max", binRange.min);
57 getParameters().link(
"count", count);
58 getParameters().link(
"label", label);
61 drain::Histogram::vect_t::size_type index;
63 drain::Histogram::count_t count;
78 std::string attribute;
82 CmdHistogram() :
drain::BasicCommand(__FUNCTION__, std::string(
"Histogram. Optionally --format using keys ") + histEntryHelper.getParameters().getKeys()) {
83 getParameters().link(
"count", count = 0);
84 getParameters().link(
"range", range.tuple());
86 getParameters().link(
"filename", filename=
"",
"<filename>.txt|-");
87 getParameters().link(
"attribute", attribute=
"histogram",
"<attribute_key>");
88 getParameters().link(
"commentChar", commentChar,
"Prefix for header and postfix for labels");
92 getParameters().
copyStruct(cmd.getParameters(), cmd, *
this);
96 typedef std::map<int, std::string> legend;
103 void writeHistogram(
const drain::Histogram & histogram,
const std::string & filename,
const legend &leg = legend())
const;
105 std::string commentChar =
"#";
110 void setSpecialEntry(legend & leg,
double value,
const std::string & label)
const;
Simple implementation of Command: adds name , description and parameters .
Definition: Command.h:417
Something which has a name, a description and possibly some parameters of varying type.
Definition: BeanLike.h:60
Class for computing a histogram and some statistics: average, min, max, mean, std....
Definition: Histogram.h:61
void copyStruct(const ReferenceMap &m, const T &src, T &dst, extLinkPolicy policy=RESERVE)
Experimental. Copies references and values of a structure to another.
Definition: ReferenceMap.h:399
TODO: generalize to array outfile.
Definition: file-hist.h:70
void exec() const
Run the command with current parameter values.
Definition: file-hist.cpp:55
Definition: DataSelector.cpp:44
Definition: file-hist.h:48