Chemical Data Processing Library C++ API - Version 1.4.0
Map.hpp
Go to the documentation of this file.
1 /*
2  * Map.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_UTIL_MAP_HPP
30 #define CDPL_UTIL_MAP_HPP
31 
32 #include <map>
33 #include <functional>
34 #include <utility>
35 #include <string>
36 #include <cstddef>
37 #include <memory>
38 
39 #include "CDPL/Base/Exceptions.hpp"
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Util
46  {
47 
48  template <typename ValueType, bool Allow = true>
50  {
51 
52  static const ValueType& get()
53  {
54  return defValue;
55  }
56 
57  static const ValueType defValue;
58  };
59 
60  template <typename ValueType, bool Allow>
61  const ValueType MapDefaultValue<ValueType, Allow>::defValue = ValueType();
62 
63  template <typename ValueType>
64  struct MapDefaultValue<ValueType, false>
65  {
66 
67  static const ValueType& get()
68  {
69  throw Base::OperationFailed("Map: default value not supported");
70  }
71  };
72 
93  template <typename Key, typename Value, bool AllowDefValues = false,
94  typename KeyCompFunc = std::less<Key> >
95  class Map
96  {
97 
98  typedef std::map<Key, Value, KeyCompFunc> StorageType;
99 
100  public:
104  typedef std::shared_ptr<Map> SharedPointer;
105 
109  typedef Key KeyType;
110 
114  typedef Value ValueType;
115 
122  typedef typename StorageType::value_type Entry;
123 
127  typedef typename StorageType::const_iterator ConstEntryIterator;
128 
132  typedef typename StorageType::const_reverse_iterator ConstReverseEntryIterator;
133 
137  typedef typename StorageType::iterator EntryIterator;
138 
142  typedef typename StorageType::reverse_iterator ReverseEntryIterator;
143 
147  Map():
148  data() {}
149 
154  Map(const KeyCompFunc& func):
155  data(func) {}
156 
162  template <typename InputIter>
163  Map(const InputIter& first, const InputIter& last):
164  data(first, last)
165  {}
166 
174  template <typename InputIter>
175  Map(const InputIter& first, const InputIter& last, const KeyCompFunc& func):
176  data(first, last, func)
177  {}
178 
182  virtual ~Map() {}
183 
188  StorageType& getData();
189 
194  const StorageType& getData() const;
195 
200  std::size_t getSize() const;
201 
206  bool isEmpty() const;
207 
211  void clear();
212 
217  void swap(Map& map);
218 
223  KeyCompFunc getKeyCompareFunction() const;
224 
235  EntryIterator getEntry(const Key& key);
236 
247  ConstEntryIterator getEntry(const Key& key) const;
248 
254  bool containsEntry(const Key& key) const;
255 
270  Value& getValue(const Key& key);
271 
286  Value& getValue(const Key& key, Value& def_value);
287 
302  const Value& getValue(const Key& key) const;
303 
318  const Value& getValue(const Key& key, const Value& def_value) const;
319 
331  Value& operator[](const Key& key);
332 
344  const Value& operator[](const Key& key) const;
345 
350  void removeEntry(const EntryIterator& it);
351 
356  bool removeEntry(const Key& key);
357 
363  void removeEntries(const EntryIterator& first, const EntryIterator& last);
364 
380  std::pair<EntryIterator, bool> insertEntry(const Entry& item);
381 
398  std::pair<EntryIterator, bool> insertEntry(const Key& key, const Value& value);
399 
413  EntryIterator insertEntry(const EntryIterator& it, const Entry& item);
414 
429  EntryIterator insertEntry(const EntryIterator& it, const Key& key, const Value& value);
430 
444 
458  EntryIterator setEntry(const Key& key, const Value& value);
459 
470  template <typename InputIter>
471  void insertEntries(const InputIter& first, const InputIter& last);
472 
483  template <typename InputIter>
484  void setEntries(const InputIter& first, const InputIter& last);
485 
491  EntryIterator getLowerBound(const Key& key);
492 
498  ConstEntryIterator getLowerBound(const Key& key) const;
499 
505  EntryIterator getUpperBound(const Key& key);
506 
512  ConstEntryIterator getUpperBound(const Key& key) const;
513 
519 
525 
531 
537 
543 
549 
555 
561 
567 
573 
579 
585 
586 
587  protected:
615  virtual const char* getClassName() const;
616 
617  private:
618  const Value& getDefaultValue() const;
619 
620  StorageType data;
621  };
622 
631  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
634 
643  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
646 
655  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
658 
667  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
670 
679  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
682 
691  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
694 
695  } // namespace Util
696 } // namespace CDPL
697 
698 
699 // Implementation
700 
701 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
702 typename CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::StorageType&
704 {
705  return data;
706 }
707 
708 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
709 const typename CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::StorageType&
711 {
712  return data;
713 }
714 
715 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
717 {
718  return data.size();
719 }
720 
721 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
723 {
724  return data.empty();
725 }
726 
727 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
729 {
730  data.clear();
731 }
732 
733 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
735 {
736  data.swap(map.data);
737 }
738 
739 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
741 {
742  return data.key_comp();
743 }
744 
745 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
748 {
749  return data.find(key);
750 }
751 
752 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
755 {
756  return data.find(key);
757 }
758 
759 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
761 {
762  return (data.find(key) != data.end());
763 }
764 
765 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
767 {
768  EntryIterator lb = data.lower_bound(key);
769 
770  if (lb == data.end() || data.key_comp()(key, (*lb).first)) {
771  if (!AllowDefValues)
772  throw Base::ItemNotFound(std::string(getClassName()) + ": key not found");
773 
774  return (*data.insert(lb, Entry(key, getDefaultValue()))).second;
775  }
776 
777  return (*lb).second;
778 }
779 
780 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
782 {
783  EntryIterator it = data.find(key);
784 
785  if (it == data.end())
786  return def_value;
787 
788  return (*it).second;
789 }
790 
791 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
793 {
794  ConstEntryIterator it = data.find(key);
795 
796  if (it == data.end()) {
797  if (!AllowDefValues)
798  throw Base::ItemNotFound(std::string(getClassName()) + ": key not found");
799 
800  return getDefaultValue();
801  }
802 
803  return (*it).second;
804 }
805 
806 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
808  const Value& def_value) const
809 {
810  ConstEntryIterator it = data.find(key);
811 
812  if (it == data.end())
813  return def_value;
814 
815  return (*it).second;
816 }
817 
818 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
820 {
821  return getValue(key);
822 }
823 
824 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
826 {
827  return getValue(key);
828 }
829 
830 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
832 {
833  data.erase(it);
834 }
835 
836 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
838 {
839  return (data.erase(key) > 0);
840 }
841 
842 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
844  const EntryIterator& last)
845 {
846  data.erase(first, last);
847 }
848 
849 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
850 std::pair<typename CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::EntryIterator, bool>
852 {
853  return data.insert(item);
854 }
855 
856 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
857 std::pair<typename CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::EntryIterator, bool>
859 {
860  return data.insert(Entry(key, value));
861 }
862 
863 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
866 {
867  return data.insert(it, item);
868 }
869 
870 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
873  const Value& value)
874 {
875  return data.insert(it, Entry(key, value));
876 }
877 
878 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
881 {
882  EntryIterator lb = data.lower_bound(item.first);
883 
884  if (lb == data.end() || data.key_comp()(item.first, (*lb).first))
885  return data.insert(lb, item);
886 
887  (*lb).second = item.second;
888  return lb;
889 }
890 
891 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
894 {
895  return setEntry(Entry(key, value));
896 }
897 
898 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
899 template <typename InputIter>
900 void CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::insertEntries(const InputIter& first, const InputIter& last)
901 {
902  data.insert(first, last);
903 }
904 
905 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
906 template <typename InputIter>
907 void CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::setEntries(const InputIter& first, const InputIter& last)
908 {
909  for (InputIter it = first; it != last; ++it)
910  setEntry(*it);
911 }
912 
913 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
916 {
917  return data.lower_bound(key);
918 }
919 
920 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
923 {
924  return data.lower_bound(key);
925 }
926 
927 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
930 {
931  return data.upper_bound(key);
932 }
933 
934 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
937 {
938  return data.upper_bound(key);
939 }
940 
941 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
944 {
945  return data.begin();
946 }
947 
948 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
951 {
952  return data.begin();
953 }
954 
955 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
958 {
959  return data.end();
960 }
961 
962 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
965 {
966  return data.end();
967 }
968 
969 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
972 {
973  return data.begin();
974 }
975 
976 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
979 {
980  return data.begin();
981 }
982 
983 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
986 {
987  return data.end();
988 }
989 
990 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
993 {
994  return data.end();
995 }
996 
997 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1000 {
1001  return data.rbegin();
1002 }
1003 
1004 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1007 {
1008  return data.rbegin();
1009 }
1010 
1011 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1014 {
1015  return data.rend();
1016 }
1017 
1018 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1021 {
1022  return data.rend();
1023 }
1024 
1025 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1027 {
1028  return "Map";
1029 }
1030 
1031 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1033 {
1035 }
1036 
1037 // \cond DOC_IMPL_DETAILS
1038 
1039 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1040 bool CDPL::Util::operator==(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1041  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1042 {
1043  return (map1.getData() == map2.getData());
1044 }
1045 
1046 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1047 bool CDPL::Util::operator!=(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1048  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1049 {
1050  return (map1.getData() != map2.getData());
1051 }
1052 
1053 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1054 bool CDPL::Util::operator<=(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1055  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1056 {
1057  return (map1.getData() <= map2.getData());
1058 }
1059 
1060 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1061 bool CDPL::Util::operator>=(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1062  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1063 {
1064  return (map1.getData() >= map2.getData());
1065 }
1066 
1067 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1068 bool CDPL::Util::operator<(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1069  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1070 {
1071  return (map1.getData() < map2.getData());
1072 }
1073 
1074 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1075 bool CDPL::Util::operator>(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1076  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1077 {
1078  return (map1.getData() > map2.getData());
1079 }
1080 
1081 // \endcond
1082 
1083 #endif // CDPL_UTIL_MAP_HPP
Definition of exception classes.
Thrown to indicate that some requested data item could not be found.
Definition: Base/Exceptions.hpp:171
Thrown to indicate that some requested operation has failed (e.g. due to unfulfilled preconditions or...
Definition: Base/Exceptions.hpp:211
A unique sorted associative container that maps keys to values.
Definition: Map.hpp:96
EntryIterator setEntry(const Key &key, const Value &value)
Inserts a new entry or updates the value of an existing entry with the specified key and value.
Definition: Map.hpp:893
const Value & operator[](const Key &key) const
Returns a const reference to the value associated with the specified key.
Definition: Map.hpp:825
EntryIterator getLowerBound(const Key &key)
Returns a mutable iterator pointing to the first entry whose key is not less than key.
Definition: Map.hpp:915
std::pair< EntryIterator, bool > insertEntry(const Entry &item)
Tries to insert the key/value pair item into the map.
Definition: Map.hpp:851
std::pair< EntryIterator, bool > insertEntry(const Key &key, const Value &value)
Tries to insert a new entry with specified key and value into the map.
Definition: Map.hpp:858
KeyCompFunc getKeyCompareFunction() const
Returns the key compare function used by the map.
Definition: Map.hpp:740
virtual const char * getClassName() const
Returns the name of the (derived) Map class.
Definition: Map.hpp:1026
EntryIterator insertEntry(const EntryIterator &it, const Key &key, const Value &value)
Tries to insert a new entry with the specified key and value into the map and uses the iterator it as...
Definition: Map.hpp:872
EntryIterator insertEntry(const EntryIterator &it, const Entry &item)
Tries to insert the key/value pair item into the map and uses the iterator it as a hint for the inser...
Definition: Map.hpp:865
EntryIterator getEntriesBegin()
Returns a mutable iterator pointing to the beginning of the map.
Definition: Map.hpp:950
std::size_t getSize() const
Returns the size (number of entries) of the map.
Definition: Map.hpp:716
void removeEntry(const EntryIterator &it)
Removes the entry pointed to by the iterator it from the map.
Definition: Map.hpp:831
Value & getValue(const Key &key)
Returns a non-const reference to the value associated with the specified key.
Definition: Map.hpp:766
Map(const InputIter &first, const InputIter &last)
Creates and initializes the map with copies of the key value pairs in the range [first,...
Definition: Map.hpp:163
ConstEntryIterator getEntriesBegin() const
Returns a constant iterator pointing to the beginning of the map.
Definition: Map.hpp:943
StorageType & getData()
Returns a non-const reference to the underlying map storage.
Definition: Map.hpp:703
bool isEmpty() const
Tells whether the map is empty (getSize() == 0).
Definition: Map.hpp:722
EntryIterator getUpperBound(const Key &key)
Returns a mutable iterator pointing to the first entry whose key is greater than key.
Definition: Map.hpp:929
void insertEntries(const InputIter &first, const InputIter &last)
Tries to insert the key/value pairs in the range [first, last).
Definition: Map.hpp:900
Map(const InputIter &first, const InputIter &last, const KeyCompFunc &func)
Creates and initializes the map with copies of the key value pairs in the range [first,...
Definition: Map.hpp:175
StorageType::const_reverse_iterator ConstReverseEntryIterator
A constant iterator used to iterate backwards over the entries of the map.
Definition: Map.hpp:132
ReverseEntryIterator getEntriesReverseBegin()
Returns a mutable iterator pointing to the beginning of the reversed map.
Definition: Map.hpp:1006
ConstEntryIterator getLowerBound(const Key &key) const
Returns a constant iterator pointing to the first entry whose key is not less than key.
Definition: Map.hpp:922
StorageType::const_iterator ConstEntryIterator
A constant iterator used to iterate over the entries of the map.
Definition: Map.hpp:127
EntryIterator getEntriesEnd()
Returns a mutable iterator pointing to the end of the map.
Definition: Map.hpp:964
void swap(Map &map)
Swaps the contents with map.
Definition: Map.hpp:734
bool removeEntry(const Key &key)
Removes the entry specified by key from the map.
Definition: Map.hpp:837
ConstEntryIterator end() const
Returns a constant iterator pointing to the end of the map.
Definition: Map.hpp:985
EntryIterator getEntry(const Key &key)
Returns a mutable iterator pointing to the entry specified by key.
Definition: Map.hpp:747
ReverseEntryIterator getEntriesReverseEnd()
Returns a mutable iterator pointing to the end of the reversed map.
Definition: Map.hpp:1020
const StorageType & getData() const
Returns a const reference to the underlying map storage.
Definition: Map.hpp:710
Value & getValue(const Key &key, Value &def_value)
Returns a non-const reference to the value associated with the specified key, or the value given by t...
Definition: Map.hpp:781
const Value & getValue(const Key &key) const
Returns a const reference to the value associated with the specified key.
Definition: Map.hpp:792
Map()
Creates an empty map.
Definition: Map.hpp:147
bool containsEntry(const Key &key) const
Tells whether the map contains an entry with the specified key.
Definition: Map.hpp:760
StorageType::reverse_iterator ReverseEntryIterator
A mutable iterator used to iterate backwards over the entries of the map.
Definition: Map.hpp:142
Map(const KeyCompFunc &func)
Creates an empty map and uses func as key compare function.
Definition: Map.hpp:154
EntryIterator end()
Returns a mutable iterator pointing to the end of the map.
Definition: Map.hpp:992
void clear()
Erases all entries.
Definition: Map.hpp:728
ConstReverseEntryIterator getEntriesReverseBegin() const
Returns a constant iterator pointing to the beginning of the reversed map.
Definition: Map.hpp:999
Value & operator[](const Key &key)
Returns a non-const reference to the value associated with the specified key.
Definition: Map.hpp:819
StorageType::iterator EntryIterator
A mutable iterator used to iterate over the entries of the map.
Definition: Map.hpp:137
ConstEntryIterator begin() const
Returns a constant iterator pointing to the beginning of the map.
Definition: Map.hpp:971
ConstEntryIterator getUpperBound(const Key &key) const
Returns a constant iterator pointing to the first entry whose key is greater than key.
Definition: Map.hpp:936
EntryIterator setEntry(const Entry &item)
Inserts a new entry or updates the value of an existing entry with the key and value given by item.
Definition: Map.hpp:880
const Value & getValue(const Key &key, const Value &def_value) const
Returns a const reference to the value associated with the specified key, or the value given by the s...
Definition: Map.hpp:807
ConstEntryIterator getEntriesEnd() const
Returns a constant iterator pointing to the end of the map.
Definition: Map.hpp:957
ConstReverseEntryIterator getEntriesReverseEnd() const
Returns a constant iterator pointing to the end of the reversed map.
Definition: Map.hpp:1013
std::shared_ptr< Map > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Map instances.
Definition: Map.hpp:104
virtual ~Map()
Virtual destructor.
Definition: Map.hpp:182
Key KeyType
The type of the map's keys.
Definition: Map.hpp:109
void removeEntries(const EntryIterator &first, const EntryIterator &last)
Removes all entries pointed to by the iterators in the range [first, last) from the map.
Definition: Map.hpp:843
void setEntries(const InputIter &first, const InputIter &last)
Inserts new entries or updates the value of existing entries using the key/value pairs in the range [...
Definition: Map.hpp:907
Value ValueType
The type of the mapped values.
Definition: Map.hpp:114
EntryIterator begin()
Returns a mutable iterator pointing to the beginning of the map.
Definition: Map.hpp:978
StorageType::value_type Entry
The type of the key/value pairs stored in the map.
Definition: Map.hpp:122
ConstEntryIterator getEntry(const Key &key) const
Returns a constant iterator pointing to the entry specified by key.
Definition: Map.hpp:754
bool operator<(const Array< ValueType > &array1, const Array< ValueType > &array2)
Less than comparison operator.
bool operator>=(const Array< ValueType > &array1, const Array< ValueType > &array2)
Greater or equal comparison operator.
bool operator>(const Array< ValueType > &array1, const Array< ValueType > &array2)
Greater than comparison operator.
bool operator!=(const Array< ValueType > &array1, const Array< ValueType > &array2)
Inequality comparison operator.
bool operator<=(const Array< ValueType > &array1, const Array< ValueType > &array2)
Less or equal comparison operator.
bool operator==(const Array< ValueType > &array1, const Array< ValueType > &array2)
Equality comparison operator.
The namespace of the Chemical Data Processing Library.
static const ValueType & get()
Definition: Map.hpp:67
Definition: Map.hpp:50
static const ValueType defValue
Definition: Map.hpp:57
static const ValueType & get()
Definition: Map.hpp:52