17 auto& indexToUse =
result.first->second;
22 if (0 == indexToUse.value_) {
25 indexToUse.value_.compare_exchange_strong(
previous, newIndex);
27 id_ = indexToUse.value_.load();
30 auto& allNames =
names();
31 allNames.grow_to_at_least(
id_ + 1);
32 auto& storedName = allNames[
id_];
33 if (not storedName.string_) {
36 if (storedName.string_.compare_exchange_strong(
previous,
newName.get())) {
50 std::vector<std::string> svec;
51 std::vector<double> dvec;
53 for (; it !=
v.end(); ++it) {
54 vecPair_->second.first.emplace_back(it->first);
55 vecPair_->second.second.emplace_back(it->second);
62 std::vector<std::string> svec(1,
"");
63 std::vector<double> dvec(1,
val);
72 std::vector<std::string> svec(1, sval);
73 std::vector<double> dvec(1, dval);
81 std::vector<std::string> svec(1, sval);
82 std::vector<double> dvec(1, 0);
115 std::string message =
"DDValue " +
name() +
" is not numerically evaluated! Use DDValue::std::strings()!";
122 o <<
v.name() <<
" = ";
124 if (
v.isEvaluated()) {
125 for (;
i <
v.size(); ++
i) {
126 o <<
'(' <<
v[
i].first <<
',' <<
v[
i].second <<
") ";
129 const std::vector<std::string>&
s =
v.strings();
130 for (;
i <
v.size(); ++
i) {
144 std::string message =
"DDValue " +
name() +
" is not numerically evaluated! Use DDValue::std::strings()!";
156 if (
id() ==
v.id()) {
173 if (
id() ==
v.id()) {
176 if (
vecPair_->first &&
v.vecPair_->first) {
std::pair< bool, std::pair< std::vector< std::string >, std::vector< double > >> vecpair_type
bool operator<(const DDValue &) const
A DDValue a is smaller than a DDValue b if (a.id()<b.id()) OR (a.id()==b.id() and value(a)<value(b)) ...
DDValue(void)
create a unnamed emtpy value. One can assing a named DDValue to it.
bool isEvaluated(void) const
true, if values are numerical evaluated; else false.
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
tbb::concurrent_vector< StringHolder, edm::zero_allocator< StringHolder > > Names
void setEvalState(bool newState)
set to true, if the double-values (method DDValue::doubles()) make sense
Log< level::Error, false > LogError
DDValuePair operator[](unsigned int i) const
tbb::concurrent_unordered_map< std::string, AtomicUInt > NamesToIndicies
static Names initializeNames()
static NamesToIndicies & indexer()
void init(const std::string &)
static std::atomic< unsigned int > lastIndex
std::shared_ptr< vecpair_type > vecPair_
const std::string & name(void) const
the name of the DDValue
std::ostream & operator<<(std::ostream &o, const DDValue &v)
bool operator==(const DDValue &v) const
Two DDValues are equal only if their id() is equal AND their values are equal.