21 dictionary::map_type::const_iterator dictionary::find_nonempty_(
const std::string& key)
const {
22 map_type::const_iterator it=map_.find(key);
23 if (it!=map_.end() && !(it->second).
empty())
32 map_type::iterator it=map_.lower_bound(key);
34 map_.key_comp()(key, it->first)) {
37 it=map_.insert(it,map_type::value_type(key,
value_type(key)));
45 map_type::const_iterator it=map_.find(key);
54 typedef typename M::value_type pair_type;
55 bool operator()(
const pair_type& lhs,
const pair_type& rhs)
const 57 return (lhs.first==rhs.first) && lhs.second.equals(rhs.second);
65 if (this->
size()!=rhs.
size())
return false;
66 return std::equal(map_.begin(), map_.end(), rhs.map_.begin(), compare<map_type>());
87 s << it->first <<
" = " << it->second <<
"\n";
bool empty() const
True if the cdictionary does not contain elements (even empty ones)
const_iterator begin() const
Const-iterator to the beginning of the contained map.
void broadcast(C const &c, P &p, int r=0)
std::size_t size() const
Size of the dictionary (including empty elements)
void swap(params &p1, params &p2)
Exception for using uninitialized value.
Encapsulation of an MPI communicator and some communicator-related operations.
bool equals(const dictionary &rhs) const
Compare two dictionaries (true if all entries are of the same type and value)
friend std::ostream & operator<<(std::ostream &, const dictionary &)
void load(alps::hdf5::archive &ar)
Load the dictionary from an archive.
void save(alps::hdf5::archive &ar) const
Save the dictionary to an archive.
friend void swap(dictionary &d1, dictionary &d2)
Swap the dictionaries.
value_type & operator[](const std::string &key)
Access with intent to assign.
const_iterator end() const
Const-iterator to the end of the contained map.
void broadcast(const communicator &comm, T *vals, std::size_t count, int root)
Broadcasts array vals of a primitive type T, length count on communicator comm with root root ...
map_type::const_iterator const_iterator
Header for object-oriented interface to MPI for std::map.