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_) {
34 std::unique_ptr<std::string> newName(
new std::string{name});
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() <<
" = ";
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()) {
const std::string & name(void) const
the name of the DDValue
DDValue(void)
create a unnamed emtpy value. One can assing a named DDValue to it.
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
std::ostream & operator<<(std::ostream &out, const ALILine &li)
unsigned int id(void) const
returns the ID of the DDValue
bool isEvaluated(void) const
true, if values are numerical evaluated; else false.
tbb::concurrent_unordered_map< std::string, AtomicUInt > NamesToIndicies
static Names initializeNames()
static NamesToIndicies & indexer()
void init(const std::string &)
bool operator==(const DDValue &v) const
Two DDValues are equal only if their id() is equal AND their values are equal.
static std::atomic< unsigned int > lastIndex
const std::vector< std::string > & strings() const
a reference to the std::string-valued values stored in the given instance of DDValue ...
std::shared_ptr< vecpair_type > vecPair_
DDValuePair operator[](unsigned int i) const
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)) ...
unsigned int size() const
the size of the stored value-pairs (std::string,double)
std::pair< bool, std::pair< std::vector< std::string >, std::vector< double >>> vecpair_type