Chemical Data Processing Library C++ API - Version 1.2.0
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
Definition of basic expression types.
Definition of various functors.
Implementation of matrix assignment routines.
Definition of a data type for describing index ranges.
Definition of a data type for describing index slices.
Definition of type traits.
Implementation of vector assignment routines.
Definition: MatrixProxy.hpp:196
friend void swap(MatrixColumn &c1, MatrixColumn &c2)
Definition: MatrixProxy.hpp:331
M::ConstReference ConstReference
Definition: MatrixProxy.hpp:205
MatrixColumn & operator+=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:277
MatrixColumn & assign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:305
std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type Reference
Definition: MatrixProxy.hpp:208
ConstReference operator[](SizeType i) const
Definition: MatrixProxy.hpp:233
std::enable_if< IsScalar< T >::value, MatrixColumn >::type & operator*=(const T &t)
Definition: MatrixProxy.hpp:291
SelfType ClosureType
Definition: MatrixProxy.hpp:213
void swap(MatrixColumn &c)
Definition: MatrixProxy.hpp:325
M::SizeType SizeType
Definition: MatrixProxy.hpp:202
MatrixColumn & operator=(const MatrixColumn &c)
Definition: MatrixProxy.hpp:263
MatrixColumn & plusAssign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:312
SizeType getIndex() const
Definition: MatrixProxy.hpp:238
MatrixColumn & operator=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:270
ConstReference operator()(SizeType i) const
Definition: MatrixProxy.hpp:223
MatrixColumn & minusAssign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:319
const SelfType ConstClosureType
Definition: MatrixProxy.hpp:212
MatrixColumn(MatrixType &m, SizeType i)
Definition: MatrixProxy.hpp:215
Reference operator[](SizeType i)
Definition: MatrixProxy.hpp:228
M MatrixType
Definition: MatrixProxy.hpp:201
M::ValueType ValueType
Definition: MatrixProxy.hpp:204
const MatrixClosureType & getData() const
Definition: MatrixProxy.hpp:258
std::conditional< std::is_const< M >::value, typename M::ConstClosureType, typename M::ClosureType >::type MatrixClosureType
Definition: MatrixProxy.hpp:211
MatrixClosureType & getData()
Definition: MatrixProxy.hpp:253
bool isEmpty() const
Definition: MatrixProxy.hpp:248
SizeType getSize() const
Definition: MatrixProxy.hpp:243
M::DifferenceType DifferenceType
Definition: MatrixProxy.hpp:203
std::enable_if< IsScalar< T >::value, MatrixColumn >::type & operator/=(const T &t)
Definition: MatrixProxy.hpp:298
Reference operator()(SizeType i)
Definition: MatrixProxy.hpp:218
MatrixColumn & operator-=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:284
Definition: Expression.hpp:76
Definition: MatrixProxy.hpp:343
M::SizeType SizeType
Definition: MatrixProxy.hpp:349
MatrixRange & operator=(const MatrixRange &r)
Definition: MatrixProxy.hpp:411
const MatrixClosureType & getData() const
Definition: MatrixProxy.hpp:406
std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type Reference
Definition: MatrixProxy.hpp:355
std::conditional< std::is_const< M >::value, typename M::ConstClosureType, typename M::ClosureType >::type MatrixClosureType
Definition: MatrixProxy.hpp:358
MatrixRange & operator-=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:432
SizeType getStart1() const
Definition: MatrixProxy.hpp:376
SizeType getSize2() const
Definition: MatrixProxy.hpp:391
M MatrixType
Definition: MatrixProxy.hpp:348
MatrixRange & assign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:453
MatrixRange & operator+=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:425
SizeType getStart2() const
Definition: MatrixProxy.hpp:381
Range< SizeType > RangeType
Definition: MatrixProxy.hpp:361
M::ConstReference ConstReference
Definition: MatrixProxy.hpp:352
M::ValueType ValueType
Definition: MatrixProxy.hpp:351
friend void swap(MatrixRange &r1, MatrixRange &r2)
Definition: MatrixProxy.hpp:479
ConstReference operator()(SizeType i, SizeType j) const
Definition: MatrixProxy.hpp:371
Reference operator()(SizeType i, SizeType j)
Definition: MatrixProxy.hpp:366
M::DifferenceType DifferenceType
Definition: MatrixProxy.hpp:350
SelfType ClosureType
Definition: MatrixProxy.hpp:360
SizeType getSize1() const
Definition: MatrixProxy.hpp:386
void swap(MatrixRange &r)
Definition: MatrixProxy.hpp:473
std::enable_if< IsScalar< T >::value, MatrixRange >::type & operator*=(const T &t)
Definition: MatrixProxy.hpp:439
std::enable_if< IsScalar< T >::value, MatrixRange >::type & operator/=(const T &t)
Definition: MatrixProxy.hpp:446
MatrixRange & plusAssign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:460
bool isEmpty() const
Definition: MatrixProxy.hpp:396
MatrixRange & operator=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:418
const SelfType ConstClosureType
Definition: MatrixProxy.hpp:359
MatrixClosureType & getData()
Definition: MatrixProxy.hpp:401
MatrixRange(MatrixType &m, const RangeType &r1, const RangeType &r2)
Definition: MatrixProxy.hpp:363
MatrixRange & minusAssign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:467
Definition: MatrixProxy.hpp:49
MatrixRow & operator=(const MatrixRow &r)
Definition: MatrixProxy.hpp:116
std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type Reference
Definition: MatrixProxy.hpp:61
MatrixRow & operator+=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:130
M::DifferenceType DifferenceType
Definition: MatrixProxy.hpp:56
std::conditional< std::is_const< M >::value, typename M::ConstClosureType, typename M::ClosureType >::type MatrixClosureType
Definition: MatrixProxy.hpp:64
M MatrixType
Definition: MatrixProxy.hpp:54
ConstReference operator[](SizeType i) const
Definition: MatrixProxy.hpp:86
MatrixRow & assign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:158
MatrixRow & operator=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:123
std::enable_if< IsScalar< T >::value, MatrixRow >::type & operator*=(const T &t)
Definition: MatrixProxy.hpp:144
MatrixRow(MatrixType &m, SizeType i)
Definition: MatrixProxy.hpp:68
const MatrixClosureType & getData() const
Definition: MatrixProxy.hpp:111
M::ConstReference ConstReference
Definition: MatrixProxy.hpp:58
SizeType getSize() const
Definition: MatrixProxy.hpp:96
ConstReference operator()(SizeType i) const
Definition: MatrixProxy.hpp:76
MatrixRow & operator-=(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:137
M::SizeType SizeType
Definition: MatrixProxy.hpp:55
Reference operator()(SizeType i)
Definition: MatrixProxy.hpp:71
void swap(MatrixRow &r)
Definition: MatrixProxy.hpp:178
SizeType getIndex() const
Definition: MatrixProxy.hpp:91
const SelfType ConstClosureType
Definition: MatrixProxy.hpp:65
M::ValueType ValueType
Definition: MatrixProxy.hpp:57
MatrixRow & minusAssign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:172
friend void swap(MatrixRow &r1, MatrixRow &r2)
Definition: MatrixProxy.hpp:184
SelfType ClosureType
Definition: MatrixProxy.hpp:66
MatrixClosureType & getData()
Definition: MatrixProxy.hpp:106
bool isEmpty() const
Definition: MatrixProxy.hpp:101
std::enable_if< IsScalar< T >::value, MatrixRow >::type & operator/=(const T &t)
Definition: MatrixProxy.hpp:151
MatrixRow & plusAssign(const VectorExpression< E > &e)
Definition: MatrixProxy.hpp:165
Reference operator[](SizeType i)
Definition: MatrixProxy.hpp:81
Definition: MatrixProxy.hpp:492
const SelfType ConstClosureType
Definition: MatrixProxy.hpp:508
SizeType getSize2() const
Definition: MatrixProxy.hpp:550
MatrixSlice & operator=(const MatrixSlice &s)
Definition: MatrixProxy.hpp:570
MatrixSlice & operator-=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:591
MatrixClosureType & getData()
Definition: MatrixProxy.hpp:560
std::enable_if< IsScalar< T >::value, MatrixSlice >::type & operator*=(const T &t)
Definition: MatrixProxy.hpp:598
MatrixSlice & operator=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:577
MatrixSlice & assign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:612
SizeType getStart2() const
Definition: MatrixProxy.hpp:530
Slice< SizeType, DifferenceType > SliceType
Definition: MatrixProxy.hpp:510
friend void swap(MatrixSlice &s1, MatrixSlice &s2)
Definition: MatrixProxy.hpp:638
M::DifferenceType DifferenceType
Definition: MatrixProxy.hpp:499
const MatrixClosureType & getData() const
Definition: MatrixProxy.hpp:565
M MatrixType
Definition: MatrixProxy.hpp:497
MatrixSlice(MatrixType &m, const SliceType &s1, const SliceType &s2)
Definition: MatrixProxy.hpp:512
Reference operator()(SizeType i, SizeType j)
Definition: MatrixProxy.hpp:515
M::ConstReference ConstReference
Definition: MatrixProxy.hpp:501
MatrixSlice & plusAssign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:619
M::ValueType ValueType
Definition: MatrixProxy.hpp:500
void swap(MatrixSlice &s)
Definition: MatrixProxy.hpp:632
M::SizeType SizeType
Definition: MatrixProxy.hpp:498
bool isEmpty() const
Definition: MatrixProxy.hpp:555
DifferenceType getStride1() const
Definition: MatrixProxy.hpp:535
std::conditional< std::is_const< M >::value, typename M::ConstClosureType, typename M::ClosureType >::type MatrixClosureType
Definition: MatrixProxy.hpp:507
SizeType getSize1() const
Definition: MatrixProxy.hpp:545
SizeType getStart1() const
Definition: MatrixProxy.hpp:525
DifferenceType getStride2() const
Definition: MatrixProxy.hpp:540
MatrixSlice & operator+=(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:584
MatrixSlice & minusAssign(const MatrixExpression< E > &e)
Definition: MatrixProxy.hpp:626
ConstReference operator()(SizeType i, SizeType j) const
Definition: MatrixProxy.hpp:520
std::enable_if< IsScalar< T >::value, MatrixSlice >::type & operator/=(const T &t)
Definition: MatrixProxy.hpp:605
std::conditional< std::is_const< M >::value, typename M::ConstReference, typename M::Reference >::type Reference
Definition: MatrixProxy.hpp:504
SelfType ClosureType
Definition: MatrixProxy.hpp:509
SizeType getStart() const
Definition: Range.hpp:67
SizeType getSize() const
Definition: Range.hpp:77
SizeType SizeType
Definition: Range.hpp:50
SizeType SizeType
Definition: Slice.hpp:50
SizeType getStart() const
Definition: Slice.hpp:68
SizeType getSize() const
Definition: Slice.hpp:78
DifferenceType getStride() const
Definition: Slice.hpp:73
DifferenceType DifferenceType
Definition: Slice.hpp:51
Definition: Expression.hpp:54
constexpr unsigned int M
A generic type that covers any element that is a metal.
Definition: AtomType.hpp:657
constexpr unsigned int T
Specifies Hydrogen (Tritium).
Definition: AtomType.hpp:67
constexpr unsigned int r
Specifies that the stereocenter has r configuration.
Definition: CIPDescriptor.hpp:76
constexpr unsigned int s
Specifies that the stereocenter has s configuration.
Definition: CIPDescriptor.hpp:81
constexpr unsigned int m
Specifies that the stereocenter has m configuration.
Definition: CIPDescriptor.hpp:116
MatrixSlice< E > slice(MatrixExpression< E > &e, const typename MatrixSlice< E >::SliceType &s1, const typename MatrixSlice< E >::SliceType &s2)
Definition: MatrixProxy.hpp:788
MatrixColumn< M > column(MatrixExpression< M > &e, typename MatrixColumn< M >::SizeType j)
Definition: MatrixProxy.hpp:730
MatrixRow< M > row(MatrixExpression< M > &e, typename MatrixRow< M >::SizeType i)
Definition: MatrixProxy.hpp:716
void vectorSwap(V &v, VectorExpression< E > &e)
Definition: VectorAssignment.hpp:72
MatrixRange< E > range(MatrixExpression< E > &e, const typename MatrixRange< E >::RangeType &r1, const typename MatrixRange< E >::RangeType &r2)
Definition: MatrixProxy.hpp:744
void matrixSwap(M &m, MatrixExpression< E > &e)
Definition: MatrixAssignment.hpp:76
The namespace of the Chemical Data Processing Library.
Definition: TypeTraits.hpp:186
M::MatrixTemporaryType Type
Definition: TypeTraits.hpp:188
Definition: TypeTraits.hpp:179