15 auto& indexToUse =
result.first->second;
20 if(0 == indexToUse.value_) {
22 unsigned int previous = 0;
23 indexToUse.value_.compare_exchange_strong(previous,newIndex);
25 id_ = indexToUse.value_.load();
28 auto& allNames =
names();
29 allNames.grow_to_at_least(
id_+1);
30 auto& storedName = allNames[
id_];
31 if(not storedName.string_) {
32 std::unique_ptr<std::string> newName(
new std::string{name});
34 if( storedName.string_.compare_exchange_strong(previous,newName.get())) {
60 std::vector<std::string> svec;
61 std::vector<double> dvec;
63 for(; it != v.end(); ++it )
65 vecPair_->second.first.push_back( it->first );
66 vecPair_->second.second.push_back( it->second );
76 std::vector<std::string> svec( 1,
"" );
77 std::vector<double> dvec( 1, val );
88 std::vector<std::string> svec( 1, sval );
89 std::vector<double> dvec( 1, dval );
99 std::vector<std::string> svec( 1, sval );
100 std::vector<double> dvec( 1, 0 );
136 const std::vector<double> &
145 std::string message =
"DDValue " +
name() +
" is not numerically evaluated! Use DDValue::std::strings()!";
153 o << v.
name() <<
" = ";
157 for(; i < v.
size(); ++
i )
159 o <<
'(' << v[
i].first <<
',' << v[
i].second <<
") ";
164 const std::vector<std::string> &
s = v.
strings();
165 for(; i < v.
size(); ++
i )
176 return o << v.second;
188 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
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.
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