Chemical Data Processing Library C++ API - Version 1.1.1
Vector.hpp
Go to the documentation of this file.
1 /*
2  * Vector.hpp
3  *
4  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
27 #ifndef CDPL_MATH_VECTOR_HPP
28 #define CDPL_MATH_VECTOR_HPP
29 
30 #include <cstddef>
31 #include <algorithm>
32 #include <vector>
33 #include <limits>
34 #include <utility>
35 #include <unordered_map>
36 #include <type_traits>
37 #include <initializer_list>
38 #include <memory>
39 
40 #include "CDPL/Math/Check.hpp"
44 #include "CDPL/Math/Functional.hpp"
45 #include "CDPL/Math/TypeTraits.hpp"
47 #include "CDPL/Base/Exceptions.hpp"
48 
49 
50 namespace CDPL
51 {
52 
53  namespace Math
54  {
55 
56  template <typename V>
57  class VectorReference : public VectorExpression<VectorReference<V> >
58  {
59 
61 
62  public:
63  typedef V VectorType;
64  typedef typename V::ValueType ValueType;
65  typedef typename std::conditional<std::is_const<V>::value,
66  typename V::ConstReference,
67  typename V::Reference>::type Reference;
68  typedef typename V::ConstReference ConstReference;
69  typedef typename V::SizeType SizeType;
70  typedef typename V::DifferenceType DifferenceType;
72  typedef const SelfType ConstClosureType;
73 
75  data(v) {}
76 
78  {
79  return data[i];
80  }
81 
83  {
84  return data[i];
85  }
86 
88  {
89  return data(i);
90  }
91 
93  {
94  return data(i);
95  }
96 
97  SizeType getSize() const
98  {
99  return data.getSize();
100  }
101 
103  {
104  return data.getMaxSize();
105  }
106 
107  bool isEmpty() const
108  {
109  return data.isEmpty();
110  }
111 
112  const VectorType& getData() const
113  {
114  return data;
115  }
116 
118  {
119  return data;
120  }
121 
123  {
124  data.operator=(r.data);
125  return *this;
126  }
127 
128  template <typename E>
130  {
131  data.operator=(e);
132  return *this;
133  }
134 
135  template <typename E>
137  {
138  data.operator+=(e);
139  return *this;
140  }
141 
142  template <typename E>
144  {
145  data.operator-=(e);
146  return *this;
147  }
148 
149  template <typename T>
150  typename std::enable_if<IsScalar<T>::value, VectorReference>::type& operator*=(const T& t)
151  {
152  data.operator*=(t);
153  return *this;
154  }
155 
156  template <typename T>
157  typename std::enable_if<IsScalar<T>::value, VectorReference>::type& operator/=(const T& t)
158  {
159  data.operator/=(t);
160  return *this;
161  }
162 
163  template <typename E>
165  {
166  data.assign(e);
167  return *this;
168  }
169 
170  template <typename E>
172  {
173  data.plusAssign(e);
174  return *this;
175  }
176 
177  template <typename E>
179  {
180  data.minusAssign(e);
181  return *this;
182  }
183 
185  {
186  data.swap(r.data);
187  }
188 
189  friend void swap(VectorReference& r1, VectorReference& r2)
190  {
191  r1.swap(r2);
192  }
193 
194  private:
195  VectorType& data;
196  };
197 
198  template <typename T, typename A>
199  class Vector;
200 
201  template <typename T>
202  class InitListVector : public VectorContainer<InitListVector<T> >
203  {
204 
205  public:
207  typedef std::initializer_list<T> InitializerListType;
208  typedef typename InitializerListType::value_type ValueType;
209  typedef typename InitializerListType::const_reference ConstReference;
210  typedef typename InitializerListType::reference Reference;
211  typedef typename InitializerListType::size_type SizeType;
212  typedef typename std::ptrdiff_t DifferenceType;
214  typedef const SelfType ConstClosureType;
216 
218  list(l) {}
219 
221  {
222  return this->operator()(i);
223  }
224 
226  {
227  return this->operator()(i);
228  }
229 
231  {
232  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
233  return *(list.begin() + i);
234  }
235 
237  {
238  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
239  return *(list.begin() + i);
240  }
241 
243  {
244  return list.size();
245  }
246 
247  bool isEmpty() const
248  {
249  return (list.size() == 0);
250  }
251 
252  private:
253  InitializerListType list;
254  };
255 
256  template <typename T, typename A = std::vector<T> >
257  class Vector : public VectorContainer<Vector<T, A> >
258  {
259 
260  typedef Vector<T, A> SelfType;
261 
262  public:
263  typedef T ValueType;
264  typedef T& Reference;
265  typedef const T& ConstReference;
266  typedef typename A::size_type SizeType;
267  typedef typename A::difference_type DifferenceType;
268  typedef A ArrayType;
269  typedef T* Pointer;
270  typedef const T* ConstPointer;
274  typedef std::shared_ptr<SelfType> SharedPointer;
275  typedef std::initializer_list<T> InitializerListType;
276 
278  data() {}
279 
280  explicit Vector(SizeType n):
281  data(storageSize(n)) {}
282 
283  Vector(SizeType n, const ValueType& v):
284  data(storageSize(n), v) {}
285 
286  Vector(const ArrayType& data):
287  data(data) {}
288 
289  Vector(const Vector& v):
290  data(v.data) {}
291 
293  data(std::move(v.data)) {}
294 
296  data(l) {}
297 
298  template <typename E>
300  data(storageSize(e().getSize()))
301  {
302  vectorAssignVector<ScalarAssignment>(*this, e);
303  }
304 
306  {
307  return this->operator()(i);
308  }
309 
311  {
312  return this->operator()(i);
313  }
314 
316  {
317  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
318  return data[i];
319  }
320 
322  {
323  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
324  return data[i];
325  }
326 
327  bool isEmpty() const
328  {
329  return data.empty();
330  }
331 
333  {
334  return data.size();
335  }
336 
338  {
339  return data.max_size();
340  }
341 
343  {
344  return data;
345  }
346 
347  const ArrayType& getData() const
348  {
349  return data;
350  }
351 
353  {
354  data = v.data;
355  return *this;
356  }
357 
359  {
360  data = std::move(v.data);
361  return *this;
362  }
363 
365  {
366  return assign(l);
367  }
368 
369  template <typename C>
371  {
372  return assign(c);
373  }
374 
375  template <typename E>
377  {
378  Vector tmp(e);
379  swap(tmp);
380  return *this;
381  }
382 
383  template <typename C>
385  {
386  return plusAssign(c);
387  }
388 
390  {
391  return plusAssign(l);
392  }
393 
394  template <typename E>
396  {
397  Vector tmp(*this + e);
398  swap(tmp);
399  return *this;
400  }
401 
402  template <typename C>
404  {
405  return minusAssign(c);
406  }
407 
409  {
410  return minusAssign(l);
411  }
412 
413  template <typename E>
415  {
416  Vector tmp(*this - e);
417  swap(tmp);
418  return *this;
419  }
420 
421  template <typename T1>
422  typename std::enable_if<IsScalar<T1>::value, Vector>::type& operator*=(const T1& t)
423  {
424  vectorAssignScalar<ScalarMultiplicationAssignment>(*this, t);
425  return *this;
426  }
427 
428  template <typename T1>
429  typename std::enable_if<IsScalar<T1>::value, Vector>::type& operator/=(const T1& t)
430  {
431  vectorAssignScalar<ScalarDivisionAssignment>(*this, t);
432  return *this;
433  }
434 
435  template <typename E>
437  {
438  resize(e().getSize());
439  vectorAssignVector<ScalarAssignment>(*this, e);
440  return *this;
441  }
442 
444  {
445  data = l;
446  return *this;
447  }
448 
449  template <typename E>
451  {
452  vectorAssignVector<ScalarAdditionAssignment>(*this, e);
453  return *this;
454  }
455 
457  {
458  vectorAssignVector<ScalarAdditionAssignment>(*this, InitListVector<ValueType>(l));
459  return *this;
460  }
461 
462  template <typename E>
464  {
465  vectorAssignVector<ScalarSubtractionAssignment>(*this, e);
466  return *this;
467  }
468 
470  {
471  vectorAssignVector<ScalarSubtractionAssignment>(*this, InitListVector<ValueType>(l));
472  return *this;
473  }
474 
475  void swap(Vector& v)
476  {
477  if (this != &v)
478  std::swap(data, v.data);
479  }
480 
481  friend void swap(Vector& v1, Vector& v2)
482  {
483  v1.swap(v2);
484  }
485 
486  void clear(const ValueType& v = ValueType())
487  {
488  std::fill(data.begin(), data.end(), v);
489  }
490 
491  void resize(SizeType n, const ValueType& v = ValueType())
492  {
493  data.resize(storageSize(n), v);
494  }
495 
496  private:
497  SizeType storageSize(SizeType n)
498  {
499  return CDPL_MATH_CHECK_MAX_SIZE(n, data.max_size(), Base::SizeError);
500  }
501 
502  ArrayType data;
503  };
504 
505  template <typename T, typename A = std::unordered_map<std::size_t, T> >
506  class SparseVector : public VectorContainer<SparseVector<T, A> >
507  {
508 
509  typedef SparseVector<T> SelfType;
510 
511  public:
512  typedef T ValueType;
513  typedef std::size_t SizeType;
514  typedef std::ptrdiff_t DifferenceType;
515  typedef typename A::key_type KeyType;
516  typedef const T& ConstReference;
518  typedef A ArrayType;
519  typedef T* Pointer;
520  typedef const T* ConstPointer;
524  typedef std::shared_ptr<SelfType> SharedPointer;
525  typedef std::initializer_list<T> InitializerListType;
526 
528  data(), size(0) {}
529 
530  explicit SparseVector(SizeType n):
531  data(), size(storageSize(n)) {}
532 
534  data(v.data), size(v.size) {}
535 
537  data(), size(0)
538  {
539  swap(v);
540  }
541 
543  {
544  assign(l);
545  }
546 
547  template <typename E>
549  data(), size(0)
550  {
551  assign(e);
552  }
553 
555  {
556  return this->operator()(i);
557  }
558 
560  {
561  return this->operator()(i);
562  }
563 
565  {
566  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
567  return Reference(*this, i);
568  }
569 
571  {
572  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
573 
574  typename ArrayType::const_iterator it = data.find(i);
575 
576  if (it == data.end())
577  return zero;
578 
579  return it->second;
580  }
581 
583  {
584  return data.size();
585  }
586 
587  bool isEmpty() const
588  {
589  return (size == 0);
590  }
591 
593  {
594  return size;
595  }
596 
598  {
599  return std::min(SizeType(data.max_size()), std::numeric_limits<SizeType>::max());
600  }
601 
603  {
604  return data;
605  }
606 
607  const ArrayType& getData() const
608  {
609  return data;
610  }
611 
613  {
614  data = v.data;
615  size = v.size;
616  return *this;
617  }
618 
620  {
621  swap(v);
622  return *this;
623  }
624 
626  {
627  return assign(l);
628  }
629 
630  template <typename C>
632  {
633  return assign(c);
634  }
635 
636  template <typename E>
638  {
639  SparseVector tmp(e);
640  swap(tmp);
641  return *this;
642  }
643 
644  template <typename C>
646  {
647  return plusAssign(c);
648  }
649 
651  {
652  return plusAssign(l);
653  }
654 
655  template <typename E>
657  {
658  SparseVector tmp(*this + e);
659  swap(tmp);
660  return *this;
661  }
662 
663  template <typename C>
665  {
666  return minusAssign(c);
667  }
668 
670  {
671  return minusAssign(l);
672  }
673 
674  template <typename E>
676  {
677  SparseVector tmp(*this - e);
678  swap(tmp);
679  return *this;
680  }
681 
682  template <typename T1>
683  typename std::enable_if<IsScalar<T1>::value, SparseVector>::type& operator*=(const T1& t)
684  {
685  vectorAssignScalar<ScalarMultiplicationAssignment>(*this, t);
686  return *this;
687  }
688 
689  template <typename T1>
690  typename std::enable_if<IsScalar<T1>::value, SparseVector>::type& operator/=(const T1& t)
691  {
692  vectorAssignScalar<ScalarDivisionAssignment>(*this, t);
693  return *this;
694  }
695 
696  template <typename E>
698  {
699  resize(e().getSize());
700  vectorAssignVector<ScalarAssignment>(*this, e);
701  return *this;
702  }
703 
705  {
706  resize(l.size());
707  vectorAssignVector<ScalarAssignment>(*this, InitListVector<ValueType>(l));
708  return *this;
709  }
710 
711  template <typename E>
713  {
714  vectorAssignVector<ScalarAdditionAssignment>(*this, e);
715  return *this;
716  }
717 
719  {
720  vectorAssignVector<ScalarAdditionAssignment>(*this, InitListVector<ValueType>(l));
721  return *this;
722  }
723 
724  template <typename E>
726  {
727  vectorAssignVector<ScalarSubtractionAssignment>(*this, e);
728  return *this;
729  }
730 
732  {
733  vectorAssignVector<ScalarSubtractionAssignment>(*this, InitListVector<ValueType>(l));
734  return *this;
735  }
736 
738  {
739  if (this != &v) {
740  std::swap(data, v.data);
741  std::swap(size, v.size);
742  }
743  }
744 
745  friend void swap(SparseVector& v1, SparseVector& v2)
746  {
747  v1.swap(v2);
748  }
749 
750  void clear()
751  {
752  data.clear();
753  }
754 
755  void resize(SizeType n)
756  {
757  n = storageSize(n);
758 
759  for (typename ArrayType::iterator it = data.begin(); it != data.end();) {
760  if (it->first >= n)
761  it = data.erase(it);
762  else
763  ++it;
764  }
765 
766  size = n;
767  }
768 
769  private:
770  SizeType storageSize(SizeType n)
771  {
773  }
774 
775  ArrayType data;
776  SizeType size;
777  static const ValueType zero;
778  };
779 
780  template <typename T, typename A>
781  const typename SparseVector<T, A>::ValueType SparseVector<T, A>::zero = SparseVector<T, A>::ValueType();
782 
783  template <typename T, std::size_t N>
784  class BoundedVector : public VectorContainer<BoundedVector<T, N> >
785  {
786 
788 
789  public:
790  typedef T ValueType;
791  typedef T& Reference;
792  typedef const T& ConstReference;
793  typedef std::size_t SizeType;
794  typedef std::ptrdiff_t DifferenceType;
796  typedef T* Pointer;
797  typedef const T* ConstPointer;
801  typedef std::shared_ptr<SelfType> SharedPointer;
802  typedef std::initializer_list<T> InitializerListType;
803 
804  static const SizeType MaxSize = N;
805 
807  size(0) {}
808 
809  explicit BoundedVector(SizeType n):
810  size(0)
811  {
812  resize(n);
813  }
814 
816  size(0)
817  {
818  resize(n, v);
819  }
820 
822  size(v.size)
823  {
824  std::copy(v.data, v.data + v.size, data);
825  }
826 
828  {
829  assign(l);
830  }
831 
832  template <typename E>
834  size(0)
835  {
836  assign(e);
837  }
838 
840  {
841  return this->operator()(i);
842  }
843 
845  {
846  return this->operator()(i);
847  }
848 
850  {
851  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
852  return data[i];
853  }
854 
856  {
857  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
858  return data[i];
859  }
860 
861  bool isEmpty() const
862  {
863  return (size == 0);
864  }
865 
867  {
868  return size;
869  }
870 
872  {
873  return N;
874  }
875 
877  {
878  return data;
879  }
880 
882  {
883  return data;
884  }
885 
887  {
888  if (this != &v) {
889  std::copy(v.data, v.data + v.size, data);
890  size = v.size;
891  }
892 
893  return *this;
894  }
895 
897  {
898  return assign(l);
899  }
900 
901  template <typename C>
903  {
904  return assign(c);
905  }
906 
907  template <typename E>
909  {
910  BoundedVector tmp(e);
911  return this-> operator=(tmp);
912  }
913 
914  template <typename C>
916  {
917  return plusAssign(c);
918  }
919 
921  {
922  return plusAssign(l);
923  }
924 
925  template <typename E>
927  {
928  BoundedVector tmp(*this + e);
929  return this-> operator=(tmp);
930  }
931 
932  template <typename C>
934  {
935  return minusAssign(c);
936  }
937 
939  {
940  return minusAssign(l);
941  }
942 
943  template <typename E>
945  {
946  BoundedVector tmp(*this - e);
947  return this-> operator=(tmp);
948  }
949 
950  template <typename T1>
951  typename std::enable_if<IsScalar<T1>::value, BoundedVector>::type& operator*=(const T1& t)
952  {
953  vectorAssignScalar<ScalarMultiplicationAssignment>(*this, t);
954  return *this;
955  }
956 
957  template <typename T1>
958  typename std::enable_if<IsScalar<T1>::value, BoundedVector>::type& operator/=(const T1& t)
959  {
960  vectorAssignScalar<ScalarDivisionAssignment>(*this, t);
961  return *this;
962  }
963 
964  template <typename E>
966  {
967  resize(e().getSize());
968  vectorAssignVector<ScalarAssignment>(*this, e);
969  return *this;
970  }
971 
973  {
974  resize(l.size());
975  std::copy(l.begin(), l.begin() + size, data);
976  return *this;
977  }
978 
979  template <typename E>
981  {
982  vectorAssignVector<ScalarAdditionAssignment>(*this, e);
983  return *this;
984  }
985 
987  {
988  vectorAssignVector<ScalarAdditionAssignment>(*this, InitListVector<ValueType>(l));
989  return *this;
990  }
991 
992  template <typename E>
994  {
995  vectorAssignVector<ScalarSubtractionAssignment>(*this, e);
996  return *this;
997  }
998 
1000  {
1001  vectorAssignVector<ScalarSubtractionAssignment>(*this, InitListVector<ValueType>(l));
1002  return *this;
1003  }
1004 
1006  {
1007  if (this != &v) {
1008  std::swap_ranges(data, data + std::max(size, v.size), v.data);
1009  std::swap(size, v.size);
1010  }
1011  }
1012 
1013  friend void swap(BoundedVector& v1, BoundedVector& v2)
1014  {
1015  v1.swap(v2);
1016  }
1017 
1018  void clear(const ValueType& v = ValueType())
1019  {
1020  std::fill(data, data + size, v);
1021  }
1022 
1024  {
1025  size = storageSize(n);
1026  }
1027 
1028  void resize(SizeType n, const ValueType& v)
1029  {
1030  n = storageSize(n);
1031 
1032  if (n > size)
1033  std::fill(data + size, data + n, v);
1034 
1035  size = n;
1036  }
1037 
1038  private:
1039  SizeType storageSize(SizeType n)
1040  {
1042  }
1043 
1044  ArrayType data;
1045  SizeType size;
1046  };
1047 
1048  template <typename T, std::size_t N>
1050 
1051  template <typename T, std::size_t N>
1052  class CVector : public VectorContainer<CVector<T, N> >
1053  {
1054 
1055  typedef CVector<T, N> SelfType;
1056 
1057  public:
1058  typedef T ValueType;
1059  typedef T& Reference;
1060  typedef const T& ConstReference;
1061  typedef std::size_t SizeType;
1062  typedef std::ptrdiff_t DifferenceType;
1064  typedef T* Pointer;
1065  typedef const T* ConstPointer;
1069  typedef std::shared_ptr<SelfType> SharedPointer;
1070  typedef std::initializer_list<T> InitializerListType;
1071 
1072  static const SizeType Size = N;
1073 
1075  {
1076  clear();
1077  }
1078 
1079  explicit CVector(const ValueType& v)
1080  {
1081  clear(v);
1082  }
1083 
1084  CVector(const CVector& v)
1085  {
1086  std::copy(v.data, v.data + N, data);
1087  }
1088 
1090  {
1091  assign(l);
1092  }
1093 
1094  template <typename E>
1096  {
1097  vectorAssignVector<ScalarAssignment>(*this, e);
1098  }
1099 
1101  {
1102  return this->operator()(i);
1103  }
1104 
1106  {
1107  return this->operator()(i);
1108  }
1109 
1111  {
1112  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
1113  return data[i];
1114  }
1115 
1117  {
1118  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
1119  return data[i];
1120  }
1121 
1122  bool isEmpty() const
1123  {
1124  return (N == 0);
1125  }
1126 
1128  {
1129  return N;
1130  }
1131 
1133  {
1134  return N;
1135  }
1136 
1138  {
1139  return data;
1140  }
1141 
1143  {
1144  return data;
1145  }
1146 
1148  {
1149  if (this != &v)
1150  std::copy(v.data, v.data + N, data);
1151 
1152  return *this;
1153  }
1154 
1156  {
1157  return assign(l);
1158  }
1159 
1160  template <typename C>
1162  {
1163  return assign(c);
1164  }
1165 
1166  template <typename E>
1168  {
1169  CVector tmp(e);
1170  return this->operator=(tmp);
1171  }
1172 
1173  template <typename C>
1175  {
1176  return plusAssign(c);
1177  }
1178 
1180  {
1181  return plusAssign(l);
1182  }
1183 
1184  template <typename E>
1186  {
1187  CVector tmp(*this + e);
1188  return this->operator=(tmp);
1189  }
1190 
1191  template <typename C>
1193  {
1194  return minusAssign(c);
1195  }
1196 
1198  {
1199  return minusAssign(l);
1200  }
1201 
1202  template <typename E>
1204  {
1205  CVector tmp(*this - e);
1206  return this->operator=(tmp);
1207  }
1208 
1209  template <typename T1>
1210  typename std::enable_if<IsScalar<T1>::value, CVector>::type& operator*=(const T1& t)
1211  {
1212  vectorAssignScalar<ScalarMultiplicationAssignment>(*this, t);
1213  return *this;
1214  }
1215 
1216  template <typename T1>
1217  typename std::enable_if<IsScalar<T1>::value, CVector>::type& operator/=(const T1& t)
1218  {
1219  vectorAssignScalar<ScalarDivisionAssignment>(*this, t);
1220  return *this;
1221  }
1222 
1223  template <typename E>
1225  {
1226  vectorAssignVector<ScalarAssignment>(*this, e);
1227  return *this;
1228  }
1229 
1231  {
1233  std::copy(l.begin(), l.begin() + n, data);
1234 
1235  if (n < N)
1236  std::fill(data + n, data + N, ValueType());
1237 
1238  return *this;
1239  }
1240 
1241  template <typename E>
1243  {
1244  vectorAssignVector<ScalarAdditionAssignment>(*this, e);
1245  return *this;
1246  }
1247 
1249  {
1250  vectorAssignVector<ScalarAdditionAssignment>(*this, InitListVector<ValueType>(l));
1251  return *this;
1252  }
1253 
1254  template <typename E>
1256  {
1257  vectorAssignVector<ScalarSubtractionAssignment>(*this, e);
1258  return *this;
1259  }
1260 
1262  {
1263  vectorAssignVector<ScalarSubtractionAssignment>(*this, InitListVector<ValueType>(l));
1264  return *this;
1265  }
1266 
1267  void swap(CVector& v)
1268  {
1269  if (this != &v)
1270  std::swap_ranges(data, data + N, v.data);
1271  }
1272 
1273  friend void swap(CVector& v1, CVector& v2)
1274  {
1275  v1.swap(v2);
1276  }
1277 
1278  void clear(const ValueType& v = ValueType())
1279  {
1280  std::fill(data, data + N, v);
1281  }
1282 
1283  private:
1284  ArrayType data;
1285  };
1286 
1287  template <typename T, std::size_t N>
1289 
1290  template <typename T>
1291  class ZeroVector : public VectorContainer<ZeroVector<T> >
1292  {
1293 
1294  typedef ZeroVector<T> SelfType;
1295 
1296  public:
1297  typedef T ValueType;
1298  typedef const T& Reference;
1299  typedef const T& ConstReference;
1300  typedef std::size_t SizeType;
1301  typedef std::ptrdiff_t DifferenceType;
1305 
1307  size(0) {}
1308 
1309  explicit ZeroVector(SizeType n):
1310  size(n) {}
1311 
1313  size(v.size) {}
1314 
1316  {
1317  return this->operator()(i);
1318  }
1319 
1321  {
1322  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
1323  return zero;
1324  }
1325 
1326  bool isEmpty() const
1327  {
1328  return (size == 0);
1329  }
1330 
1332  {
1333  return size;
1334  }
1335 
1337  {
1338  return std::numeric_limits<SizeType>::max();
1339  }
1340 
1342  {
1343  size = v.size;
1344  return *this;
1345  }
1346 
1348  {
1349  size = n;
1350  }
1351 
1352  void swap(ZeroVector& v)
1353  {
1354  if (this != &v)
1355  std::swap(size, v.size);
1356  }
1357 
1358  friend void swap(ZeroVector& v1, ZeroVector& v2)
1359  {
1360  v1.swap(v2);
1361  }
1362 
1363  private:
1364  SizeType size;
1365  static const ValueType zero;
1366  };
1367 
1368  template <typename T>
1369  const typename ZeroVector<T>::ValueType ZeroVector<T>::zero = ZeroVector<T>::ValueType();
1370 
1371  template <typename T>
1372  class UnitVector : public VectorContainer<UnitVector<T> >
1373  {
1374 
1375  typedef UnitVector<T> SelfType;
1376 
1377  public:
1378  typedef T ValueType;
1379  typedef const T& Reference;
1380  typedef const T& ConstReference;
1381  typedef std::size_t SizeType;
1382  typedef std::ptrdiff_t DifferenceType;
1386 
1388  size(0), index(0) {}
1389 
1391  size(n), index(i) {}
1392 
1394  size(v.size), index(v.index) {}
1395 
1397  {
1398  return this->operator()(i);
1399  }
1400 
1402  {
1403  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
1404 
1405  return (i == index ? one : zero);
1406  }
1407 
1408  bool isEmpty() const
1409  {
1410  return (size == 0);
1411  }
1412 
1414  {
1415  return size;
1416  }
1417 
1419  {
1420  return index;
1421  }
1422 
1424  {
1425  return std::numeric_limits<SizeType>::max();
1426  }
1427 
1429  {
1430  if (this != &v) {
1431  size = v.size;
1432  index = v.index;
1433  }
1434 
1435  return *this;
1436  }
1437 
1439  {
1440  size = n;
1441  }
1442 
1443  void swap(UnitVector& v)
1444  {
1445  if (this != &v) {
1446  std::swap(size, v.size);
1447  std::swap(index, v.index);
1448  }
1449  }
1450 
1451  friend void swap(UnitVector& v1, UnitVector& v2)
1452  {
1453  v1.swap(v2);
1454  }
1455 
1456  private:
1457  SizeType size;
1458  SizeType index;
1459  static const ValueType zero;
1460  static const ValueType one;
1461  };
1462 
1463  template <typename T>
1464  const typename UnitVector<T>::ValueType UnitVector<T>::zero = UnitVector<T>::ValueType();
1465  template <typename T>
1466  const typename UnitVector<T>::ValueType UnitVector<T>::one = UnitVector<T>::ValueType(1);
1467 
1468  template <typename T>
1469  class ScalarVector : public VectorContainer<ScalarVector<T> >
1470  {
1471 
1472  typedef ScalarVector<T> SelfType;
1473 
1474  public:
1475  typedef T ValueType;
1476  typedef const T& Reference;
1477  typedef const T& ConstReference;
1478  typedef std::size_t SizeType;
1479  typedef std::ptrdiff_t DifferenceType;
1483 
1485  size(0) {}
1486 
1488  size(n), value(v) {}
1489 
1491  size(v.size), value(v.value) {}
1492 
1494  {
1495  return this->operator()(i);
1496  }
1497 
1499  {
1500  CDPL_MATH_CHECK(i < getSize(), "Index out of range", Base::IndexError);
1501  return value;
1502  }
1503 
1504  bool isEmpty() const
1505  {
1506  return (size == 0);
1507  }
1508 
1510  {
1511  return size;
1512  }
1513 
1515  {
1516  return std::numeric_limits<SizeType>::max();
1517  }
1518 
1520  {
1521  if (this != &v) {
1522  size = v.size;
1523  value = v.value;
1524  }
1525 
1526  return *this;
1527  }
1528 
1530  {
1531  size = n;
1532  }
1533 
1535  {
1536  if (this != &v) {
1537  std::swap(size, v.size);
1538  std::swap(value, v.value);
1539  }
1540  }
1541 
1542  friend void swap(ScalarVector& v1, ScalarVector& v2)
1543  {
1544  v1.swap(v2);
1545  }
1546 
1547  private:
1548  SizeType size;
1549  ValueType value;
1550  };
1551 
1552  template <typename V>
1554  {};
1555 
1556  template <typename V>
1558  {};
1559 
1560  template <typename T1, typename T2>
1562  vec(const T1& t1, const T2& t2)
1563  {
1565 
1566  v(0) = t1;
1567  v(1) = t2;
1568 
1569  return v;
1570  }
1571 
1572  template <typename T1, typename T2, typename T3>
1573  CVector<typename CommonType<typename CommonType<T1, T2>::Type, T3>::Type, 3>
1574  vec(const T1& t1, const T2& t2, const T3& t3)
1575  {
1577 
1578  v(0) = t1;
1579  v(1) = t2;
1580  v(2) = t3;
1581 
1582  return v;
1583  }
1584 
1585  template <typename T1, typename T2, typename T3, typename T4>
1586  CVector<typename CommonType<typename CommonType<typename CommonType<T1, T2>::Type, T3>::Type, T4>::Type, 4>
1587  vec(const T1& t1, const T2& t2, const T3& t3, const T4& t4)
1588  {
1590 
1591  v(0) = t1;
1592  v(1) = t2;
1593  v(2) = t3;
1594  v(3) = t4;
1595 
1596  return v;
1597  }
1598 
1603 
1608 
1613 
1618 
1623 
1628 
1633 
1638 
1643 
1648 
1653 
1658 
1663 
1668 
1673 
1678 
1683 
1688 
1693 
1698 
1703 
1708 
1713 
1718  } // namespace Math
1719 } // namespace CDPL
1720 
1721 #endif // CDPL_MATH_VECTOR_HPP
CDPL::Math::Vector4D
CVector< double, 4 > Vector4D
A bounded 4 element vector holding floating point values of type double.
Definition: Vector.hpp:1642
CDPL::Math::UnitVector
Definition: Vector.hpp:1373
CDPL::Math::BoundedVector::operator+=
BoundedVector & operator+=(const VectorContainer< C > &c)
Definition: Vector.hpp:915
CDPL::Math::CVector::Size
static const SizeType Size
Definition: Vector.hpp:1072
CDPL::Math::DZeroVector
ZeroVector< double > DZeroVector
Definition: Vector.hpp:1605
CDPL::Math::BoundedVector::SharedPointer
std::shared_ptr< SelfType > SharedPointer
Definition: Vector.hpp:801
CDPL::Math::VectorTemporaryTraits
Definition: TypeTraits.hpp:179
CDPL::Math::SparseVector::InitializerListType
std::initializer_list< T > InitializerListType
Definition: Vector.hpp:525
CDPL::Math::Vector::operator/=
std::enable_if< IsScalar< T1 >::value, Vector >::type & operator/=(const T1 &t)
Definition: Vector.hpp:429
CDPL::Math::Vector
Definition: Vector.hpp:258
CDPL::Math::Vector::operator+=
Vector & operator+=(const VectorContainer< C > &c)
Definition: Vector.hpp:384
CDPL::Math::SparseVector::clear
void clear()
Definition: Vector.hpp:750
VectorAssignment.hpp
Implementation of vector assignment routines.
CDPL::Math::BoundedVector::operator+=
BoundedVector & operator+=(InitializerListType l)
Definition: Vector.hpp:920
CDPL::Math::Vector::swap
friend void swap(Vector &v1, Vector &v2)
Definition: Vector.hpp:481
CDPL::Math::Vector::ArrayType
A ArrayType
Definition: Vector.hpp:268
CDPL::Math::ScalarVector::Reference
const T & Reference
Definition: Vector.hpp:1476
CDPL::Math::ZeroVector::ValueType
T ValueType
Definition: Vector.hpp:1297
CDPL::Math::Vector::isEmpty
bool isEmpty() const
Definition: Vector.hpp:327
CDPL::Math::InitListVector::SizeType
InitializerListType::size_type SizeType
Definition: Vector.hpp:211
CDPL::Math::CVector::ConstClosureType
const VectorReference< const SelfType > ConstClosureType
Definition: Vector.hpp:1067
CDPL::Math::UnitVector::isEmpty
bool isEmpty() const
Definition: Vector.hpp:1408
CDPL::Math::SparseVector::operator+=
SparseVector & operator+=(const VectorExpression< E > &e)
Definition: Vector.hpp:656
CDPL::Math::BoundedVector::operator+=
BoundedVector & operator+=(const VectorExpression< E > &e)
Definition: Vector.hpp:926
CDPL::Math::ScalarVector::swap
friend void swap(ScalarVector &v1, ScalarVector &v2)
Definition: Vector.hpp:1542
CDPL::Math::VectorReference::operator[]
Reference operator[](SizeType i)
Definition: Vector.hpp:77
CDPL::Math::Vector::Pointer
T * Pointer
Definition: Vector.hpp:269
CDPL::Math::ZeroVector::swap
void swap(ZeroVector &v)
Definition: Vector.hpp:1352
CDPL::Math::UnitVector::UnitVector
UnitVector(const UnitVector &v)
Definition: Vector.hpp:1393
CDPL::Math::Vector4F
CVector< float, 4 > Vector4F
A bounded 4 element vector holding floating point values of type float.
Definition: Vector.hpp:1627
CDPL::Math::ZeroVector::getSize
SizeType getSize() const
Definition: Vector.hpp:1331
CDPL::Math::InitListVector::SelfType
InitListVector SelfType
Definition: Vector.hpp:206
CDPL::Math::ZeroVector::ZeroVector
ZeroVector(SizeType n)
Definition: Vector.hpp:1309
CDPL::Math::SparseContainerElement
Definition: SparseContainerElement.hpp:42
CDPL::Math::BoundedVector::ConstPointer
const T * ConstPointer
Definition: Vector.hpp:797
CDPL::Math::Vector::Vector
Vector(SizeType n, const ValueType &v)
Definition: Vector.hpp:283
CDPL::Math::SparseVector::operator=
SparseVector & operator=(const SparseVector &v)
Definition: Vector.hpp:612
CDPL::Math::CVector::operator*=
std::enable_if< IsScalar< T1 >::value, CVector >::type & operator*=(const T1 &t)
Definition: Vector.hpp:1210
CDPL::Math::VectorReference::DifferenceType
V::DifferenceType DifferenceType
Definition: Vector.hpp:70
CDPL::Math::ScalarVector::ClosureType
VectorReference< SelfType > ClosureType
Definition: Vector.hpp:1480
CDPL::Math::SparseVector::operator[]
Reference operator[](SizeType i)
Definition: Vector.hpp:554
CDPL::Math::Vector::operator=
Vector & operator=(Vector &&v)
Definition: Vector.hpp:358
CDPL::Math::UnitVector::UnitVector
UnitVector(SizeType n, SizeType i)
Definition: Vector.hpp:1390
CDPL::Math::SparseVector::getSize
SizeType getSize() const
Definition: Vector.hpp:592
CDPL::Math::DScalarVector
ScalarVector< double > DScalarVector
Definition: Vector.hpp:1600
CDPL::Math::ZeroVector::DifferenceType
std::ptrdiff_t DifferenceType
Definition: Vector.hpp:1301
CDPL::Math::VectorReference::ConstClosureType
const SelfType ConstClosureType
Definition: Vector.hpp:72
CDPL::Math::Vector::Vector
Vector()
Definition: Vector.hpp:277
CDPL::Math::ScalarVector
Definition: Vector.hpp:1470
CDPL::Math::UnitVector::VectorTemporaryType
Vector< T > VectorTemporaryType
Definition: Vector.hpp:1385
CDPL::Math::UnitVector::swap
void swap(UnitVector &v)
Definition: Vector.hpp:1443
CDPL::Math::InitListVector::ClosureType
SelfType ClosureType
Definition: Vector.hpp:213
CDPL::Math::Vector::operator=
Vector & operator=(const Vector &v)
Definition: Vector.hpp:352
CDPL::Math::SparseVector::plusAssign
SparseVector & plusAssign(const VectorExpression< E > &e)
Definition: Vector.hpp:712
CDPL::Math::SparseVector::isEmpty
bool isEmpty() const
Definition: Vector.hpp:587
CDPL::Math::Vector3D
CVector< double, 3 > Vector3D
A bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:1637
CDPL::Math::VectorExpression
Definition: Expression.hpp:54
CDPL::Math::FVector
Vector< float > FVector
An unbounded dense vector holding floating point values of type float.
Definition: Vector.hpp:1682
CDPL::Math::VectorReference::operator[]
ConstReference operator[](SizeType i) const
Definition: Vector.hpp:82
CDPL::Math::SparseVector::operator/=
std::enable_if< IsScalar< T1 >::value, SparseVector >::type & operator/=(const T1 &t)
Definition: Vector.hpp:690
CDPL::Math::BoundedVector::ClosureType
VectorReference< SelfType > ClosureType
Definition: Vector.hpp:798
CDPL::Math::SparseVector::getData
const ArrayType & getData() const
Definition: Vector.hpp:607
CDPL::Math::InitListVector::InitializerListType
std::initializer_list< T > InitializerListType
Definition: Vector.hpp:207
CDPL::Math::SparseVector::swap
void swap(SparseVector &v)
Definition: Vector.hpp:737
CDPL::Math::SparseVector
Definition: Vector.hpp:507
CDPL::Math::ScalarVector::getSize
SizeType getSize() const
Definition: Vector.hpp:1509
CDPL::Math::CVector::operator[]
Reference operator[](SizeType i)
Definition: Vector.hpp:1100
CDPL::Math::Vector::operator+=
Vector & operator+=(const VectorExpression< E > &e)
Definition: Vector.hpp:395
CDPL::Math::CVector::operator=
CVector & operator=(const CVector &v)
Definition: Vector.hpp:1147
CDPL::Math::BoundedVector::swap
void swap(BoundedVector &v)
Definition: Vector.hpp:1005
CDPL::Math::InitListVector::Reference
InitializerListType::reference Reference
Definition: Vector.hpp:210
CDPL::Math::CVector::operator-=
CVector & operator-=(const VectorExpression< E > &e)
Definition: Vector.hpp:1203
CDPL::Math::SparseVector::DifferenceType
std::ptrdiff_t DifferenceType
Definition: Vector.hpp:514
VectorExpression.hpp
Definition of various vector expression types and operations.
CDPL::Math::SparseVector::operator+=
SparseVector & operator+=(const VectorContainer< C > &c)
Definition: Vector.hpp:645
CDPL::Math::SparseVector::Reference
SparseContainerElement< SelfType, KeyType > Reference
Definition: Vector.hpp:517
CDPL::Math::BoundedVector::ArrayType
ValueType ArrayType[N]
Definition: Vector.hpp:795
CDPL::Math::CVector::CVector
CVector(const CVector &v)
Definition: Vector.hpp:1084
CDPL::Math::Vector::operator*=
std::enable_if< IsScalar< T1 >::value, Vector >::type & operator*=(const T1 &t)
Definition: Vector.hpp:422
CDPL::Math::VectorContainer< InitListVector< T > >::operator()
const ContainerType & operator()() const
Definition: Expression.hpp:147
CDPL::Math::SparseVector::getNumElements
SizeType getNumElements() const
Definition: Vector.hpp:582
CDPL::Math::CVector::getData
Pointer getData()
Definition: Vector.hpp:1137
CDPL::Math::ScalarVector::ScalarVector
ScalarVector()
Definition: Vector.hpp:1484
CDPL::Math::CVector::minusAssign
CVector & minusAssign(InitializerListType l)
Definition: Vector.hpp:1261
CDPL::Math::CVector::operator=
CVector & operator=(const VectorContainer< C > &c)
Definition: Vector.hpp:1161
CDPL::Math::SparseVector::ConstReference
const T & ConstReference
Definition: Vector.hpp:516
CDPL::Math::VectorReference::operator()
Reference operator()(SizeType i)
Definition: Vector.hpp:87
CDPL::Math::CVector::operator+=
CVector & operator+=(const VectorExpression< E > &e)
Definition: Vector.hpp:1185
CDPL::Math::Vector::Vector
Vector(Vector &&v)
Definition: Vector.hpp:292
CDPL::Math::ZeroVector::Reference
const T & Reference
Definition: Vector.hpp:1298
CDPL::Math::BoundedVector::Pointer
T * Pointer
Definition: Vector.hpp:796
CDPL::Math::InitListVector::ValueType
InitializerListType::value_type ValueType
Definition: Vector.hpp:208
CDPL::Math::InitListVector::operator()
Reference operator()(SizeType i)
Definition: Vector.hpp:230
CDPL::Math::CVector::ValueType
T ValueType
Definition: Vector.hpp:1058
CDPL::Math::ScalarVector::isEmpty
bool isEmpty() const
Definition: Vector.hpp:1504
CDPL::Math::SparseVector::assign
SparseVector & assign(InitializerListType l)
Definition: Vector.hpp:704
CDPL::Math::BoundedVector::operator()
Reference operator()(SizeType i)
Definition: Vector.hpp:849
CDPL::Math::ZeroVector::SizeType
std::size_t SizeType
Definition: Vector.hpp:1300
CDPL::Math::VectorReference::isEmpty
bool isEmpty() const
Definition: Vector.hpp:107
CDPL::Math::Vector::operator-=
Vector & operator-=(InitializerListType l)
Definition: Vector.hpp:408
CDPL::Math::SparseVector::getData
ArrayType & getData()
Definition: Vector.hpp:602
CDPL::Math::SparseDVector
SparseVector< double > SparseDVector
An unbounded sparse vector holding floating point values of type double.
Definition: Vector.hpp:1707
CDPL::Math::SparseLVector
SparseVector< long > SparseLVector
An unbounded sparse vector holding signed integers of type long.
Definition: Vector.hpp:1712
CDPL::Chem::AtomType::N
const unsigned int N
Specifies Nitrogen.
Definition: AtomType.hpp:97
CDPL::Math::BoundedVector::resize
void resize(SizeType n, const ValueType &v)
Definition: Vector.hpp:1028
CDPL::Math::ScalarVector::getMaxSize
SizeType getMaxSize() const
Definition: Vector.hpp:1514
CDPL_MATH_CHECK
#define CDPL_MATH_CHECK(expr, msg, e)
Definition: Check.hpp:36
CDPL::Math::BoundedVector::getMaxSize
SizeType getMaxSize() const
Definition: Vector.hpp:871
CDPL::Math::Vector::plusAssign
Vector & plusAssign(const VectorExpression< E > &e)
Definition: Vector.hpp:450
CDPL::Math::Vector::clear
void clear(const ValueType &v=ValueType())
Definition: Vector.hpp:486
CDPL::Math::CVector::ConstPointer
const T * ConstPointer
Definition: Vector.hpp:1065
CDPL::Math::Vector::SizeType
A::size_type SizeType
Definition: Vector.hpp:266
CDPL::Math::UnitVector::DifferenceType
std::ptrdiff_t DifferenceType
Definition: Vector.hpp:1382
CDPL::Math::InitListVector
Definition: Vector.hpp:203
CDPL::Math::BoundedVector::BoundedVector
BoundedVector(const VectorExpression< E > &e)
Definition: Vector.hpp:833
CDPL::Math::SparseVector::SharedPointer
std::shared_ptr< SelfType > SharedPointer
Definition: Vector.hpp:524
CDPL::Math::CVector::operator-=
CVector & operator-=(InitializerListType l)
Definition: Vector.hpp:1197
CDPL::Math::VectorReference::VectorReference
VectorReference(VectorType &v)
Definition: Vector.hpp:74
CDPL::Math::SparseVector::operator-=
SparseVector & operator-=(InitializerListType l)
Definition: Vector.hpp:669
CDPL::Math::UnitVector::ValueType
T ValueType
Definition: Vector.hpp:1378
CDPL::Math::ScalarVector::operator[]
ConstReference operator[](SizeType i) const
Definition: Vector.hpp:1493
DirectAssignmentProxy.hpp
Definition of a proxy type for direct assignment of vector and matrix expressions.
CDPL::Math::Vector2L
CVector< long, 2 > Vector2L
A bounded 2 element vector holding signed integers of type long.
Definition: Vector.hpp:1652
CDPL::Math::VectorReference
Definition: Vector.hpp:58
CDPL::Math::SparseULVector
SparseVector< unsigned long > SparseULVector
An unbounded sparse vector holding unsigned integers of type unsigned long.
Definition: Vector.hpp:1717
CDPL::Math::CVector::CVector
CVector(const VectorExpression< E > &e)
Definition: Vector.hpp:1095
CDPL::Math::CVector::CVector
CVector(const ValueType &v)
Definition: Vector.hpp:1079
CDPL::Math::CVector::ClosureType
VectorReference< SelfType > ClosureType
Definition: Vector.hpp:1066
CDPL::Math::CVector::plusAssign
CVector & plusAssign(const VectorExpression< E > &e)
Definition: Vector.hpp:1242
CDPL::Math::CVector::minusAssign
CVector & minusAssign(const VectorExpression< E > &e)
Definition: Vector.hpp:1255
CDPL::Base::IndexError
Thrown to indicate that an index is out of range.
Definition: Base/Exceptions.hpp:152
CDPL::Math::Vector::SharedPointer
std::shared_ptr< SelfType > SharedPointer
Definition: Vector.hpp:274
CDPL::Math::InitListVector::ConstClosureType
const SelfType ConstClosureType
Definition: Vector.hpp:214
CDPL::Math::Vector::Vector
Vector(const Vector &v)
Definition: Vector.hpp:289
CDPL::Math::CVector::assign
CVector & assign(const VectorExpression< E > &e)
Definition: Vector.hpp:1224
CDPL::Math::LZeroVector
ZeroVector< long > LZeroVector
Definition: Vector.hpp:1606
CDPL::Math::VectorReference::minusAssign
VectorReference & minusAssign(const VectorExpression< E > &e)
Definition: Vector.hpp:178
CDPL::Math::BoundedVector::getData
Pointer getData()
Definition: Vector.hpp:876
CDPL::Math::CVector::isEmpty
bool isEmpty() const
Definition: Vector.hpp:1122
CDPL::Math::CVector::Reference
T & Reference
Definition: Vector.hpp:1059
CDPL::Math::Vector::ClosureType
VectorReference< SelfType > ClosureType
Definition: Vector.hpp:271
CDPL::Math::SparseVector::swap
friend void swap(SparseVector &v1, SparseVector &v2)
Definition: Vector.hpp:745
CDPL::Base::SizeError
Thrown to indicate that the size of a (multidimensional) array is not correct.
Definition: Base/Exceptions.hpp:133
CDPL::Math::VectorReference::ClosureType
SelfType ClosureType
Definition: Vector.hpp:71
CDPL::Math::CVector::clear
void clear(const ValueType &v=ValueType())
Definition: Vector.hpp:1278
CDPL::Math::Vector::swap
void swap(Vector &v)
Definition: Vector.hpp:475
CDPL::Math::VectorReference::plusAssign
VectorReference & plusAssign(const VectorExpression< E > &e)
Definition: Vector.hpp:171
CDPL::Math::BoundedVector::operator-=
BoundedVector & operator-=(const VectorExpression< E > &e)
Definition: Vector.hpp:944
CDPL::Math::BoundedVector::operator/=
std::enable_if< IsScalar< T1 >::value, BoundedVector >::type & operator/=(const T1 &t)
Definition: Vector.hpp:958
CDPL::Math::Vector7D
CVector< double, 7 > Vector7D
A bounded 7 element vector holding floating point values of type double.
Definition: Vector.hpp:1647
CDPL::Math::SparseVector::operator()
ConstReference operator()(SizeType i) const
Definition: Vector.hpp:570
CDPL::Math::CVector::CVector
CVector(InitializerListType l)
Definition: Vector.hpp:1089
TypeTraits.hpp
Definition of type traits.
CDPL::Math::LUnitVector
UnitVector< long > LUnitVector
Definition: Vector.hpp:1611
CDPL::Math::UnitVector::getIndex
SizeType getIndex() const
Definition: Vector.hpp:1418
CDPL::Math::ZeroVector::swap
friend void swap(ZeroVector &v1, ZeroVector &v2)
Definition: Vector.hpp:1358
CDPL::Math::ScalarVector::ScalarVector
ScalarVector(SizeType n, const ValueType &v=ValueType())
Definition: Vector.hpp:1487
CDPL::Math::CVector::getData
ConstPointer getData() const
Definition: Vector.hpp:1142
CDPL::Math::BoundedVector::InitializerListType
std::initializer_list< T > InitializerListType
Definition: Vector.hpp:802
CDPL::Math::SparseVector::VectorTemporaryType
SelfType VectorTemporaryType
Definition: Vector.hpp:523
CDPL::Math::UnitVector::getMaxSize
SizeType getMaxSize() const
Definition: Vector.hpp:1423
CDPL::Math::InitListVector::VectorTemporaryType
Vector< T, std::vector< T > > VectorTemporaryType
Definition: Vector.hpp:215
CDPL::Math::CVector::Pointer
T * Pointer
Definition: Vector.hpp:1064
CDPL::Math::Vector::operator-=
Vector & operator-=(const VectorContainer< C > &c)
Definition: Vector.hpp:403
CDPL::Math::BoundedVector::plusAssign
BoundedVector & plusAssign(InitializerListType l)
Definition: Vector.hpp:986
CDPL::Math::VectorReference::swap
friend void swap(VectorReference &r1, VectorReference &r2)
Definition: Vector.hpp:189
CDPL::Math::CVector
Definition: Vector.hpp:1053
CDPL::Math::Vector::Vector
Vector(const ArrayType &data)
Definition: Vector.hpp:286
CDPL::Math::Vector::DifferenceType
A::difference_type DifferenceType
Definition: Vector.hpp:267
CDPL::Math::SparseVector::SparseVector
SparseVector(InitializerListType l)
Definition: Vector.hpp:542
CDPL::Math::Vector::getSize
SizeType getSize() const
Definition: Vector.hpp:332
CDPL::Math::DVector
Vector< double > DVector
An unbounded dense vector holding floating point values of type double.
Definition: Vector.hpp:1687
CDPL::Math::CVector::operator()
ConstReference operator()(SizeType i) const
Definition: Vector.hpp:1116
CDPL::Math::ZeroVector::ConstClosureType
const VectorReference< const SelfType > ConstClosureType
Definition: Vector.hpp:1303
CDPL::Math::SparseVector::operator=
SparseVector & operator=(const VectorContainer< C > &c)
Definition: Vector.hpp:631
CDPL::Math::ScalarVector::swap
void swap(ScalarVector &v)
Definition: Vector.hpp:1534
CDPL::Math::ZeroVector
Definition: Vector.hpp:1292
CDPL::Math::ScalarVector::resize
void resize(SizeType n)
Definition: Vector.hpp:1529
V
CDPL::Math::InitListVector::operator[]
Reference operator[](SizeType i)
Definition: Vector.hpp:220
CDPL::Math::VectorContainer
Definition: Expression.hpp:142
CDPL::Math::vec
QuaternionVectorAdapter< E > vec(QuaternionExpression< E > &e)
Definition: QuaternionAdapter.hpp:237
CDPL::Math::BoundedVector::resize
void resize(SizeType n)
Definition: Vector.hpp:1023
CDPL::Math::CVector::ConstReference
const T & ConstReference
Definition: Vector.hpp:1060
CDPL::Math::Vector::InitializerListType
std::initializer_list< T > InitializerListType
Definition: Vector.hpp:275
CDPL::Math::SparseVector::resize
void resize(SizeType n)
Definition: Vector.hpp:755
CDPL::Math::SparseVector::operator*=
std::enable_if< IsScalar< T1 >::value, SparseVector >::type & operator*=(const T1 &t)
Definition: Vector.hpp:683
SparseContainerElement.hpp
Definition of an element proxy for sparse data types.
CDPL::Math::SparseVector::SparseVector
SparseVector(const SparseVector &v)
Definition: Vector.hpp:533
Functional.hpp
Definition of various functors.
CDPL::Math::CVector::operator=
CVector & operator=(const VectorExpression< E > &e)
Definition: Vector.hpp:1167
CDPL::Math::VectorReference::operator-=
VectorReference & operator-=(const VectorExpression< E > &e)
Definition: Vector.hpp:143
CDPL::Math::FScalarVector
ScalarVector< float > FScalarVector
Definition: Vector.hpp:1599
CDPL::Math::ZeroVector::operator=
ZeroVector & operator=(const ZeroVector &v)
Definition: Vector.hpp:1341
CDPL::Math::CVector::VectorTemporaryType
BoundedVector< T, N+1 > VectorTemporaryType
Definition: Vector.hpp:1068
CDPL::Math::UnitVector::operator()
ConstReference operator()(SizeType i) const
Definition: Vector.hpp:1401
CDPL::Math::Vector::getMaxSize
SizeType getMaxSize() const
Definition: Vector.hpp:337
CDPL::Math::CVector::DifferenceType
std::ptrdiff_t DifferenceType
Definition: Vector.hpp:1062
CDPL::Math::Vector::Vector
Vector(SizeType n)
Definition: Vector.hpp:280
CDPL::Math::SparseVector::getMaxSize
SizeType getMaxSize() const
Definition: Vector.hpp:597
CDPL::Math::SparseVector::SizeType
std::size_t SizeType
Definition: Vector.hpp:513
CDPL::Math::BoundedVector::operator[]
ConstReference operator[](SizeType i) const
Definition: Vector.hpp:844
CDPL::Math::CVector::ArrayType
ValueType ArrayType[N]
Definition: Vector.hpp:1063
CDPL::Math::BoundedVector::clear
void clear(const ValueType &v=ValueType())
Definition: Vector.hpp:1018
CDPL::Math::BoundedVector
Definition: Vector.hpp:785
CDPL::Math::BoundedVector::MaxSize
static const SizeType MaxSize
Definition: Vector.hpp:804
CDPL::Math::CVector::plusAssign
CVector & plusAssign(InitializerListType l)
Definition: Vector.hpp:1248
CDPL::Math::SparseVector::SparseVector
SparseVector(SparseVector &&v)
Definition: Vector.hpp:536
CDPL::Math::BoundedVector::VectorTemporaryType
BoundedVector< T, N+1 > VectorTemporaryType
Definition: Vector.hpp:800
CDPL::Math::Vector::plusAssign
Vector & plusAssign(InitializerListType l)
Definition: Vector.hpp:456
CDPL::Chem::AtomType::T
const unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
CDPL::Math::ScalarVector::SizeType
std::size_t SizeType
Definition: Vector.hpp:1478
CDPL::Math::ScalarVector::operator=
ScalarVector & operator=(const ScalarVector &v)
Definition: Vector.hpp:1519
CDPL::Math::VectorReference::getData
VectorType & getData()
Definition: Vector.hpp:117
Exceptions.hpp
Definition of exception classes.
CDPL::Math::CVector::getMaxSize
SizeType getMaxSize() const
Definition: Vector.hpp:1132
CDPL::Math::Vector::Reference
T & Reference
Definition: Vector.hpp:264
CDPL::Math::VectorReference::operator/=
std::enable_if< IsScalar< T >::value, VectorReference >::type & operator/=(const T &t)
Definition: Vector.hpp:157
CDPL::Math::Vector::getData
const ArrayType & getData() const
Definition: Vector.hpp:347
CDPL::Math::UnitVector::UnitVector
UnitVector()
Definition: Vector.hpp:1387
CDPL::Chem::CIPDescriptor::r
const unsigned int r
Specifies that the stereocenter has r configuration.
Definition: CIPDescriptor.hpp:76
CDPL::Math::Vector4L
CVector< long, 4 > Vector4L
A bounded 4 element vector holding signed integers of type long.
Definition: Vector.hpp:1662
CDPL::Math::BoundedVector::minusAssign
BoundedVector & minusAssign(const VectorExpression< E > &e)
Definition: Vector.hpp:993
CDPL::Math::InitListVector::DifferenceType
std::ptrdiff_t DifferenceType
Definition: Vector.hpp:212
CDPL::Math::Vector::ValueType
T ValueType
Definition: Vector.hpp:263
CDPL::Math::CVector::CVector
CVector()
Definition: Vector.hpp:1074
CDPL::Math::BoundedVector::operator-=
BoundedVector & operator-=(const VectorContainer< C > &c)
Definition: Vector.hpp:933
CDPL::Math::Vector::minusAssign
Vector & minusAssign(const VectorExpression< E > &e)
Definition: Vector.hpp:463
CDPL::Math::BoundedVector::assign
BoundedVector & assign(const VectorExpression< E > &e)
Definition: Vector.hpp:965
CDPL::Math::CVector::getSize
SizeType getSize() const
Definition: Vector.hpp:1127
CDPL::Math::VectorReference::operator+=
VectorReference & operator+=(const VectorExpression< E > &e)
Definition: Vector.hpp:136
CDPL::Math::BoundedVector::ValueType
T ValueType
Definition: Vector.hpp:790
CDPL::Math::SparseVector::operator=
SparseVector & operator=(SparseVector &&v)
Definition: Vector.hpp:619
CDPL::Math::Vector::getData
ArrayType & getData()
Definition: Vector.hpp:342
CDPL::Math::CVector::assign
CVector & assign(InitializerListType l)
Definition: Vector.hpp:1230
CDPL::Math::VectorReference::SizeType
V::SizeType SizeType
Definition: Vector.hpp:69
CDPL::Math::Vector::operator[]
Reference operator[](SizeType i)
Definition: Vector.hpp:305
CDPL::Math::BoundedVector::ConstClosureType
const VectorReference< const SelfType > ConstClosureType
Definition: Vector.hpp:799
CDPL::Math::CVector::operator()
Reference operator()(SizeType i)
Definition: Vector.hpp:1110
CDPL::Math::CVector::operator[]
ConstReference operator[](SizeType i) const
Definition: Vector.hpp:1105
CDPL::Math::InitListVector::ConstReference
InitializerListType::const_reference ConstReference
Definition: Vector.hpp:209
CDPL::Math::BoundedVector::operator=
BoundedVector & operator=(InitializerListType l)
Definition: Vector.hpp:896
CDPL::Math::BoundedVector::DifferenceType
std::ptrdiff_t DifferenceType
Definition: Vector.hpp:794
CDPL::Math::BoundedVector::operator-=
BoundedVector & operator-=(InitializerListType l)
Definition: Vector.hpp:938
CDPL::Math::VectorReference::VectorType
V VectorType
Definition: Vector.hpp:63
CDPL::Math::SparseVector::ValueType
T ValueType
Definition: Vector.hpp:512
CDPL::Math::CVector::swap
void swap(CVector &v)
Definition: Vector.hpp:1267
CDPL::Math::BoundedVector::getData
ConstPointer getData() const
Definition: Vector.hpp:881
CDPL::Math::SparseVector::operator=
SparseVector & operator=(InitializerListType l)
Definition: Vector.hpp:625
CDPL::Math::BoundedVector::BoundedVector
BoundedVector(InitializerListType l)
Definition: Vector.hpp:827
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Math::BoundedVector::isEmpty
bool isEmpty() const
Definition: Vector.hpp:861
CDPL::Math::ZeroVector::ZeroVector
ZeroVector(const ZeroVector &v)
Definition: Vector.hpp:1312
CDPL::Math::InitListVector::isEmpty
bool isEmpty() const
Definition: Vector.hpp:247
CDPL::Math::SparseVector::ClosureType
VectorReference< SelfType > ClosureType
Definition: Vector.hpp:521
CDPL::Math::CVector::swap
friend void swap(CVector &v1, CVector &v2)
Definition: Vector.hpp:1273
CDPL::Math::SparseVector::ArrayType
A ArrayType
Definition: Vector.hpp:518
CDPL::Math::SparseVector::minusAssign
SparseVector & minusAssign(InitializerListType l)
Definition: Vector.hpp:731
CDPL::Math::Vector::resize
void resize(SizeType n, const ValueType &v=ValueType())
Definition: Vector.hpp:491
CDPL::Math::BoundedVector::ConstReference
const T & ConstReference
Definition: Vector.hpp:792
CDPL::Math::ScalarVector::ScalarVector
ScalarVector(const ScalarVector &v)
Definition: Vector.hpp:1490
CDPL::Math::CVector::operator=
CVector & operator=(InitializerListType l)
Definition: Vector.hpp:1155
CDPL::Math::Vector::operator()
Reference operator()(SizeType i)
Definition: Vector.hpp:315
CDPL::Math::SparseVector::plusAssign
SparseVector & plusAssign(InitializerListType l)
Definition: Vector.hpp:718
CDPL::Math::LScalarVector
ScalarVector< long > LScalarVector
Definition: Vector.hpp:1601
CDPL::Math::UnitVector::ConstReference
const T & ConstReference
Definition: Vector.hpp:1380
CDPL::Math::CVector::operator+=
CVector & operator+=(const VectorContainer< C > &c)
Definition: Vector.hpp:1174
CDPL::Math::ZeroVector::operator()
ConstReference operator()(SizeType i) const
Definition: Vector.hpp:1320
CDPL::Math::SparseVector::ConstClosureType
const VectorReference< const SelfType > ConstClosureType
Definition: Vector.hpp:522
CDPL::Math::Vector::VectorTemporaryType
SelfType VectorTemporaryType
Definition: Vector.hpp:273
CDPL::Math::SparseVector::SparseVector
SparseVector(const VectorExpression< E > &e)
Definition: Vector.hpp:548
CDPL::Math::BoundedVector::minusAssign
BoundedVector & minusAssign(InitializerListType l)
Definition: Vector.hpp:999
CDPL::Math::CVector::operator/=
std::enable_if< IsScalar< T1 >::value, CVector >::type & operator/=(const T1 &t)
Definition: Vector.hpp:1217
CDPL::Math::CVector::SizeType
std::size_t SizeType
Definition: Vector.hpp:1061
CDPL::Math::Vector::Vector
Vector(const VectorExpression< E > &e)
Definition: Vector.hpp:299
CDPL::Math::DUnitVector
UnitVector< double > DUnitVector
Definition: Vector.hpp:1610
CDPL::Math::SparseVector::operator+=
SparseVector & operator+=(InitializerListType l)
Definition: Vector.hpp:650
CDPL::Math::ZeroVector::ConstReference
const T & ConstReference
Definition: Vector.hpp:1299
CDPL::Math::ZeroVector::ZeroVector
ZeroVector()
Definition: Vector.hpp:1306
CDPL::Math::Vector2D
CVector< double, 2 > Vector2D
A bounded 2 element vector holding floating point values of type double.
Definition: Vector.hpp:1632
CDPL::Math::Vector::assign
Vector & assign(InitializerListType l)
Definition: Vector.hpp:443
CDPL::Math::SparseVector::minusAssign
SparseVector & minusAssign(const VectorExpression< E > &e)
Definition: Vector.hpp:725
CDPL::Math::ULVector
Vector< unsigned long > ULVector
An unbounded dense vector holding unsigned integers of type unsigned long.
Definition: Vector.hpp:1697
CDPL::Math::SparseVector::operator[]
ConstReference operator[](SizeType i) const
Definition: Vector.hpp:559
CDPL::Math::VectorReference::swap
void swap(VectorReference &r)
Definition: Vector.hpp:184
CDPL::Math::UnitVector::SizeType
std::size_t SizeType
Definition: Vector.hpp:1381
CDPL::Math::VectorReference::operator()
ConstReference operator()(SizeType i) const
Definition: Vector.hpp:92
CDPL::Math::InitListVector::getSize
SizeType getSize() const
Definition: Vector.hpp:242
CDPL::Math::BoundedVector::operator[]
Reference operator[](SizeType i)
Definition: Vector.hpp:839
CDPL::Math::BoundedVector::BoundedVector
BoundedVector()
Definition: Vector.hpp:806
CDPL::Math::UnitVector::resize
void resize(SizeType n)
Definition: Vector.hpp:1438
CDPL::Math::ZeroVector::VectorTemporaryType
Vector< T > VectorTemporaryType
Definition: Vector.hpp:1304
CDPL::Math::VectorReference::ValueType
V::ValueType ValueType
Definition: Vector.hpp:64
CDPL::Math::ULUnitVector
UnitVector< unsigned long > ULUnitVector
Definition: Vector.hpp:1612
CDPL::Math::VectorReference::operator*=
std::enable_if< IsScalar< T >::value, VectorReference >::type & operator*=(const T &t)
Definition: Vector.hpp:150
CDPL::Math::ZeroVector::getMaxSize
SizeType getMaxSize() const
Definition: Vector.hpp:1336
CDPL::Math::SparseVector::ConstPointer
const T * ConstPointer
Definition: Vector.hpp:520
CDPL::Math::BoundedVector::BoundedVector
BoundedVector(SizeType n, const ValueType &v)
Definition: Vector.hpp:815
CDPL::Math::ScalarVector::ConstClosureType
const VectorReference< const SelfType > ConstClosureType
Definition: Vector.hpp:1481
CDPL::Math::ScalarVector::ConstReference
const T & ConstReference
Definition: Vector.hpp:1477
CDPL::Math::ZeroVector::resize
void resize(SizeType n)
Definition: Vector.hpp:1347
CDPL::Math::BoundedVector::operator*=
std::enable_if< IsScalar< T1 >::value, BoundedVector >::type & operator*=(const T1 &t)
Definition: Vector.hpp:951
CDPL::Math::Vector::operator+=
Vector & operator+=(InitializerListType l)
Definition: Vector.hpp:389
CDPL::Math::CVector::operator+=
CVector & operator+=(InitializerListType l)
Definition: Vector.hpp:1179
CDPL::Math::VectorReference::operator=
VectorReference & operator=(const VectorReference &r)
Definition: Vector.hpp:122
CDPL::Math::UnitVector::operator=
UnitVector & operator=(const UnitVector &v)
Definition: Vector.hpp:1428
CDPL::Math::SparseFVector
SparseVector< float > SparseFVector
An unbounded sparse vector holding floating point values of type float.
Definition: Vector.hpp:1702
CDPL::Math::VectorReference::assign
VectorReference & assign(const VectorExpression< E > &e)
Definition: Vector.hpp:164
CDPL::Math::VectorReference::operator=
VectorReference & operator=(const VectorExpression< E > &e)
Definition: Vector.hpp:129
CDPL::Math::BoundedVector::swap
friend void swap(BoundedVector &v1, BoundedVector &v2)
Definition: Vector.hpp:1013
CDPL::Math::CVector::InitializerListType
std::initializer_list< T > InitializerListType
Definition: Vector.hpp:1070
CDPL::Math::BoundedVector::BoundedVector
BoundedVector(const BoundedVector &v)
Definition: Vector.hpp:821
CDPL::Math::Vector::Vector
Vector(InitializerListType l)
Definition: Vector.hpp:295
CDPL::Math::SparseVector::operator-=
SparseVector & operator-=(const VectorExpression< E > &e)
Definition: Vector.hpp:675
CDPL::Math::SparseVector::KeyType
A::key_type KeyType
Definition: Vector.hpp:515
CDPL::Math::VectorReference::Reference
std::conditional< std::is_const< V >::value, typename V::ConstReference, typename V::Reference >::type Reference
Definition: Vector.hpp:67
CDPL::Math::Vector3F
CVector< float, 3 > Vector3F
A bounded 3 element vector holding floating point values of type float.
Definition: Vector.hpp:1622
CDPL::Math::InitListVector::operator[]
ConstReference operator[](SizeType i) const
Definition: Vector.hpp:225
CDPL::Math::BoundedVector::operator()
ConstReference operator()(SizeType i) const
Definition: Vector.hpp:855
CDPL::Math::Vector3UL
CVector< unsigned long, 3 > Vector3UL
A bounded 3 element vector holding unsigned integers of type unsigned long.
Definition: Vector.hpp:1672
CDPL::Math::ScalarVector::DifferenceType
std::ptrdiff_t DifferenceType
Definition: Vector.hpp:1479
CDPL::Math::ULScalarVector
ScalarVector< unsigned long > ULScalarVector
Definition: Vector.hpp:1602
CDPL::Math::Vector::operator-=
Vector & operator-=(const VectorExpression< E > &e)
Definition: Vector.hpp:414
CDPL::Math::BoundedVector::SizeType
std::size_t SizeType
Definition: Vector.hpp:793
CDPL::Math::SparseVector::Pointer
T * Pointer
Definition: Vector.hpp:519
CDPL::Math::ULZeroVector
ZeroVector< unsigned long > ULZeroVector
Definition: Vector.hpp:1607
CDPL::Math::UnitVector::operator[]
ConstReference operator[](SizeType i) const
Definition: Vector.hpp:1396
CDPL::Math::BoundedVector::operator=
BoundedVector & operator=(const BoundedVector &v)
Definition: Vector.hpp:886
CDPL::Math::ScalarVector::operator()
ConstReference operator()(SizeType i) const
Definition: Vector.hpp:1498
CDPL::Math::SparseVector::operator-=
SparseVector & operator-=(const VectorContainer< C > &c)
Definition: Vector.hpp:664
CDPL::Math::VectorReference::getData
const VectorType & getData() const
Definition: Vector.hpp:112
CDPL::Math::SparseVector::SparseVector
SparseVector(SizeType n)
Definition: Vector.hpp:530
CDPL::Math::ScalarVector::VectorTemporaryType
Vector< T > VectorTemporaryType
Definition: Vector.hpp:1482
CDPL::Math::UnitVector::ClosureType
VectorReference< SelfType > ClosureType
Definition: Vector.hpp:1383
Check.hpp
Definition of various preprocessor macros for error checking.
CDPL::Math::UnitVector::Reference
const T & Reference
Definition: Vector.hpp:1379
CDPL::Math::FUnitVector
UnitVector< float > FUnitVector
Definition: Vector.hpp:1609
CDPL_MATH_CHECK_MAX_SIZE
#define CDPL_MATH_CHECK_MAX_SIZE(size, max_size, e)
Definition: Check.hpp:64
CDPL::Math::CVector::SharedPointer
std::shared_ptr< SelfType > SharedPointer
Definition: Vector.hpp:1069
CDPL::Math::InitListVector::operator()
ConstReference operator()(SizeType i) const
Definition: Vector.hpp:236
CDPL::Math::Vector::operator=
Vector & operator=(InitializerListType l)
Definition: Vector.hpp:364
CDPL::Math::UnitVector::getSize
SizeType getSize() const
Definition: Vector.hpp:1413
CDPL::Math::Vector::ConstClosureType
const VectorReference< const SelfType > ConstClosureType
Definition: Vector.hpp:272
CDPL::Math::Vector::minusAssign
Vector & minusAssign(InitializerListType l)
Definition: Vector.hpp:469
CDPL::Math::Vector::assign
Vector & assign(const VectorExpression< E > &e)
Definition: Vector.hpp:436
CDPL::Math::ZeroVector::operator[]
ConstReference operator[](SizeType i) const
Definition: Vector.hpp:1315
CDPL::Math::Vector::ConstReference
const T & ConstReference
Definition: Vector.hpp:265
CDPL::Math::BoundedVector::plusAssign
BoundedVector & plusAssign(const VectorExpression< E > &e)
Definition: Vector.hpp:980
CDPL::Math::LVector
Vector< long > LVector
An unbounded dense vector holding signed integers of type long.
Definition: Vector.hpp:1692
CDPL::Math::BoundedVector::assign
BoundedVector & assign(InitializerListType l)
Definition: Vector.hpp:972
CDPL::Math::UnitVector::swap
friend void swap(UnitVector &v1, UnitVector &v2)
Definition: Vector.hpp:1451
CDPL::Math::Vector3L
CVector< long, 3 > Vector3L
A bounded 3 element vector holding signed integers of type long.
Definition: Vector.hpp:1657
CDPL::Math::SparseVector::SparseVector
SparseVector()
Definition: Vector.hpp:527
CDPL::Math::Vector2F
CVector< float, 2 > Vector2F
A bounded 2 element vector holding floating point values of type float.
Definition: Vector.hpp:1617
CDPL::Math::SparseVector::operator()
Reference operator()(SizeType i)
Definition: Vector.hpp:564
CDPL::Math::Vector::operator=
Vector & operator=(const VectorExpression< E > &e)
Definition: Vector.hpp:376
CDPL::Math::CVector::operator-=
CVector & operator-=(const VectorContainer< C > &c)
Definition: Vector.hpp:1192
CDPL::Math::InitListVector::InitListVector
InitListVector(InitializerListType l)
Definition: Vector.hpp:217
CDPL::Math::Vector4UL
CVector< unsigned long, 4 > Vector4UL
A bounded 4 element vector holding unsigned integers of type unsigned long.
Definition: Vector.hpp:1677
CDPL::Math::ScalarVector::ValueType
T ValueType
Definition: Vector.hpp:1475
CDPL::Math::BoundedVector::getSize
SizeType getSize() const
Definition: Vector.hpp:866
CDPL::Math::VectorReference::getMaxSize
SizeType getMaxSize() const
Definition: Vector.hpp:102
CDPL::Chem::AtomType::A
const unsigned int A
A generic type that covers any element except hydrogen.
Definition: AtomType.hpp:617
CDPL::Math::BoundedVector::Reference
T & Reference
Definition: Vector.hpp:791
CDPL::Math::Vector::operator[]
ConstReference operator[](SizeType i) const
Definition: Vector.hpp:310
CDPL::Math::BoundedVector::BoundedVector
BoundedVector(SizeType n)
Definition: Vector.hpp:809
CDPL::Math::SparseVector::operator=
SparseVector & operator=(const VectorExpression< E > &e)
Definition: Vector.hpp:637
CDPL::Math::FZeroVector
ZeroVector< float > FZeroVector
Definition: Vector.hpp:1604
CDPL::Math::VectorReference::getSize
SizeType getSize() const
Definition: Vector.hpp:97
CDPL::Math::Vector::ConstPointer
const T * ConstPointer
Definition: Vector.hpp:270
CDPL::Math::Vector::operator=
Vector & operator=(const VectorContainer< C > &c)
Definition: Vector.hpp:370
CDPL::Math::BoundedVector::operator=
BoundedVector & operator=(const VectorContainer< C > &c)
Definition: Vector.hpp:902
CDPL::Math::SparseVector::assign
SparseVector & assign(const VectorExpression< E > &e)
Definition: Vector.hpp:697
CDPL::Math::VectorReference::ConstReference
V::ConstReference ConstReference
Definition: Vector.hpp:68
CDPL::Math::BoundedVector::operator=
BoundedVector & operator=(const VectorExpression< E > &e)
Definition: Vector.hpp:908
CDPL::Math::UnitVector::ConstClosureType
const VectorReference< const SelfType > ConstClosureType
Definition: Vector.hpp:1384
CDPL::Math::Vector::operator()
ConstReference operator()(SizeType i) const
Definition: Vector.hpp:321
CDPL::Math::Vector2UL
CVector< unsigned long, 2 > Vector2UL
A bounded 2 element vector holding unsigned integers of type unsigned long.
Definition: Vector.hpp:1667
CDPL::Math::ZeroVector::ClosureType
VectorReference< SelfType > ClosureType
Definition: Vector.hpp:1302
CDPL::Math::ZeroVector::isEmpty
bool isEmpty() const
Definition: Vector.hpp:1326