Chemical Data Processing Library C++ API - Version 1.4.0
Array.hpp
Go to the documentation of this file.
1 /*
2  * Array.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_ARRAY_HPP
30 #define CDPL_UTIL_ARRAY_HPP
31 
32 #include <vector>
33 #include <string>
34 #include <cstddef>
35 #include <utility>
36 #include <memory>
37 
38 #include "CDPL/Base/Exceptions.hpp"
39 #include "CDPL/Util/BitSet.hpp"
40 
41 #ifndef CDPL_UTIL_ARRAY_CHECK_INDEX
42 # ifdef CDPL_UTIL_ARRAY_CHECKS_DISABLE
43 # define CDPL_UTIL_ARRAY_CHECK_INDEX(idx, allow_end)
44 # else // !CDPL_UTIL_ARRAY_CHECKS_DISABLE
45 # define CDPL_UTIL_ARRAY_CHECK_INDEX(idx, allow_end) checkIndex(idx, allow_end)
46 # endif // CDPL_UTIL_ARRAY_CHECKS_DISABLE
47 #endif // !CDPL_UTIL_ARRAY_CHECK_INDEX
48 
49 #ifndef CDPL_UTIL_ARRAY_CHECK_ITER
50 # ifdef CDPL_UTIL_ARRAY_CHECKS_DISABLE
51 # define CDPL_UTIL_ARRAY_CHECK_ITER(it, allow_end)
52 # else // !CDPL_UTIL_ARRAY_CHECKS_DISABLE
53 # define CDPL_UTIL_ARRAY_CHECK_ITER(it, allow_end) checkIterator(it, allow_end)
54 # endif // CDPL_UTIL_ARRAY_CHECKS_DISABLE
55 #endif // !CDPL_UTIL_ARRAY_CHECK_INDEX
56 
57 
58 namespace CDPL
59 {
60 
61  namespace Util
62  {
63 
90  template <typename ValueType>
91  class Array
92  {
93 
94  public:
98  typedef std::vector<ValueType> StorageType;
99 
103  typedef std::shared_ptr<Array> SharedPointer;
104 
108  typedef ValueType ElementType;
109 
113  typedef std::size_t SizeType;
114 
122  typedef Array BaseType;
123 
128  typedef typename StorageType::const_iterator ConstElementIterator;
129 
134  typedef typename StorageType::const_reverse_iterator ConstReverseElementIterator;
135 
140  typedef typename StorageType::iterator ElementIterator;
141 
146  typedef typename StorageType::reverse_iterator ReverseElementIterator;
147 
151  Array():
152  data() {}
153 
159  Array(std::size_t num_elem, const ValueType& value = ValueType()):
160  data(num_elem, value) {}
161 
167  template <typename InputIter>
168  Array(const InputIter& first, const InputIter& last):
169  data(first, last)
170  {}
171 
175  virtual ~Array() {}
176 
182 
187  const StorageType& getData() const;
188 
195 
201  const BaseType& getBase() const;
202 
207  std::size_t getSize() const;
208 
213  std::size_t size() const;
214 
219  bool isEmpty() const;
220 
226  void resize(std::size_t num_elem, const ValueType& value = ValueType());
227 
239  void reserve(std::size_t num_elem);
240 
249  std::size_t getCapacity() const;
250 
254  void clear();
255 
260  void swap(Array& array);
261 
271  void assign(std::size_t num_elem, const ValueType& value = ValueType());
272 
283  template <typename InputIter>
284  void assign(const InputIter& first, const InputIter& last);
285 
290  void addElement(const ValueType& value = ValueType());
291 
298  void insertElement(std::size_t idx, const ValueType& value = ValueType());
299 
306  ElementIterator insertElement(const ElementIterator& it, const ValueType& value = ValueType());
307 
315  void insertElements(std::size_t idx, std::size_t num_elem, const ValueType& value = ValueType());
316 
324  void insertElements(const ElementIterator& it, std::size_t num_elem, const ValueType& value = ValueType());
325 
333  template <typename InputIter>
334  void insertElements(std::size_t idx, const InputIter& first, const InputIter& last);
335 
344  template <typename InputIter>
345  void insertElements(const ElementIterator& it, const InputIter& first, const InputIter& last);
346 
352 
358  void removeElement(std::size_t idx);
359 
368 
379 
385  const ValueType& getFirstElement() const;
386 
392  const ValueType& getLastElement() const;
393 
399  ValueType& getFirstElement();
400 
406  ValueType& getLastElement();
407 
413 
419 
425 
431 
437 
443 
449 
455 
461 
467 
473 
479 
489  const ValueType& getElement(std::size_t idx) const;
490 
500  ValueType& getElement(std::size_t idx);
501 
508  void setElement(std::size_t idx, const ValueType& value = ValueType());
509 
516  const ValueType& operator[](std::size_t idx) const;
517 
524  ValueType& operator[](std::size_t idx);
525 
526  protected:
527  void checkIfNonEmpty() const;
528  void checkIndex(std::size_t idx, bool allow_end) const;
529  void checkIterator(const ElementIterator& it, bool allow_end);
530  void checkIterator(const ConstElementIterator& it, bool allow_end) const;
531 
559  virtual const char* getClassName() const;
560 
561  private:
562  void throwIndexError() const;
563  void throwRangeError() const;
564  void throwOperationFailed() const;
565 
566  StorageType data;
567  };
568 
569 
574 
579 
584 
588  typedef std::pair<std::size_t, std::size_t> STPair;
589 
594 
599 
604 
609 
618  template <typename ValueType>
619  bool operator==(const Array<ValueType>& array1, const Array<ValueType>& array2);
620 
629  template <typename ValueType>
630  bool operator!=(const Array<ValueType>& array1, const Array<ValueType>& array2);
631 
640  template <typename ValueType>
641  bool operator<=(const Array<ValueType>& array1, const Array<ValueType>& array2);
642 
651  template <typename ValueType>
652  bool operator>=(const Array<ValueType>& array1, const Array<ValueType>& array2);
653 
662  template <typename ValueType>
663  bool operator<(const Array<ValueType>& array1, const Array<ValueType>& array2);
664 
673  template <typename ValueType>
674  bool operator>(const Array<ValueType>& array1, const Array<ValueType>& array2);
675 
676  } // namespace Util
677 } // namespace CDPL
678 
679 
680 // Implementation
681 
682 template <typename ValueType>
684 {
685  return data;
686 }
687 
688 template <typename ValueType>
690 {
691  return data;
692 }
693 
694 template <typename ValueType>
696 {
697  return *this;
698 }
699 
700 template <typename ValueType>
702 {
703  return *this;
704 }
705 
706 template <typename ValueType>
708 {
709  return data.size();
710 }
711 
712 template <typename ValueType>
714 {
715  return data.size();
716 }
717 
718 template <typename ValueType>
720 {
721  return data.empty();
722 }
723 
724 template <typename ValueType>
725 void CDPL::Util::Array<ValueType>::resize(std::size_t n, const ValueType& value)
726 {
727  data.resize(n, value);
728 }
729 
730 template <typename ValueType>
732 {
733  return data.capacity();
734 }
735 
736 template <typename ValueType>
737 void CDPL::Util::Array<ValueType>::reserve(std::size_t min_size)
738 {
739  data.reserve(min_size);
740 }
741 
742 template <typename ValueType>
744 {
745  data.clear();
746 }
747 
748 template <typename ValueType>
750 {
751  data.swap(array.data);
752 }
753 
754 template <typename ValueType>
755 void CDPL::Util::Array<ValueType>::assign(std::size_t n, const ValueType& value)
756 {
757  data.assign(n, value);
758 }
759 
760 template <typename ValueType>
761 template <typename InputIter>
762 void CDPL::Util::Array<ValueType>::assign(const InputIter& first, const InputIter& last)
763 {
764  data.assign(first, last);
765 }
766 
767 template <typename ValueType>
768 void CDPL::Util::Array<ValueType>::addElement(const ValueType& value)
769 {
770  data.push_back(value);
771 }
772 
773 template <typename ValueType>
774 void CDPL::Util::Array<ValueType>::insertElement(std::size_t idx, const ValueType& value)
775 {
776  CDPL_UTIL_ARRAY_CHECK_INDEX(idx, true);
777 
778  data.insert(data.begin() + idx, value);
779 }
780 
781 template <typename ValueType>
783  const ValueType& value)
784 {
785  CDPL_UTIL_ARRAY_CHECK_ITER(it, true);
786 
787  return data.insert(it, value);
788 }
789 
790 template <typename ValueType>
791 void CDPL::Util::Array<ValueType>::insertElements(std::size_t idx, std::size_t n, const ValueType& value)
792 {
793  CDPL_UTIL_ARRAY_CHECK_INDEX(idx, true);
794 
795  data.insert(data.begin() + idx, n, value);
796 }
797 
798 template <typename ValueType>
799 void CDPL::Util::Array<ValueType>::insertElements(const ElementIterator& it, std::size_t n, const ValueType& value)
800 {
801  CDPL_UTIL_ARRAY_CHECK_ITER(it, true);
802 
803  data.insert(it, n, value);
804 }
805 
806 template <typename ValueType>
807 template <typename InputIter>
808 void CDPL::Util::Array<ValueType>::insertElements(std::size_t idx, const InputIter& first, const InputIter& last)
809 {
810  CDPL_UTIL_ARRAY_CHECK_INDEX(idx, true);
811 
812  data.insert(data.begin() + idx, first, last);
813 }
814 
815 template <typename ValueType>
816 template <typename InputIter>
817 void CDPL::Util::Array<ValueType>::insertElements(const ElementIterator& it, const InputIter& first, const InputIter& last)
818 {
819  CDPL_UTIL_ARRAY_CHECK_ITER(it, true);
820 
821  data.insert(it, first, last);
822 }
823 
824 template <typename ValueType>
826 {
827  if (data.empty())
828  throw Base::OperationFailed("Array: attempt to pop element from an empty array");
829 
830  data.pop_back();
831 }
832 
833 template <typename ValueType>
835 {
836  CDPL_UTIL_ARRAY_CHECK_INDEX(idx, false);
837 
838  data.erase(data.begin() + idx);
839 }
840 
841 template <typename ValueType>
843 {
844  CDPL_UTIL_ARRAY_CHECK_ITER(it, false);
845 
846  return data.erase(it);
847 }
848 
849 template <typename ValueType>
851  const ElementIterator& last)
852 {
853  CDPL_UTIL_ARRAY_CHECK_ITER(first, true);
854  CDPL_UTIL_ARRAY_CHECK_ITER(last, true);
855 
856  if (first > last)
857  throw Base::RangeError(std::string(getClassName()) + ": invalid iterator range: first > last");
858 
859  return data.erase(first, last);
860 }
861 
862 template <typename ValueType>
864 {
865  checkIfNonEmpty();
866 
867  return data.front();
868 }
869 
870 template <typename ValueType>
872 {
873  checkIfNonEmpty();
874 
875  return data.back();
876 }
877 
878 template <typename ValueType>
880 {
881  checkIfNonEmpty();
882 
883  return data.front();
884 }
885 
886 template <typename ValueType>
888 {
889  checkIfNonEmpty();
890 
891  return data.back();
892 }
893 
894 template <typename ValueType>
896 {
897  return data.begin();
898 }
899 
900 template <typename ValueType>
902 {
903  return data.begin();
904 }
905 
906 template <typename ValueType>
908 {
909  return data.end();
910 }
911 
912 template <typename ValueType>
914 {
915  return data.end();
916 }
917 
918 template <typename ValueType>
920 {
921  return data.begin();
922 }
923 
924 template <typename ValueType>
926 {
927  return data.begin();
928 }
929 
930 template <typename ValueType>
932 {
933  return data.end();
934 }
935 
936 template <typename ValueType>
938 {
939  return data.end();
940 }
941 
942 template <typename ValueType>
944 {
945  return data.rbegin();
946 }
947 
948 template <typename ValueType>
950 {
951  return data.rbegin();
952 }
953 
954 template <typename ValueType>
956 {
957  return data.rend();
958 }
959 
960 template <typename ValueType>
962 {
963  return data.rend();
964 }
965 
966 template <typename ValueType>
967 const ValueType& CDPL::Util::Array<ValueType>::getElement(std::size_t idx) const
968 {
969  CDPL_UTIL_ARRAY_CHECK_INDEX(idx, false);
970 
971  return data[idx];
972 }
973 
974 template <typename ValueType>
975 ValueType& CDPL::Util::Array<ValueType>::getElement(std::size_t idx)
976 {
977  CDPL_UTIL_ARRAY_CHECK_INDEX(idx, false);
978 
979  return data[idx];
980 }
981 
982 template <typename ValueType>
983 void CDPL::Util::Array<ValueType>::setElement(std::size_t idx, const ValueType& value)
984 {
985  CDPL_UTIL_ARRAY_CHECK_INDEX(idx, false);
986 
987  data[idx] = value;
988 }
989 
990 template <typename ValueType>
991 const ValueType& CDPL::Util::Array<ValueType>::operator[](std::size_t idx) const
992 {
993  CDPL_UTIL_ARRAY_CHECK_INDEX(idx, false);
994 
995  return data[idx];
996 }
997 
998 template <typename ValueType>
999 ValueType& CDPL::Util::Array<ValueType>::operator[](std::size_t idx)
1000 {
1001  CDPL_UTIL_ARRAY_CHECK_INDEX(idx, false);
1002 
1003  return data[idx];
1004 }
1005 
1006 template <typename ValueType>
1008 {
1009  if (data.empty())
1010  throwOperationFailed();
1011 }
1012 
1013 template <typename ValueType>
1014 void CDPL::Util::Array<ValueType>::checkIndex(std::size_t idx, bool allow_end) const
1015 {
1016  if ((allow_end && idx > data.size()) || (!allow_end && idx >= data.size()))
1017  throwIndexError();
1018 }
1019 
1020 template <typename ValueType>
1022 {
1023  if (it < data.begin() || (allow_end && it > data.end()) || (!allow_end && it >= data.end()))
1024  throwRangeError();
1025 }
1026 
1027 template <typename ValueType>
1029 {
1030  if (it < data.begin() || (allow_end && it > data.end()) || (!allow_end && it >= data.end()))
1031  throwRangeError();
1032 }
1033 
1034 template <typename ValueType>
1036 {
1037  throw Base::IndexError(std::string(getClassName()) + ": element index out of bounds");
1038 }
1039 
1040 template <typename ValueType>
1042 {
1043  throw Base::RangeError(std::string(getClassName()) + ": invalid iterator");
1044 }
1045 
1046 template <typename ValueType>
1048 {
1049  throw Base::OperationFailed(std::string(getClassName()) + ": operation requires non-empty array");
1050 }
1051 
1052 template <typename ValueType>
1054 {
1055  return "Array";
1056 }
1057 
1058 // \cond DOC_IMPL_DETAILS
1059 
1060 template <typename ValueType>
1061 bool CDPL::Util::operator==(const Array<ValueType>& array1, const Array<ValueType>& array2)
1062 {
1063  return (array1.getData() == array2.getData());
1064 }
1065 
1066 template <typename ValueType>
1067 bool CDPL::Util::operator!=(const Array<ValueType>& array1, const Array<ValueType>& array2)
1068 {
1069  return (array1.getData() != array2.getData());
1070 }
1071 
1072 template <typename ValueType>
1073 bool CDPL::Util::operator<=(const Array<ValueType>& array1, const Array<ValueType>& array2)
1074 {
1075  return (array1.getData() <= array2.getData());
1076 }
1077 
1078 template <typename ValueType>
1079 bool CDPL::Util::operator>=(const Array<ValueType>& array1, const Array<ValueType>& array2)
1080 {
1081  return (array1.getData() >= array2.getData());
1082 }
1083 
1084 template <typename ValueType>
1085 bool CDPL::Util::operator<(const Array<ValueType>& array1, const Array<ValueType>& array2)
1086 {
1087  return (array1.getData() < array2.getData());
1088 }
1089 
1090 template <typename ValueType>
1091 bool CDPL::Util::operator>(const Array<ValueType>& array1, const Array<ValueType>& array2)
1092 {
1093  return (array1.getData() > array2.getData());
1094 }
1095 
1096 // \endcond
1097 
1098 #endif // CDPL_UTIL_ARRAY_HPP
#define CDPL_UTIL_ARRAY_CHECK_ITER(it, allow_end)
Definition: Array.hpp:53
#define CDPL_UTIL_ARRAY_CHECK_INDEX(idx, allow_end)
Definition: Array.hpp:45
Definition of exception classes.
Declaration of type CDPL::Util::BitSet.
Thrown to indicate that an index is out of range.
Definition: Base/Exceptions.hpp:152
Thrown to indicate that some requested operation has failed (e.g. due to unfulfilled preconditions or...
Definition: Base/Exceptions.hpp:211
Thrown to indicate that a value is out of range.
Definition: Base/Exceptions.hpp:114
Dynamic array class providing amortized constant time access to arbitrary elements.
Definition: Array.hpp:92
Array(std::size_t num_elem, const ValueType &value=ValueType())
Creates and initializes the array with num_elem copies of value.
Definition: Array.hpp:159
ValueType ElementType
The type of objects stored by the array.
Definition: Array.hpp:108
std::size_t size() const
Returns the number of elements stored in the array.
Definition: Array.hpp:713
void clear()
Erases all elements.
Definition: Array.hpp:743
virtual const char * getClassName() const
Returns the name of the (derived) array class.
Definition: Array.hpp:1053
StorageType::const_iterator ConstElementIterator
A constant random access iterator used to iterate over the elements of the array.
Definition: Array.hpp:128
StorageType::const_reverse_iterator ConstReverseElementIterator
A constant random access iterator used to iterate over the elements of the array in reverse order.
Definition: Array.hpp:134
StorageType::reverse_iterator ReverseElementIterator
A mutable random access iterator used to iterate over the elements of the array in reverse order.
Definition: Array.hpp:146
void reserve(std::size_t num_elem)
Preallocates memory for (at least) num_elem elements.
Definition: Array.hpp:737
ReverseElementIterator getElementsReverseBegin()
Returns a mutable iterator pointing to the beginning of the reversed array.
Definition: Array.hpp:949
Array(const InputIter &first, const InputIter &last)
Creates and initializes the array with copies of the elements in the range [first,...
Definition: Array.hpp:168
ElementIterator end()
Returns a mutable iterator pointing to the end of the array.
Definition: Array.hpp:937
ConstElementIterator getElementsEnd() const
Returns a constant iterator pointing to the end of the array.
Definition: Array.hpp:907
void checkIndex(std::size_t idx, bool allow_end) const
Definition: Array.hpp:1014
void checkIterator(const ConstElementIterator &it, bool allow_end) const
Definition: Array.hpp:1028
std::size_t getCapacity() const
Returns the number of elements for which memory has been allocated.
Definition: Array.hpp:731
BaseType & getBase()
Returns a non-const reference to itself.
Definition: Array.hpp:695
ConstElementIterator begin() const
Returns a constant iterator pointing to the beginning of the array.
Definition: Array.hpp:919
ConstReverseElementIterator getElementsReverseBegin() const
Returns a constant iterator pointing to the beginning of the reversed array.
Definition: Array.hpp:943
std::vector< ValueType > StorageType
The type of the std::vector used for the internal storage of the array elements.
Definition: Array.hpp:98
const StorageType & getData() const
Returns a const reference to the underlying array storage.
Definition: Array.hpp:689
ElementIterator begin()
Returns a mutable iterator pointing to the beginning of the array.
Definition: Array.hpp:925
void checkIterator(const ElementIterator &it, bool allow_end)
Definition: Array.hpp:1021
StorageType::iterator ElementIterator
A mutable random access iterator used to iterate over the elements of the array.
Definition: Array.hpp:140
void assign(std::size_t num_elem, const ValueType &value=ValueType())
This function fills the array with num_elem copies of the given value.
Definition: Array.hpp:755
void checkIfNonEmpty() const
Definition: Array.hpp:1007
ValueType & operator[](std::size_t idx)
Returns a non-const reference to the element at index idx.
Definition: Array.hpp:999
void removeElement(std::size_t idx)
Removes the element at the position specified by the index idx.
Definition: Array.hpp:834
Array BaseType
Specifies for derived classes the type of the Array base class.
Definition: Array.hpp:122
virtual ~Array()
Virtual destructor.
Definition: Array.hpp:175
ConstElementIterator getElementsBegin() const
Returns a constant iterator pointing to the beginning of the array.
Definition: Array.hpp:895
ConstElementIterator end() const
Returns a constant iterator pointing to the end of the array.
Definition: Array.hpp:931
ValueType & getElement(std::size_t idx)
Returns a non-const reference to the element at index idx.
Definition: Array.hpp:975
const BaseType & getBase() const
Returns a const reference to itself.
Definition: Array.hpp:701
const ValueType & operator[](std::size_t idx) const
Returns a const reference to the element at index idx.
Definition: Array.hpp:991
std::size_t SizeType
An unsigned integral type used to represent sizes and indices.
Definition: Array.hpp:113
bool isEmpty() const
Tells whether the array is empty (getSize() == 0).
Definition: Array.hpp:719
void insertElement(std::size_t idx, const ValueType &value=ValueType())
Inserts a new element before the location specified by the index idx.
Definition: Array.hpp:774
void popLastElement()
Removes the last element of the array.
Definition: Array.hpp:825
const ValueType & getLastElement() const
Returns a const reference to the last element of the array.
Definition: Array.hpp:871
void setElement(std::size_t idx, const ValueType &value=ValueType())
Assigns a new value to the element specified by the index idx.
Definition: Array.hpp:983
void insertElements(std::size_t idx, std::size_t num_elem, const ValueType &value=ValueType())
Inserts num_elem copies of value before the location specified by the index idx.
Definition: Array.hpp:791
ElementIterator removeElements(const ElementIterator &first, const ElementIterator &last)
Removes the elements pointed to by the iterators in the range [first, last).
Definition: Array.hpp:850
Array()
Creates an empty array.
Definition: Array.hpp:151
std::size_t getSize() const
Returns the number of elements stored in the array.
Definition: Array.hpp:707
void assign(const InputIter &first, const InputIter &last)
This function fills a vector with copies of the elements in the range [first, last).
Definition: Array.hpp:762
const ValueType & getElement(std::size_t idx) const
Returns a const reference to the element at index idx.
Definition: Array.hpp:967
ElementIterator getElementsEnd()
Returns a mutable iterator pointing to the end of the array.
Definition: Array.hpp:913
void resize(std::size_t num_elem, const ValueType &value=ValueType())
Inserts or erases elements at the end so that the size becomes num_elem.
Definition: Array.hpp:725
ConstReverseElementIterator getElementsReverseEnd() const
Returns a constant iterator pointing to the end of the reversed array.
Definition: Array.hpp:955
ValueType & getFirstElement()
Returns a non-const reference to the first element of the array.
Definition: Array.hpp:879
std::shared_ptr< Array > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Array instances.
Definition: Array.hpp:103
ValueType & getLastElement()
Returns a non-const reference to the last element of the array.
Definition: Array.hpp:887
ReverseElementIterator getElementsReverseEnd()
Returns a mutable iterator pointing to the end of the reversed array.
Definition: Array.hpp:961
StorageType & getData()
Returns a non-const reference to the underlying array storage.
Definition: Array.hpp:683
const ValueType & getFirstElement() const
Returns a const reference to the first element of the array.
Definition: Array.hpp:863
void addElement(const ValueType &value=ValueType())
Inserts a new element at the end of the array.
Definition: Array.hpp:768
void swap(Array &array)
Swaps the contents with array.
Definition: Array.hpp:749
ElementIterator getElementsBegin()
Returns a mutable iterator pointing to the beginning of the array.
Definition: Array.hpp:901
boost::transform_iterator< DerefFunc, typename BaseType::ElementIterator, ValueType & > ElementIterator
A mutable random access iterator used to iterate over the pointed-to objects.
Definition: IndirectArray.hpp:114
Array< double > DArray
Array storing floating-point values of type double.
Definition: Array.hpp:598
Array< std::size_t > STArray
Array storing unsigned integers of type std::size_t.
Definition: Array.hpp:578
Array< long > LArray
Array storing integers of type long.
Definition: Array.hpp:583
bool operator<(const Array< ValueType > &array1, const Array< ValueType > &array2)
Less than comparison operator.
Array< unsigned int > UIArray
Array storing unsigned integers of type unsigned int.
Definition: Array.hpp:573
bool operator>=(const Array< ValueType > &array1, const Array< ValueType > &array2)
Greater or equal comparison operator.
Array< BitSet > BitSetArray
Array storing Util::BitSet objects.
Definition: Array.hpp:608
bool operator>(const Array< ValueType > &array1, const Array< ValueType > &array2)
Greater than comparison operator.
Array< STPair > STPairArray
Array storing pairs of unsigned integers of type std::size_t.
Definition: Array.hpp:593
Array< std::string > SArray
Array storing std::string objects.
Definition: Array.hpp:603
bool operator!=(const Array< ValueType > &array1, const Array< ValueType > &array2)
Inequality comparison operator.
std::pair< std::size_t, std::size_t > STPair
Pair of unsigned integers of type std::size_t.
Definition: Array.hpp:588
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.