19 auto& indexToUse =
result.first->second;
24 if(0 == indexToUse.value_) {
26 unsigned int previous = 0;
27 indexToUse.value_.compare_exchange_strong(previous,newIndex);
29 id_ = indexToUse.value_.load();
32 auto& allNames =
names();
33 allNames.grow_to_at_least(
id_+1);
34 auto& storedName = allNames[
id_];
35 if(not storedName.string_) {
38 if( storedName.string_.compare_exchange_strong(previous,
newName.get())) {
64 std::vector<std::string> svec;
65 std::vector<double> dvec;
67 for(; it != v.end(); ++it )
69 vecPair_->second.first.emplace_back( it->first );
70 vecPair_->second.second.emplace_back( it->second );
79 std::vector<std::string> svec( 1,
"" );
80 std::vector<double> dvec( 1, val );
91 std::vector<std::string> svec( 1, sval );
92 std::vector<double> dvec( 1, dval );
102 std::vector<std::string> svec( 1, sval );
103 std::vector<double> dvec( 1, 0 );
139 const std::vector<double> &
148 std::string message =
"DDValue " +
name() +
" is not numerically evaluated! Use DDValue::std::strings()!";
156 o << v.
name() <<
" = ";
160 for(; i < v.
size(); ++
i )
162 o <<
'(' << v[
i].first <<
',' << v[
i].second <<
") ";
167 const std::vector<std::string> &
s = v.
strings();
168 for(; i < v.
size(); ++
i )
179 return o << v.second;
191 std::string message =
"DDValue " +
name() +
" is not numerically evaluated! Use DDValue::std::strings()!";
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, tbb::zero_allocator< StringHolder >> Names
void setEvalState(bool newState)
set to true, if the double-values (method DDValue::doubles()) make sense
unsigned int id(void) const
returns the ID of the DDValue
bool isEvaluated(void) const
true, if values are numerical evaluated; else false.
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.
tbb::concurrent_unordered_map< std::string, AtomicUInt > NamesToIndicies
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
std::ostream & operator<<(std::ostream &o, const DDValue &v)