Proxy.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_PROXY_PROXY_H_
36 #define _BLAZE_MATH_PROXY_PROXY_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
52 #include <blaze/math/shims/IsNaN.h>
53 #include <blaze/math/shims/IsOne.h>
56 #include <blaze/math/shims/Real.h>
71 #include <blaze/util/DisableIf.h>
72 #include <blaze/util/Exception.h>
73 #include <blaze/util/mpl/If.h>
75 
76 
77 namespace blaze {
78 
79 //=================================================================================================
80 //
81 // CLASS DEFINITION
82 //
83 //=================================================================================================
84 
85 //*************************************************************************************************
117 template< typename PT // Type of the proxy
118  , typename RT = int > // Type of the represented element
119 class Proxy : public If< IsVector<RT>
120  , typename If< IsDenseVector<RT>
121  , DenseVectorProxy<PT,RT>
122  , SparseVectorProxy<PT,RT>
123  >::Type
124  , typename If< IsMatrix<RT>
125  , typename If< IsDenseMatrix<RT>
126  , DenseMatrixProxy<PT,RT>
127  , SparseMatrixProxy<PT,RT>
128  >::Type
129  , typename If< IsComplex<RT>
130  , ComplexProxy<PT,RT>
131  , DefaultProxy<PT,RT>
132  >::Type
133  >::Type
134  >::Type
135 {};
136 //*************************************************************************************************
137 
138 
139 
140 
141 //=================================================================================================
142 //
143 // GLOBAL OPERATORS
144 //
145 //=================================================================================================
146 
147 //*************************************************************************************************
150 template< typename PT1, typename RT1, typename PT2, typename RT2 >
151 inline typename AddExprTrait<RT1,RT2>::Type
152  operator+( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
153 
154 template< typename PT, typename RT, typename T >
155 inline typename DisableIf< IsProxy<T>, typename AddExprTrait<RT,T>::Type >::Type
156  operator+( const Proxy<PT,RT>& lhs, const T& rhs );
157 
158 template< typename T, typename PT, typename RT >
159 inline typename DisableIf< IsProxy<T>, typename AddExprTrait<T,RT>::Type >::Type
160  operator+( const T& lhs, const Proxy<PT,RT>& rhs );
161 
162 template< typename PT1, typename RT1, typename PT2, typename RT2 >
163 inline typename SubExprTrait<RT1,RT2>::Type
164  operator-( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
165 
166 template< typename PT, typename RT, typename T >
167 inline typename DisableIf< IsProxy<T>, typename SubExprTrait<RT,T>::Type >::Type
168  operator-( const Proxy<PT,RT>& lhs, const T& rhs );
169 
170 template< typename T, typename PT, typename RT >
171 inline typename DisableIf< IsProxy<T>, typename SubExprTrait<T,RT>::Type >::Type
172  operator-( const T& lhs, const Proxy<PT,RT>& rhs );
173 
174 template< typename PT1, typename RT1, typename PT2, typename RT2 >
175 inline typename MultExprTrait<RT1,RT2>::Type
176  operator*( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
177 
178 template< typename PT, typename RT, typename T >
179 inline typename DisableIf< IsProxy<T>, typename MultExprTrait<RT,T>::Type >::Type
180  operator*( const Proxy<PT,RT>& lhs, const T& rhs );
181 
182 template< typename T, typename PT, typename RT >
183 inline typename DisableIf< IsProxy<T>, typename MultExprTrait<T,RT>::Type >::Type
184  operator*( const T& lhs, const Proxy<PT,RT>& rhs );
185 
186 template< typename PT1, typename RT1, typename PT2, typename RT2 >
187 inline typename DivExprTrait<RT1,RT2>::Type
188  operator/( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
189 
190 template< typename PT, typename RT, typename T >
191 inline typename DisableIf< IsProxy<T>, typename DivExprTrait<RT,T>::Type >::Type
192  operator/( const Proxy<PT,RT>& lhs, const T& rhs );
193 
194 template< typename T, typename PT, typename RT >
195 inline typename DisableIf< IsProxy<T>, typename DivExprTrait<T,RT>::Type >::Type
196  operator/( const T& lhs, const Proxy<PT,RT>& rhs );
197 
198 template< typename PT1, typename RT1, typename PT2, typename RT2 >
199 inline bool operator==( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
200 
201 template< typename PT, typename RT, typename T >
202 inline typename DisableIf< IsProxy<T>, bool >::Type
203  operator==( const Proxy<PT,RT>& lhs, const T& rhs );
204 
205 template< typename T, typename PT, typename RT >
206 inline typename DisableIf< IsProxy<T>, bool >::Type
207  operator==( const T& lhs, const Proxy<PT,RT>& rhs );
208 
209 template< typename PT1, typename RT1, typename PT2, typename RT2 >
210 inline bool operator!=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
211 
212 template< typename PT, typename RT, typename T >
213 inline typename DisableIf< IsProxy<T>, bool >::Type
214  operator!=( const Proxy<PT,RT>& lhs, const T& rhs );
215 
216 template< typename T, typename PT, typename RT >
217 inline typename DisableIf< IsProxy<T>, bool >::Type
218  operator!=( const T& lhs, const Proxy<PT,RT>& rhs );
219 
220 template< typename PT1, typename RT1, typename PT2, typename RT2 >
221 inline bool operator<( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
222 
223 template< typename PT, typename RT, typename T >
224 inline typename DisableIf< IsProxy<T>, bool >::Type
225  operator<( const Proxy<PT,RT>& lhs, const T& rhs );
226 
227 template< typename T, typename PT, typename RT >
228 inline typename DisableIf< IsProxy<T>, bool >::Type
229  operator<( const T& lhs, const Proxy<PT,RT>& rhs );
230 
231 template< typename PT1, typename RT1, typename PT2, typename RT2 >
232 inline bool operator>( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
233 
234 template< typename PT, typename RT, typename T >
235 inline typename DisableIf< IsProxy<T>, bool >::Type
236  operator>( const Proxy<PT,RT>& lhs, const T& rhs );
237 
238 template< typename T, typename PT, typename RT >
239 inline typename DisableIf< IsProxy<T>, bool >::Type
240  operator>( const T& lhs, const Proxy<PT,RT>& rhs );
241 
242 template< typename PT1, typename RT1, typename PT2, typename RT2 >
243 inline bool operator<=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
244 
245 template< typename PT, typename RT, typename T >
246 inline typename DisableIf< IsProxy<T>, bool >::Type
247  operator<=( const Proxy<PT,RT>& lhs, const T& rhs );
248 
249 template< typename T, typename PT, typename RT >
250 inline typename DisableIf< IsProxy<T>, bool >::Type
251  operator<=( const T& lhs, const Proxy<PT,RT>& rhs );
252 
253 template< typename PT1, typename RT1, typename PT2, typename RT2 >
254 inline bool operator>=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
255 
256 template< typename PT, typename RT, typename T >
257 inline typename DisableIf< IsProxy<T>, bool >::Type
258  operator>=( const Proxy<PT,RT>& lhs, const T& rhs );
259 
260 template< typename T, typename PT, typename RT >
261 inline typename DisableIf< IsProxy<T>, bool >::Type
262  operator>=( const T& lhs, const Proxy<PT,RT>& rhs );
263 
264 template< typename PT, typename RT >
265 inline std::ostream& operator<<( std::ostream& os, const Proxy<PT,RT>& proxy );
267 //*************************************************************************************************
268 
269 
270 //*************************************************************************************************
278 template< typename PT1, typename RT1, typename PT2, typename RT2 >
279 inline typename AddExprTrait<RT1,RT2>::Type
280  operator+( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
281 {
282  return (~lhs).get() + (~rhs).get();
283 }
284 //*************************************************************************************************
285 
286 
287 //*************************************************************************************************
295 template< typename PT, typename RT, typename T >
296 inline typename DisableIf< IsProxy<T>, typename AddExprTrait<RT,T>::Type >::Type
297  operator+( const Proxy<PT,RT>& lhs, const T& rhs )
298 {
299  return (~lhs).get() + rhs;
300 }
301 //*************************************************************************************************
302 
303 
304 //*************************************************************************************************
312 template< typename T, typename PT, typename RT >
313 inline typename DisableIf< IsProxy<T>, typename AddExprTrait<T,RT>::Type >::Type
314  operator+( const T& lhs, const Proxy<PT,RT>& rhs )
315 {
316  return lhs + (~rhs).get();
317 }
318 //*************************************************************************************************
319 
320 
321 //*************************************************************************************************
329 template< typename PT1, typename RT1, typename PT2, typename RT2 >
330 inline typename SubExprTrait<RT1,RT2>::Type
331  operator-( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
332 {
333  return (~lhs).get() - (~rhs).get();
334 }
335 //*************************************************************************************************
336 
337 
338 //*************************************************************************************************
346 template< typename PT, typename RT, typename T >
347 inline typename DisableIf< IsProxy<T>, typename SubExprTrait<RT,T>::Type >::Type
348  operator-( const Proxy<PT,RT>& lhs, const T& rhs )
349 {
350  return (~lhs).get() - rhs;
351 }
352 //*************************************************************************************************
353 
354 
355 //*************************************************************************************************
363 template< typename T, typename PT, typename RT >
364 inline typename DisableIf< IsProxy<T>, typename SubExprTrait<T,RT>::Type >::Type
365  operator-( const T& lhs, const Proxy<PT,RT>& rhs )
366 {
367  return lhs - (~rhs).get();
368 }
369 //*************************************************************************************************
370 
371 
372 //*************************************************************************************************
380 template< typename PT1, typename RT1, typename PT2, typename RT2 >
381 inline typename MultExprTrait<RT1,RT2>::Type
382  operator*( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
383 {
384  return (~lhs).get() * (~rhs).get();
385 }
386 //*************************************************************************************************
387 
388 
389 //*************************************************************************************************
397 template< typename PT, typename RT, typename T >
398 inline typename DisableIf< IsProxy<T>, typename MultExprTrait<RT,T>::Type >::Type
399  operator*( const Proxy<PT,RT>& lhs, const T& rhs )
400 {
401  return (~lhs).get() * rhs;
402 }
403 //*************************************************************************************************
404 
405 
406 //*************************************************************************************************
414 template< typename T, typename PT, typename RT >
415 inline typename DisableIf< IsProxy<T>, typename MultExprTrait<T,RT>::Type >::Type
416  operator*( const T& lhs, const Proxy<PT,RT>& rhs )
417 {
418  return lhs * (~rhs).get();
419 }
420 //*************************************************************************************************
421 
422 
423 //*************************************************************************************************
431 template< typename PT1, typename RT1, typename PT2, typename RT2 >
432 inline typename DivExprTrait<RT1,RT2>::Type
433  operator/( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
434 {
435  return (~lhs).get() / (~rhs).get();
436 }
437 //*************************************************************************************************
438 
439 
440 //*************************************************************************************************
448 template< typename PT, typename RT, typename T >
449 inline typename DisableIf< IsProxy<T>, typename DivExprTrait<RT,T>::Type >::Type
450  operator/( const Proxy<PT,RT>& lhs, const T& rhs )
451 {
452  return (~lhs).get() / rhs;
453 }
454 //*************************************************************************************************
455 
456 
457 //*************************************************************************************************
465 template< typename T, typename PT, typename RT >
466 inline typename DisableIf< IsProxy<T>, typename DivExprTrait<T,RT>::Type >::Type
467  operator/( const T& lhs, const Proxy<PT,RT>& rhs )
468 {
469  return lhs / (~rhs).get();
470 }
471 //*************************************************************************************************
472 
473 
474 //*************************************************************************************************
482 template< typename PT1, typename RT1, typename PT2, typename RT2 >
483 inline bool operator==( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
484 {
485  return ( (~lhs).get() == (~rhs).get() );
486 }
487 //*************************************************************************************************
488 
489 
490 //*************************************************************************************************
498 template< typename PT, typename RT, typename T >
499 inline typename DisableIf< IsProxy<T>, bool >::Type
500  operator==( const Proxy<PT,RT>& lhs, const T& rhs )
501 {
502  return ( (~lhs).get() == rhs );
503 }
504 //*************************************************************************************************
505 
506 
507 //*************************************************************************************************
515 template< typename T, typename PT, typename RT >
516 inline typename DisableIf< IsProxy<T>, bool >::Type
517  operator==( const T& lhs, const Proxy<PT,RT>& rhs )
518 {
519  return ( lhs == (~rhs).get() );
520 }
521 //*************************************************************************************************
522 
523 
524 //*************************************************************************************************
532 template< typename PT1, typename RT1, typename PT2, typename RT2 >
533 inline bool operator!=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
534 {
535  return ( (~lhs).get() != (~rhs).get() );
536 }
537 //*************************************************************************************************
538 
539 
540 //*************************************************************************************************
548 template< typename PT, typename RT, typename T >
549 inline typename DisableIf< IsProxy<T>, bool >::Type
550  operator!=( const Proxy<PT,RT>& lhs, const T& rhs )
551 {
552  return ( (~lhs).get() != rhs );
553 }
554 //*************************************************************************************************
555 
556 
557 //*************************************************************************************************
565 template< typename T, typename PT, typename RT >
566 inline typename DisableIf< IsProxy<T>, bool >::Type
567  operator!=( const T& lhs, const Proxy<PT,RT>& rhs )
568 {
569  return ( lhs != (~rhs).get() );
570 }
571 //*************************************************************************************************
572 
573 
574 //*************************************************************************************************
582 template< typename PT1, typename RT1, typename PT2, typename RT2 >
583 inline bool operator<( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
584 {
585  return ( (~lhs).get() < (~rhs).get() );
586 }
587 //*************************************************************************************************
588 
589 
590 //*************************************************************************************************
598 template< typename PT, typename RT, typename T >
599 inline typename DisableIf< IsProxy<T>, bool >::Type
600  operator<( const Proxy<PT,RT>& lhs, const T& rhs )
601 {
602  return ( (~lhs).get() < rhs );
603 }
604 //*************************************************************************************************
605 
606 
607 //*************************************************************************************************
615 template< typename T, typename PT, typename RT >
616 inline typename DisableIf< IsProxy<T>, bool >::Type
617  operator<( const T& lhs, const Proxy<PT,RT>& rhs )
618 {
619  return ( lhs < rhs.get() );
620 }
621 //*************************************************************************************************
622 
623 
624 //*************************************************************************************************
632 template< typename PT1, typename RT1, typename PT2, typename RT2 >
633 inline bool operator>( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
634 {
635  return ( (~lhs).get() > (~rhs).get() );
636 }
637 //*************************************************************************************************
638 
639 
640 //*************************************************************************************************
648 template< typename PT, typename RT, typename T >
649 inline typename DisableIf< IsProxy<T>, bool >::Type
650  operator>( const Proxy<PT,RT>& lhs, const T& rhs )
651 {
652  return ( (~lhs).get() > rhs );
653 }
654 //*************************************************************************************************
655 
656 
657 //*************************************************************************************************
665 template< typename T, typename PT, typename RT >
666 inline typename DisableIf< IsProxy<T>, bool >::Type
667  operator>( const T& lhs, const Proxy<PT,RT>& rhs )
668 {
669  return ( lhs > (~rhs).get() );
670 }
671 //*************************************************************************************************
672 
673 
674 //*************************************************************************************************
682 template< typename PT1, typename RT1, typename PT2, typename RT2 >
683 inline bool operator<=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
684 {
685  return ( (~lhs).get() <= (~rhs).get() );
686 }
687 //*************************************************************************************************
688 
689 
690 //*************************************************************************************************
698 template< typename PT, typename RT, typename T >
699 inline typename DisableIf< IsProxy<T>, bool >::Type
700  operator<=( const Proxy<PT,RT>& lhs, const T& rhs )
701 {
702  return ( (~lhs).get() <= rhs );
703 }
704 //*************************************************************************************************
705 
706 
707 //*************************************************************************************************
715 template< typename T, typename PT, typename RT >
716 inline typename DisableIf< IsProxy<T>, bool >::Type
717  operator<=( const T& lhs, const Proxy<PT,RT>& rhs )
718 {
719  return ( lhs <= (~rhs).get() );
720 }
721 //*************************************************************************************************
722 
723 
724 //*************************************************************************************************
732 template< typename PT1, typename RT1, typename PT2, typename RT2 >
733 inline bool operator>=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
734 {
735  return ( (~lhs).get() >= (~rhs).get() );
736 }
737 //*************************************************************************************************
738 
739 
740 //*************************************************************************************************
748 template< typename PT, typename RT, typename T >
749 inline typename DisableIf< IsProxy<T>, bool >::Type
750  operator>=( const Proxy<PT,RT>& lhs, const T& rhs )
751 {
752  return ( (~lhs).get() >= rhs );
753 }
754 //*************************************************************************************************
755 
756 
757 //*************************************************************************************************
765 template< typename T, typename PT, typename RT >
766 inline typename DisableIf< IsProxy<T>, bool >::Type
767  operator>=( const T& lhs, const Proxy<PT,RT>& rhs )
768 {
769  return ( lhs >= (~rhs).get() );
770 }
771 //*************************************************************************************************
772 
773 
774 //*************************************************************************************************
782 template< typename PT, typename RT >
783 inline std::ostream& operator<<( std::ostream& os, const Proxy<PT,RT>& proxy )
784 {
785  return os << (~proxy).get();
786 }
787 //*************************************************************************************************
788 
789 
790 
791 
792 //=================================================================================================
793 //
794 // GLOBAL FUNCTIONS
795 //
796 //=================================================================================================
797 
798 //*************************************************************************************************
801 template< typename PT, typename RT >
802 inline typename TransExprTrait< typename PT::RepresentedType >::Type
803  trans( const Proxy<PT,RT>& proxy );
804 
805 template< typename PT, typename RT >
806 inline typename AbsExprTrait< typename PT::RepresentedType >::Type
807  abs( const Proxy<PT,RT>& proxy );
808 
809 template< typename PT, typename RT >
810 inline typename CTransExprTrait< typename PT::RepresentedType >::Type
811  ctrans( const Proxy<PT,RT>& proxy );
812 
813 template< typename PT, typename RT >
814 inline typename RealExprTrait< typename PT::RepresentedType >::Type
815  real( const Proxy<PT,RT>& proxy );
816 
817 template< typename PT, typename RT >
818 inline typename ImagExprTrait< typename PT::RepresentedType >::Type
819  imag( const Proxy<PT,RT>& proxy );
820 
821 template< typename PT, typename RT >
822 inline void transpose( const Proxy<PT,RT>& proxy );
823 
824 template< typename PT, typename RT >
825 inline void ctranspose( const Proxy<PT,RT>& proxy );
826 
827 template< typename PT, typename RT >
828 inline void invert( const Proxy<PT,RT>& proxy );
829 
830 template< InversionFlag IF, typename PT, typename RT >
831 inline void invert( const Proxy<PT,RT>& proxy );
832 
833 template< typename PT, typename RT >
834 inline bool isReal( const Proxy<PT,RT>& proxy );
835 
836 template< typename PT, typename RT >
837 inline bool isZero( const Proxy<PT,RT>& proxy );
838 
839 template< typename PT, typename RT >
840 inline bool isOne( const Proxy<PT,RT>& proxy );
841 
842 template< typename PT, typename RT >
843 inline bool isnan( const Proxy<PT,RT>& proxy );
845 //*************************************************************************************************
846 
847 
848 //*************************************************************************************************
858 template< typename PT, typename RT >
859 inline typename TransExprTrait< typename PT::RepresentedType >::Typ
860  trans( const Proxy<PT,RT>& proxy )
861 {
862  using blaze::trans;
863 
864  return trans( (~proxy).get() );
865 }
866 //*************************************************************************************************
867 
868 
869 //*************************************************************************************************
880 template< typename PT, typename RT >
881 inline typename AbsExprTrait< typename PT::RepresentedType >::Type
882  abs( const Proxy<PT,RT>& proxy )
883 {
884  using std::abs;
885 
886  return abs( (~proxy).get() );
887 }
888 //*************************************************************************************************
889 
890 
891 //*************************************************************************************************
901 template< typename PT, typename RT >
902 inline typename CTransExprTrait< typename PT::RepresentedType >::Type
903  ctrans( const Proxy<PT,RT>& proxy )
904 {
905  using blaze::ctrans;
906 
907  return ctrans( (~proxy).get() );
908 }
909 //*************************************************************************************************
910 
911 
912 //*************************************************************************************************
923 template< typename PT, typename RT >
924 inline typename RealExprTrait< typename PT::RepresentedType >::Type
925  real( const Proxy<PT,RT>& proxy )
926 {
927  using blaze::real;
928 
929  return real( (~proxy).get() );
930 }
931 //*************************************************************************************************
932 
933 
934 //*************************************************************************************************
945 template< typename PT, typename RT >
946 inline typename ImagExprTrait< typename PT::RepresentedType >::Type
947  imag( const Proxy<PT,RT>& proxy )
948 {
949  using blaze::imag;
950 
951  return imag( (~proxy).get() );
952 }
953 //*************************************************************************************************
954 
955 
956 //*************************************************************************************************
973 template< typename PT, typename RT >
974 inline void transpose( const Proxy<PT,RT>& proxy )
975 {
976  if( (~proxy).isRestricted() ) {
977  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
978  }
979 
980  transpose( (~proxy).get() );
981 }
982 //*************************************************************************************************
983 
984 
985 //*************************************************************************************************
1002 template< typename PT, typename RT >
1003 inline void ctranspose( const Proxy<PT,RT>& proxy )
1004 {
1005  if( (~proxy).isRestricted() ) {
1006  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
1007  }
1008 
1009  ctranspose( (~proxy).get() );
1010 }
1011 //*************************************************************************************************
1012 
1013 
1014 //*************************************************************************************************
1042 template< typename PT, typename RT >
1043 inline void invert( const Proxy<PT,RT>& proxy )
1044 {
1045  if( (~proxy).isRestricted() ) {
1046  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
1047  }
1048 
1049  invert( (~proxy).get() );
1050 }
1051 //*************************************************************************************************
1052 
1053 
1054 //*************************************************************************************************
1091 template< InversionFlag IF, typename PT, typename RT >
1092 inline void invert( const Proxy<PT,RT>& proxy )
1093 {
1094  if( (~proxy).isRestricted() ) {
1095  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
1096  }
1097 
1098  invert<IF>( (~proxy).get() );
1099 }
1100 //*************************************************************************************************
1101 
1102 
1103 //*************************************************************************************************
1115 template< typename PT, typename RT >
1116 inline bool isReal( const Proxy<PT,RT>& proxy )
1117 {
1118  using blaze::isReal;
1119 
1120  return isReal( (~proxy).get() );
1121 }
1122 //*************************************************************************************************
1123 
1124 
1125 //*************************************************************************************************
1135 template< typename PT, typename RT >
1136 inline bool isZero( const Proxy<PT,RT>& proxy )
1137 {
1138  using blaze::isZero;
1139 
1140  return isZero( (~proxy).get() );
1141 }
1142 //*************************************************************************************************
1143 
1144 
1145 //*************************************************************************************************
1155 template< typename PT, typename RT >
1156 inline bool isOne( const Proxy<PT,RT>& proxy )
1157 {
1158  using blaze::isOne;
1159 
1160  return isOne( (~proxy).get() );
1161 }
1162 //*************************************************************************************************
1163 
1164 
1165 //*************************************************************************************************
1175 template< typename PT, typename RT >
1176 inline bool isnan( const Proxy<PT,RT>& proxy )
1177 {
1178  using blaze::isnan;
1179 
1180  return isnan( (~proxy).get() );
1181 }
1182 //*************************************************************************************************
1183 
1184 } // namespace blaze
1185 
1186 #endif
Header file for the isnan shim.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
Header file for the ImagExprTrait class template.
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:609
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7820
const EnableIf< IsNumeric< T2 >, typename DivExprTrait< T1, T2 >::Type >::Type operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:962
Header file for the SparseVectorProxy class.
AbsExprTrait< typename PT::RepresentedType >::Type abs(const Proxy< PT, RT > &proxy)
Computing the absolute value of the represented element.
Definition: Proxy.h:882
Header file for the imaginary shim.
Proxy base class.The Proxy class is a base class for all proxy classes within the Blaze library that ...
Definition: Forward.h:51
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:569
Header file for the dense matrix inversion flags.
Header file for the DefaultProxy class.
Header file for the DenseMatrixProxy class.
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
const DMatAbsExpr< MT, SO > abs(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the absolute values of each single element of dm.
Definition: DMatAbsExpr.h:938
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:584
Header file for the AddExprTrait class template.
bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:442
Header file for the RealExprTrait class template.
Header file for the invert shim.
Header file for the DenseVectorProxy class.
const ImagExprTrait< MT >::Type imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatImagExpr.h:920
Header file for the IsMatrix type trait.
Header file for the DivExprTrait class template.
Header file for the MultExprTrait class template.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:767
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for the ComplexProxy class.
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:610
Header file for the isZero shim.
const CTransExprTrait< MT >::Type ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatConjExpr.h:974
const RealExprTrait< MT >::Type real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatRealExpr.h:920
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:642
Header file for the real shim.
bool isnan(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is not a number.
Definition: DiagonalProxy.h:629
Header file for the SparseMatrixProxy class.
Header file for the IsVector type trait.
Header file for the IsDenseMatrix type trait.
Header file for the isOne shim.
Header file for the IsProxy type trait.
Header file for the TransExprTrait class template.
Header file for the IsDenseVector type trait.
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:589
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
Header file for the IsComplex type trait.
Header file for exception macros.
Header file for the CTransExprTrait class template.
Header file for the AbsExprTrait class template.
Header file for the SubExprTrait class template.
Header file for the isReal shim.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:558