Chemical Data Processing Library C++ API - Version 1.1.1
MatrixProxy.hpp
Go to the documentation of this file.
1 /*
2  * MatrixProxy.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_MATRIXPROXY_HPP
28 #define CDPL_MATH_MATRIXPROXY_HPP
29 
30 #include <type_traits>
31 
32 #include "CDPL/Math/Expression.hpp"
33 #include "CDPL/Math/TypeTraits.hpp"
34 #include "CDPL/Math/Functional.hpp"
37 #include "CDPL/Math/Range.hpp"
38 #include "CDPL/Math/Slice.hpp"
39 
40 
41 namespace CDPL
42 {
43 
44  namespace Math
45  {
46 
47  template <typename M>
48  class MatrixRow : public VectorExpression<MatrixRow<M> >
49  {
50 
51  typedef MatrixRow<M> SelfType;
52 
53  public:
54  typedef M MatrixType;
55  typedef typename M::SizeType SizeType;
56  typedef typename M::DifferenceType DifferenceType;
57  typedef typename M::ValueType ValueType;
58  typedef typename M::ConstReference ConstReference;
59  typedef typename std::conditional<std::is_const<M>::value,
60  typename M::ConstReference,
61  typename M::Reference>::type Reference;
62  typedef typename std::conditional<std::is_const<M>::value,
63  typename M::ConstClosureType,
64  typename M::ClosureType>::type MatrixClosureType;
65  typedef const SelfType ConstClosureType;
67 
69  data(m), index(i) {}
70 
72  {
73  return data(index, i);
74  }
75 
77  {
78  return data(index, i);
79  }
80 
82  {
83  return data(index, i);
84  }
85 
87  {
88  return data(index, i);
89  }
90 
92  {
93  return index;
94  }
95 
96  SizeType getSize() const
97  {
98  return data.getSize2();
99  }
100 
101  bool isEmpty() const
102  {
103  return (data.getSize2() == 0);
104  }
105 
107  {
108  return data;
109  }
110 
111  const MatrixClosureType& getData() const
112  {
113  return data;
114  }
115 
117  {
118  vectorAssignVector<ScalarAssignment>(*this, typename VectorTemporaryTraits<M>::Type(r));
119  return *this;
120  }
121 
122  template <typename E>
124  {
125  vectorAssignVector<ScalarAssignment>(*this, typename VectorTemporaryTraits<M>::Type(e));
126  return *this;
127  }
128 
129  template <typename E>
131  {
132  vectorAssignVector<ScalarAssignment>(*this, typename VectorTemporaryTraits<M>::Type(*this + e));
133  return *this;
134  }
135 
136  template <typename E>
138  {
139  vectorAssignVector<ScalarAssignment>(*this, typename VectorTemporaryTraits<M>::Type(*this - e));
140  return *this;
141  }
142 
143  template <typename T>
144  typename std::enable_if<IsScalar<T>::value, MatrixRow>::type& operator*=(const T& t)
145  {
146  vectorAssignScalar<ScalarMultiplicationAssignment>(*this, t);
147  return *this;
148  }
149 
150  template <typename T>
151  typename std::enable_if<IsScalar<T>::value, MatrixRow>::type& operator/=(const T& t)
152  {
153  vectorAssignScalar<ScalarDivisionAssignment>(*this, t);
154  return *this;
155  }
156 
157  template <typename E>
159  {
160  vectorAssignVector<ScalarAssignment>(*this, e);
161  return *this;
162  }
163 
164  template <typename E>
166  {
167  vectorAssignVector<ScalarAdditionAssignment>(*this, e);
168  return *this;
169  }
170 
171  template <typename E>
173  {
174  vectorAssignVector<ScalarSubtractionAssignment>(*this, e);
175  return *this;
176  }
177 
178  void swap(MatrixRow& r)
179  {
180  if (this != &r)
181  vectorSwap(*this, r);
182  }
183 
184  friend void swap(MatrixRow& r1, MatrixRow& r2)
185  {
186  r1.swap(r2);
187  }
188 
189  private:
190  MatrixClosureType data;
191  SizeType index;
192  };
193 
194  template <typename M>
195  class MatrixColumn : public VectorExpression<MatrixColumn<M> >
196  {
197 
198  typedef MatrixColumn<M> SelfType;
199 
200  public:
201  typedef M MatrixType;
202  typedef typename M::SizeType SizeType;
203  typedef typename M::DifferenceType DifferenceType;
204  typedef typename M::ValueType ValueType;
205  typedef typename M::ConstReference ConstReference;
206  typedef typename std::conditional<std::is_const<M>::value,
207  typename M::ConstReference,
208  typename M::Reference>::type Reference;
209  typedef typename std::conditional<std::is_const<M>::value,
210  typename M::ConstClosureType,
211  typename M::ClosureType>::type MatrixClosureType;
212  typedef const SelfType ConstClosureType;
214 
216  data(m), index(i) {}
217 
219  {
220  return data(i, index);
221  }
222 
224  {
225  return data(i, index);
226  }
227 
229  {
230  return data(i, index);
231  }
232 
234  {
235  return data(i, index);
236  }
237 
239  {
240  return index;
241  }
242 
244  {
245  return data.getSize1();
246  }
247 
248  bool isEmpty() const
249  {
250  return (data.getSize1() == 0);
251  }
252 
254  {
255  return data;
256  }
257 
258  const MatrixClosureType& getData() const
259  {
260  return data;
261  }
262 
264  {
265  vectorAssignVector<ScalarAssignment>(*this, typename VectorTemporaryTraits<M>::Type(c));
266  return *this;
267  }
268 
269  template <typename E>
271  {
272  vectorAssignVector<ScalarAssignment>(*this, typename VectorTemporaryTraits<M>::Type(e));
273  return *this;
274  }
275 
276  template <typename E>
278  {
279  vectorAssignVector<ScalarAssignment>(*this, typename VectorTemporaryTraits<M>::Type(*this + e));
280  return *this;
281  }
282 
283  template <typename E>
285  {
286  vectorAssignVector<ScalarAssignment>(*this, typename VectorTemporaryTraits<M>::Type(*this - e));
287  return *this;
288  }
289 
290  template <typename T>
291  typename std::enable_if<IsScalar<T>::value, MatrixColumn>::type& operator*=(const T& t)
292  {
293  vectorAssignScalar<ScalarMultiplicationAssignment>(*this, t);
294  return *this;
295  }
296 
297  template <typename T>
298  typename std::enable_if<IsScalar<T>::value, MatrixColumn>::type& operator/=(const T& t)
299  {
300  vectorAssignScalar<ScalarDivisionAssignment>(*this, t);
301  return *this;
302  }
303 
304  template <typename E>
306  {
307  vectorAssignVector<ScalarAssignment>(*this, e);
308  return *this;
309  }
310 
311  template <typename E>
313  {
314  vectorAssignVector<ScalarAdditionAssignment>(*this, e);
315  return *this;
316  }
317 
318  template <typename E>
320  {
321  vectorAssignVector<ScalarSubtractionAssignment>(*this, e);
322  return *this;
323  }
324 
326  {
327  if (this != &c)
328  vectorSwap(*this, c);
329  }
330 
331  friend void swap(MatrixColumn& c1, MatrixColumn& c2)
332  {
333  c1.swap(c2);
334  }
335 
336  private:
337  MatrixClosureType data;
338  SizeType index;
339  };
340 
341  template <typename M>
342  class MatrixRange : public MatrixExpression<MatrixRange<M> >
343  {
344 
345  typedef MatrixRange<M> SelfType;
346 
347  public:
348  typedef M MatrixType;
349  typedef typename M::SizeType SizeType;
350  typedef typename M::DifferenceType DifferenceType;
351  typedef typename M::ValueType ValueType;
352  typedef typename M::ConstReference ConstReference;
353  typedef typename std::conditional<std::is_const<M>::value,
354  typename M::ConstReference,
355  typename M::Reference>::type Reference;
356  typedef typename std::conditional<std::is_const<M>::value,
357  typename M::ConstClosureType,
358  typename M::ClosureType>::type MatrixClosureType;
359  typedef const SelfType ConstClosureType;
362 
363  MatrixRange(MatrixType& m, const RangeType& r1, const RangeType& r2):
364  data(m), range1(r1), range2(r2) {}
365 
367  {
368  return data(range1(i), range2(j));
369  }
370 
372  {
373  return data(range1(i), range2(j));
374  }
375 
377  {
378  return range1.getStart();
379  }
380 
382  {
383  return range2.getStart();
384  }
385 
387  {
388  return range1.getSize();
389  }
390 
392  {
393  return range2.getSize();
394  }
395 
396  bool isEmpty() const
397  {
398  return (range1.getSize() == SizeType(0) || range2.getSize() == SizeType(0));
399  }
400 
402  {
403  return data;
404  }
405 
406  const MatrixClosureType& getData() const
407  {
408  return data;
409  }
410 
412  {
413  matrixAssignMatrix<ScalarAssignment>(*this, typename MatrixTemporaryTraits<M>::Type(r));
414  return *this;
415  }
416 
417  template <typename E>
419  {
420  matrixAssignMatrix<ScalarAssignment>(*this, typename MatrixTemporaryTraits<M>::Type(e));
421  return *this;
422  }
423 
424  template <typename E>
426  {
427  matrixAssignMatrix<ScalarAssignment>(*this, typename MatrixTemporaryTraits<M>::Type(*this + e));
428  return *this;
429  }
430 
431  template <typename E>
433  {
434  matrixAssignMatrix<ScalarAssignment>(*this, typename MatrixTemporaryTraits<M>::Type(*this - e));
435  return *this;
436  }
437 
438  template <typename T>
439  typename std::enable_if<IsScalar<T>::value, MatrixRange>::type& operator*=(const T& t)
440  {
441  matrixAssignScalar<ScalarMultiplicationAssignment>(*this, t);
442  return *this;
443  }
444 
445  template <typename T>
446  typename std::enable_if<IsScalar<T>::value, MatrixRange>::type& operator/=(const T& t)
447  {
448  matrixAssignScalar<ScalarDivisionAssignment>(*this, t);
449  return *this;
450  }
451 
452  template <typename E>
454  {
455  matrixAssignMatrix<ScalarAssignment>(*this, e);
456  return *this;
457  }
458 
459  template <typename E>
461  {
462  matrixAssignMatrix<ScalarAdditionAssignment>(*this, e);
463  return *this;
464  }
465 
466  template <typename E>
468  {
469  matrixAssignMatrix<ScalarSubtractionAssignment>(*this, e);
470  return *this;
471  }
472 
474  {
475  if (this != &r)
476  matrixSwap(*this, r);
477  }
478 
479  friend void swap(MatrixRange& r1, MatrixRange& r2)
480  {
481  r1.swap(r2);
482  }
483 
484  private:
485  MatrixClosureType data;
486  RangeType range1;
487  RangeType range2;
488  };
489 
490  template <typename M>
491  class MatrixSlice : public MatrixExpression<MatrixSlice<M> >
492  {
493 
494  typedef MatrixSlice<M> SelfType;
495 
496  public:
497  typedef M MatrixType;
498  typedef typename M::SizeType SizeType;
499  typedef typename M::DifferenceType DifferenceType;
500  typedef typename M::ValueType ValueType;
501  typedef typename M::ConstReference ConstReference;
502  typedef typename std::conditional<std::is_const<M>::value,
503  typename M::ConstReference,
504  typename M::Reference>::type Reference;
505  typedef typename std::conditional<std::is_const<M>::value,
506  typename M::ConstClosureType,
507  typename M::ClosureType>::type MatrixClosureType;
508  typedef const SelfType ConstClosureType;
511 
512  MatrixSlice(MatrixType& m, const SliceType& s1, const SliceType& s2):
513  data(m), slice1(s1), slice2(s2) {}
514 
516  {
517  return data(slice1(i), slice2(j));
518  }
519 
521  {
522  return data(slice1(i), slice2(j));
523  }
524 
526  {
527  return slice1.getStart();
528  }
529 
531  {
532  return slice2.getStart();
533  }
534 
536  {
537  return slice1.getStride();
538  }
539 
541  {
542  return slice2.getStride();
543  }
544 
546  {
547  return slice1.getSize();
548  }
549 
551  {
552  return slice2.getSize();
553  }
554 
555  bool isEmpty() const
556  {
557  return (slice1.getSize() == SizeType(0) || slice2.getSize() == SizeType(0));
558  }
559 
561  {
562  return data;
563  }
564 
565  const MatrixClosureType& getData() const
566  {
567  return data;
568  }
569 
571  {
572  matrixAssignMatrix<ScalarAssignment>(*this, typename MatrixTemporaryTraits<M>::Type(s));
573  return *this;
574  }
575 
576  template <typename E>
578  {
579  matrixAssignMatrix<ScalarAssignment>(*this, typename MatrixTemporaryTraits<M>::Type(e));
580  return *this;
581  }
582 
583  template <typename E>
585  {
586  matrixAssignMatrix<ScalarAssignment>(*this, typename MatrixTemporaryTraits<M>::Type(*this + e));
587  return *this;
588  }
589 
590  template <typename E>
592  {
593  matrixAssignMatrix<ScalarAssignment>(*this, typename MatrixTemporaryTraits<M>::Type(*this - e));
594  return *this;
595  }
596 
597  template <typename T>
598  typename std::enable_if<IsScalar<T>::value, MatrixSlice>::type& operator*=(const T& t)
599  {
600  matrixAssignScalar<ScalarMultiplicationAssignment>(*this, t);
601  return *this;
602  }
603 
604  template <typename T>
605  typename std::enable_if<IsScalar<T>::value, MatrixSlice>::type& operator/=(const T& t)
606  {
607  matrixAssignScalar<ScalarDivisionAssignment>(*this, t);
608  return *this;
609  }
610 
611  template <typename E>
613  {
614  matrixAssignMatrix<ScalarAssignment>(*this, e);
615  return *this;
616  }
617 
618  template <typename E>
620  {
621  matrixAssignMatrix<ScalarAdditionAssignment>(*this, e);
622  return *this;
623  }
624 
625  template <typename E>
627  {
628  matrixAssignMatrix<ScalarSubtractionAssignment>(*this, e);
629  return *this;
630  }
631 
633  {
634  if (this != &s)
635  matrixSwap(*this, s);
636  }
637 
638  friend void swap(MatrixSlice& s1, MatrixSlice& s2)
639  {
640  s1.swap(s2);
641  }
642 
643  private:
644  MatrixClosureType data;
645  SliceType slice1;
646  SliceType slice2;
647  };
648 
649  template <typename M>
651  {};
652 
653  template <typename M>
655  {};
656 
657  template <typename M>
659  {};
660 
661  template <typename M>
663  {};
664 
665  template <typename M>
667  {};
668 
669  template <typename M>
671  {};
672 
673  template <typename M>
675  {};
676 
677  template <typename M>
679  {};
680 
681  template <typename M>
683  {};
684 
685  template <typename M>
687  {};
688 
689  template <typename M>
691  {};
692 
693  template <typename M>
695  {};
696 
697  template <typename M>
699  {};
700 
701  template <typename M>
703  {};
704 
705  template <typename M>
707  {};
708 
709  template <typename M>
711  {};
712 
713  template <typename M>
714 
717  {
718  return MatrixRow<M>(e(), i);
719  }
720 
721  template <typename M>
722  MatrixRow<const M>
724  {
725  return MatrixRow<const M>(e(), i);
726  }
727 
728  template <typename M>
729  MatrixColumn<M>
731  {
732  return MatrixColumn<M>(e(), j);
733  }
734 
735  template <typename M>
736  MatrixColumn<const M>
738  {
739  return MatrixColumn<const M>(e(), j);
740  }
741 
742  template <typename E>
743  MatrixRange<E>
745  const typename MatrixRange<E>::RangeType& r1,
746  const typename MatrixRange<E>::RangeType& r2)
747  {
748  return MatrixRange<E>(e(), r1, r2);
749  }
750 
751  template <typename E>
752  MatrixRange<const E>
754  const typename MatrixRange<const E>::RangeType& r1,
755  const typename MatrixRange<const E>::RangeType& r2)
756  {
757  return MatrixRange<const E>(e(), r1, r2);
758  }
759 
760  template <typename E>
761  MatrixRange<E>
763  typename MatrixRange<E>::RangeType::SizeType start1,
765  typename MatrixRange<E>::RangeType::SizeType start2,
767  {
768  typedef typename MatrixRange<E>::RangeType RangeType;
769 
770  return MatrixRange<E>(e(), RangeType(start1, stop1), RangeType(start2, stop2));
771  }
772 
773  template <typename E>
774  MatrixRange<const E>
780  {
781  typedef typename MatrixRange<const E>::RangeType RangeType;
782 
783  return MatrixRange<const E>(e(), RangeType(start1, stop1), RangeType(start2, stop2));
784  }
785 
786  template <typename E>
787  MatrixSlice<E>
789  const typename MatrixSlice<E>::SliceType& s1,
790  const typename MatrixSlice<E>::SliceType& s2)
791  {
792  return MatrixSlice<E>(e(), s1, s2);
793  }
794 
795  template <typename E>
796  MatrixSlice<const E>
798  const typename MatrixSlice<const E>::SliceType& s1,
799  const typename MatrixSlice<const E>::SliceType& s2)
800  {
801  return MatrixSlice<const E>(e(), s1, s2);
802  }
803 
804  template <typename E>
805  MatrixSlice<E>
807  typename MatrixSlice<E>::SliceType::SizeType start1,
810  typename MatrixSlice<E>::SliceType::SizeType start2,
813  {
814  typedef typename MatrixSlice<E>::SliceType SliceType;
815 
816  return MatrixSlice<E>(e(), SliceType(start1, stride1, size1), SliceType(start2, stride2, size2));
817  }
818 
819  template <typename E>
820  MatrixSlice<const E>
828  {
829  typedef typename MatrixSlice<const E>::SliceType SliceType;
830 
831  return MatrixSlice<const E>(e(), SliceType(start1, stride1, size1), SliceType(start2, stride2, size2));
832  }
833  } // namespace Math
834 } // namespace CDPL
835 
836 #endif // CDPL_MATH_MATRIXPROXY_HPP
CDPL::Math::MatrixColumn::operator()
ConstReference operator()(SizeType i) const
Definition: MatrixProxy.hpp:223
CDPL::Math::MatrixSlice::operator=
MatrixSlice & operator=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:577
CDPL::Math::MatrixRow::plusAssign
MatrixRow & plusAssign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:165
CDPL::Math::MatrixSlice::operator-=
MatrixSlice & operator-=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:591
CDPL::Math::VectorTemporaryTraits
Definition: TypeTraits.hpp:179
CDPL::Math::MatrixColumn::swap
friend void swap(MatrixColumn &c1, MatrixColumn &c2)
Definition: MatrixProxy.hpp:331
CDPL::Math::MatrixColumn::getData
MatrixClosureType & getData()
Definition: MatrixProxy.hpp:253
CDPL::Math::vectorSwap
void vectorSwap(V &v, VectorExpression< E > &e)
Definition: VectorAssignment.hpp:72
VectorAssignment.hpp
Implementation of vector assignment routines.
CDPL::Math::MatrixSlice::getData
const MatrixClosureType & getData() const
Definition: MatrixProxy.hpp:565
CDPL::Math::MatrixSlice::swap
void swap(MatrixSlice &s)
Definition: MatrixProxy.hpp:632
CDPL::Math::MatrixColumn::assign
MatrixColumn & assign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:305
CDPL::Math::MatrixSlice::getData
MatrixClosureType & getData()
Definition: MatrixProxy.hpp:560
CDPL::Math::MatrixRow::isEmpty
bool isEmpty() const
Definition: MatrixProxy.hpp:101
CDPL::Math::MatrixColumn::getSize
SizeType getSize() const
Definition: MatrixProxy.hpp:243
CDPL::Math::MatrixSlice::getStride2
DifferenceType getStride2() const
Definition: MatrixProxy.hpp:540
CDPL::Math::MatrixRow::operator[]
ConstReference operator[](SizeType i) const
Definition: MatrixProxy.hpp:86
CDPL::Math::MatrixRange::operator=
MatrixRange & operator=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:418
CDPL::Math::MatrixSlice::Reference
std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type Reference
Definition: MatrixProxy.hpp:504
CDPL::Math::MatrixColumn::getData
const MatrixClosureType & getData() const
Definition: MatrixProxy.hpp:258
CDPL::Math::MatrixSlice::MatrixClosureType
std::conditional< std::is_const< M >::value, typename M::ConstClosureType, typename M::ClosureType >::type MatrixClosureType
Definition: MatrixProxy.hpp:507
CDPL::Math::MatrixRange::operator-=
MatrixRange & operator-=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:432
CDPL::Math::MatrixRange::SizeType
M::SizeType SizeType
Definition: MatrixProxy.hpp:349
CDPL::Math::column
MatrixColumn< M > column(MatrixExpression< M > &e, typename MatrixColumn< M >::SizeType j)
Definition: MatrixProxy.hpp:730
CDPL::Math::MatrixRange::Reference
std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type Reference
Definition: MatrixProxy.hpp:355
CDPL::Math::VectorExpression
Definition: Expression.hpp:54
CDPL::Math::MatrixRange::getData
const MatrixClosureType & getData() const
Definition: MatrixProxy.hpp:406
CDPL::Math::MatrixRow::ClosureType
SelfType ClosureType
Definition: MatrixProxy.hpp:66
CDPL::Math::MatrixRange::operator=
MatrixRange & operator=(const MatrixRange &r)
Definition: MatrixProxy.hpp:411
CDPL::Math::MatrixRange::getStart2
SizeType getStart2() const
Definition: MatrixProxy.hpp:381
CDPL::Math::MatrixColumn::minusAssign
MatrixColumn & minusAssign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:319
CDPL::Math::MatrixSlice::operator*=
std::enable_if< IsScalar< T >::value, MatrixSlice >::type & operator*=(const T &t)
Definition: MatrixProxy.hpp:598
CDPL::Math::MatrixColumn::operator()
Reference operator()(SizeType i)
Definition: MatrixProxy.hpp:218
CDPL::Math::MatrixColumn::operator+=
MatrixColumn & operator+=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:277
CDPL::Math::MatrixSlice::operator()
ConstReference operator()(SizeType i, SizeType j) const
Definition: MatrixProxy.hpp:520
CDPL::Math::MatrixSlice::operator+=
MatrixSlice & operator+=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:584
CDPL::Math::Range< SizeType >
CDPL::Math::MatrixSlice::MatrixSlice
MatrixSlice(MatrixType &m, const SliceType &s1, const SliceType &s2)
Definition: MatrixProxy.hpp:512
CDPL::Math::MatrixSlice::ConstClosureType
const SelfType ConstClosureType
Definition: MatrixProxy.hpp:508
CDPL::Math::MatrixSlice::SliceType
Slice< SizeType, DifferenceType > SliceType
Definition: MatrixProxy.hpp:510
CDPL::Math::MatrixSlice::plusAssign
MatrixSlice & plusAssign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:619
CDPL::Math::MatrixRow::SizeType
M::SizeType SizeType
Definition: MatrixProxy.hpp:55
CDPL::Math::MatrixRange::RangeType
Range< SizeType > RangeType
Definition: MatrixProxy.hpp:361
CDPL::Math::MatrixSlice::getStart1
SizeType getStart1() const
Definition: MatrixProxy.hpp:525
CDPL::Math::MatrixRange::ConstReference
M::ConstReference ConstReference
Definition: MatrixProxy.hpp:352
CDPL::Math::MatrixColumn::MatrixType
M MatrixType
Definition: MatrixProxy.hpp:201
CDPL::Math::MatrixExpression
Definition: Expression.hpp:76
CDPL::Math::slice
MatrixSlice< E > slice(MatrixExpression< E > &e, const typename MatrixSlice< E >::SliceType &s1, const typename MatrixSlice< E >::SliceType &s2)
Definition: MatrixProxy.hpp:788
CDPL::Math::MatrixRange::operator*=
std::enable_if< IsScalar< T >::value, MatrixRange >::type & operator*=(const T &t)
Definition: MatrixProxy.hpp:439
CDPL::Math::MatrixRow::assign
MatrixRow & assign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:158
CDPL::Math::MatrixColumn::operator=
MatrixColumn & operator=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:270
CDPL::Math::MatrixSlice::getStride1
DifferenceType getStride1() const
Definition: MatrixProxy.hpp:535
CDPL::Math::MatrixRow::minusAssign
MatrixRow & minusAssign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:172
CDPL::Math::MatrixColumn::SizeType
M::SizeType SizeType
Definition: MatrixProxy.hpp:202
CDPL::Math::MatrixColumn::MatrixClosureType
std::conditional< std::is_const< M >::value, typename M::ConstClosureType, typename M::ClosureType >::type MatrixClosureType
Definition: MatrixProxy.hpp:211
CDPL::Math::MatrixSlice::assign
MatrixSlice & assign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:612
CDPL::Math::MatrixRange::minusAssign
MatrixRange & minusAssign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:467
CDPL::Math::MatrixSlice::getStart2
SizeType getStart2() const
Definition: MatrixProxy.hpp:530
CDPL::Math::MatrixRow::operator[]
Reference operator[](SizeType i)
Definition: MatrixProxy.hpp:81
CDPL::Math::MatrixRow::ConstClosureType
const SelfType ConstClosureType
Definition: MatrixProxy.hpp:65
CDPL::Math::MatrixRange::operator()
Reference operator()(SizeType i, SizeType j)
Definition: MatrixProxy.hpp:366
CDPL::Math::MatrixColumn::ClosureType
SelfType ClosureType
Definition: MatrixProxy.hpp:213
CDPL::Math::MatrixSlice::ValueType
M::ValueType ValueType
Definition: MatrixProxy.hpp:500
CDPL::Math::Slice< SizeType, DifferenceType >
CDPL::Math::MatrixRange::assign
MatrixRange & assign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:453
CDPL::Math::MatrixColumn::MatrixColumn
MatrixColumn(MatrixType &m, SizeType i)
Definition: MatrixProxy.hpp:215
CDPL::Math::MatrixRange::MatrixRange
MatrixRange(MatrixType &m, const RangeType &r1, const RangeType &r2)
Definition: MatrixProxy.hpp:363
CDPL::Math::MatrixSlice::operator()
Reference operator()(SizeType i, SizeType j)
Definition: MatrixProxy.hpp:515
CDPL::Math::MatrixColumn::operator=
MatrixColumn & operator=(const MatrixColumn &c)
Definition: MatrixProxy.hpp:263
CDPL::Math::MatrixRow::operator*=
std::enable_if< IsScalar< T >::value, MatrixRow >::type & operator*=(const T &t)
Definition: MatrixProxy.hpp:144
CDPL::Math::MatrixSlice::isEmpty
bool isEmpty() const
Definition: MatrixProxy.hpp:555
CDPL::Math::MatrixColumn::ConstReference
M::ConstReference ConstReference
Definition: MatrixProxy.hpp:205
CDPL::Math::MatrixRow::getData
const MatrixClosureType & getData() const
Definition: MatrixProxy.hpp:111
CDPL::Math::MatrixRow
Definition: MatrixProxy.hpp:49
CDPL::Math::MatrixColumn
Definition: MatrixProxy.hpp:196
CDPL::Math::Range< SizeType >::SizeType
SizeType SizeType
Definition: Range.hpp:50
CDPL::Chem::AtomType::M
const unsigned int M
A generic type that covers any element that is a metal.
Definition: AtomType.hpp:637
CDPL::Math::MatrixSlice::MatrixType
M MatrixType
Definition: MatrixProxy.hpp:497
CDPL::Math::MatrixRange::getSize2
SizeType getSize2() const
Definition: MatrixProxy.hpp:391
TypeTraits.hpp
Definition of type traits.
CDPL::Math::MatrixRow::MatrixRow
MatrixRow(MatrixType &m, SizeType i)
Definition: MatrixProxy.hpp:68
CDPL::Math::MatrixRow::operator()
ConstReference operator()(SizeType i) const
Definition: MatrixProxy.hpp:76
CDPL::Math::MatrixRange::operator+=
MatrixRange & operator+=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:425
CDPL::Math::MatrixRow::ValueType
M::ValueType ValueType
Definition: MatrixProxy.hpp:57
CDPL::Math::MatrixRow::DifferenceType
M::DifferenceType DifferenceType
Definition: MatrixProxy.hpp:56
CDPL::Math::MatrixColumn::operator/=
std::enable_if< IsScalar< T >::value, MatrixColumn >::type & operator/=(const T &t)
Definition: MatrixProxy.hpp:298
CDPL::Math::MatrixSlice::ConstReference
M::ConstReference ConstReference
Definition: MatrixProxy.hpp:501
Functional.hpp
Definition of various functors.
CDPL::Math::MatrixTemporaryTraits::Type
M::MatrixTemporaryType Type
Definition: TypeTraits.hpp:188
CDPL::Math::MatrixColumn::DifferenceType
M::DifferenceType DifferenceType
Definition: MatrixProxy.hpp:203
CDPL::Math::MatrixRow::Reference
std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type Reference
Definition: MatrixProxy.hpp:61
CDPL::Chem::CIPDescriptor::m
const unsigned int m
Specifies that the stereocenter has m configuration.
Definition: CIPDescriptor.hpp:116
CDPL::Math::MatrixTemporaryTraits
Definition: TypeTraits.hpp:186
MatrixAssignment.hpp
Implementation of matrix assignment routines.
CDPL::Math::MatrixRow::operator/=
std::enable_if< IsScalar< T >::value, MatrixRow >::type & operator/=(const T &t)
Definition: MatrixProxy.hpp:151
CDPL::Math::MatrixColumn::operator[]
ConstReference operator[](SizeType i) const
Definition: MatrixProxy.hpp:233
CDPL::Math::MatrixSlice::minusAssign
MatrixSlice & minusAssign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:626
CDPL::Math::MatrixColumn::Reference
std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type Reference
Definition: MatrixProxy.hpp:208
CDPL::Math::MatrixRow::operator()
Reference operator()(SizeType i)
Definition: MatrixProxy.hpp:71
CDPL::Math::MatrixSlice::ClosureType
SelfType ClosureType
Definition: MatrixProxy.hpp:509
CDPL::Math::MatrixRange::MatrixType
M MatrixType
Definition: MatrixProxy.hpp:348
CDPL::Math::Slice< SizeType, DifferenceType >::SizeType
SizeType SizeType
Definition: Slice.hpp:50
CDPL::Chem::AtomType::T
const unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
CDPL::Math::MatrixRange::DifferenceType
M::DifferenceType DifferenceType
Definition: MatrixProxy.hpp:350
CDPL::Chem::CIPDescriptor::s
const unsigned int s
Specifies that the stereocenter has s configuration.
Definition: CIPDescriptor.hpp:81
CDPL::Chem::CIPDescriptor::r
const unsigned int r
Specifies that the stereocenter has r configuration.
Definition: CIPDescriptor.hpp:76
CDPL::Math::Slice::getStride
DifferenceType getStride() const
Definition: Slice.hpp:73
CDPL::Math::Slice::getStart
SizeType getStart() const
Definition: Slice.hpp:68
CDPL::Math::MatrixColumn::getIndex
SizeType getIndex() const
Definition: MatrixProxy.hpp:238
CDPL::Math::MatrixColumn::swap
void swap(MatrixColumn &c)
Definition: MatrixProxy.hpp:325
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Math::MatrixRow::operator=
MatrixRow & operator=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:123
CDPL::Math::Slice< SizeType, DifferenceType >::DifferenceType
DifferenceType DifferenceType
Definition: Slice.hpp:51
CDPL::Math::MatrixColumn::ValueType
M::ValueType ValueType
Definition: MatrixProxy.hpp:204
CDPL::Math::MatrixColumn::operator*=
std::enable_if< IsScalar< T >::value, MatrixColumn >::type & operator*=(const T &t)
Definition: MatrixProxy.hpp:291
CDPL::Math::MatrixColumn::ConstClosureType
const SelfType ConstClosureType
Definition: MatrixProxy.hpp:212
CDPL::Math::MatrixSlice::getSize2
SizeType getSize2() const
Definition: MatrixProxy.hpp:550
CDPL::Math::MatrixRow::ConstReference
M::ConstReference ConstReference
Definition: MatrixProxy.hpp:58
CDPL::Math::MatrixSlice::getSize1
SizeType getSize1() const
Definition: MatrixProxy.hpp:545
CDPL::Math::MatrixSlice::SizeType
M::SizeType SizeType
Definition: MatrixProxy.hpp:498
CDPL::Math::MatrixRange::ConstClosureType
const SelfType ConstClosureType
Definition: MatrixProxy.hpp:359
CDPL::Math::MatrixRange::ClosureType
SelfType ClosureType
Definition: MatrixProxy.hpp:360
CDPL::Math::MatrixRange::swap
friend void swap(MatrixRange &r1, MatrixRange &r2)
Definition: MatrixProxy.hpp:479
CDPL::Math::MatrixColumn::operator-=
MatrixColumn & operator-=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:284
CDPL::Math::MatrixRange::swap
void swap(MatrixRange &r)
Definition: MatrixProxy.hpp:473
CDPL::Math::MatrixSlice::operator/=
std::enable_if< IsScalar< T >::value, MatrixSlice >::type & operator/=(const T &t)
Definition: MatrixProxy.hpp:605
CDPL::Math::row
MatrixRow< M > row(MatrixExpression< M > &e, typename MatrixRow< M >::SizeType i)
Definition: MatrixProxy.hpp:716
CDPL::Math::MatrixRange::isEmpty
bool isEmpty() const
Definition: MatrixProxy.hpp:396
CDPL::Math::MatrixRow::MatrixClosureType
std::conditional< std::is_const< M >::value, typename M::ConstClosureType, typename M::ClosureType >::type MatrixClosureType
Definition: MatrixProxy.hpp:64
CDPL::Math::MatrixRange::ValueType
M::ValueType ValueType
Definition: MatrixProxy.hpp:351
CDPL::Math::MatrixRow::getIndex
SizeType getIndex() const
Definition: MatrixProxy.hpp:91
CDPL::Math::Range::getSize
SizeType getSize() const
Definition: Range.hpp:77
Slice.hpp
Definition of a data type for describing index slices.
CDPL::Math::MatrixSlice::operator=
MatrixSlice & operator=(const MatrixSlice &s)
Definition: MatrixProxy.hpp:570
CDPL::Math::MatrixSlice::swap
friend void swap(MatrixSlice &s1, MatrixSlice &s2)
Definition: MatrixProxy.hpp:638
CDPL::Math::MatrixRow::swap
void swap(MatrixRow &r)
Definition: MatrixProxy.hpp:178
CDPL::Math::MatrixRow::getData
MatrixClosureType & getData()
Definition: MatrixProxy.hpp:106
CDPL::Math::matrixSwap
void matrixSwap(M &m, MatrixExpression< E > &e)
Definition: MatrixAssignment.hpp:76
CDPL::Math::MatrixColumn::operator[]
Reference operator[](SizeType i)
Definition: MatrixProxy.hpp:228
CDPL::Math::MatrixRow::operator=
MatrixRow & operator=(const MatrixRow &r)
Definition: MatrixProxy.hpp:116
CDPL::Math::MatrixRow::swap
friend void swap(MatrixRow &r1, MatrixRow &r2)
Definition: MatrixProxy.hpp:184
Expression.hpp
Definition of basic expression types.
CDPL::Math::range
MatrixRange< E > range(MatrixExpression< E > &e, const typename MatrixRange< E >::RangeType &r1, const typename MatrixRange< E >::RangeType &r2)
Definition: MatrixProxy.hpp:744
CDPL::Math::MatrixSlice::DifferenceType
M::DifferenceType DifferenceType
Definition: MatrixProxy.hpp:499
CDPL::Math::MatrixRange::getSize1
SizeType getSize1() const
Definition: MatrixProxy.hpp:386
CDPL::Math::MatrixRow::operator+=
MatrixRow & operator+=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:130
CDPL::Math::MatrixRow::getSize
SizeType getSize() const
Definition: MatrixProxy.hpp:96
Range.hpp
Definition of a data type for describing index ranges.
CDPL::Math::MatrixSlice
Definition: MatrixProxy.hpp:492
CDPL::Math::MatrixRange::operator()
ConstReference operator()(SizeType i, SizeType j) const
Definition: MatrixProxy.hpp:371
CDPL::Math::Slice::getSize
SizeType getSize() const
Definition: Slice.hpp:78
CDPL::Math::MatrixRow::operator-=
MatrixRow & operator-=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:137
CDPL::Math::MatrixColumn::plusAssign
MatrixColumn & plusAssign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:312
CDPL::Math::MatrixRange::operator/=
std::enable_if< IsScalar< T >::value, MatrixRange >::type & operator/=(const T &t)
Definition: MatrixProxy.hpp:446
CDPL::Math::MatrixRange::plusAssign
MatrixRange & plusAssign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:460
CDPL::Math::MatrixRow::MatrixType
M MatrixType
Definition: MatrixProxy.hpp:54
CDPL::Math::MatrixRange::MatrixClosureType
std::conditional< std::is_const< M >::value, typename M::ConstClosureType, typename M::ClosureType >::type MatrixClosureType
Definition: MatrixProxy.hpp:358
CDPL::Math::MatrixRange::getStart1
SizeType getStart1() const
Definition: MatrixProxy.hpp:376
CDPL::Math::MatrixRange
Definition: MatrixProxy.hpp:343
CDPL::Math::MatrixColumn::isEmpty
bool isEmpty() const
Definition: MatrixProxy.hpp:248
CDPL::Math::MatrixRange::getData
MatrixClosureType & getData()
Definition: MatrixProxy.hpp:401
CDPL::Math::Range::getStart
SizeType getStart() const
Definition: Range.hpp:67