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 
43 #include <iosfwd>
44 #include <blaze/math/Aliases.h>
45 #include <blaze/math/Exception.h>
53 #include <blaze/math/shims/Abs.h>
54 #include <blaze/math/shims/Acos.h>
55 #include <blaze/math/shims/Acosh.h>
56 #include <blaze/math/shims/Asin.h>
57 #include <blaze/math/shims/Asinh.h>
58 #include <blaze/math/shims/Atan.h>
59 #include <blaze/math/shims/Atanh.h>
60 #include <blaze/math/shims/Cbrt.h>
61 #include <blaze/math/shims/Ceil.h>
63 #include <blaze/math/shims/Cos.h>
64 #include <blaze/math/shims/Cosh.h>
65 #include <blaze/math/shims/Erf.h>
66 #include <blaze/math/shims/Erfc.h>
67 #include <blaze/math/shims/Exp.h>
68 #include <blaze/math/shims/Floor.h>
73 #include <blaze/math/shims/IsNaN.h>
74 #include <blaze/math/shims/IsOne.h>
77 #include <blaze/math/shims/Pow.h>
78 #include <blaze/math/shims/Real.h>
79 #include <blaze/math/shims/Sin.h>
80 #include <blaze/math/shims/Sinh.h>
81 #include <blaze/math/shims/Sqrt.h>
82 #include <blaze/math/shims/Tan.h>
83 #include <blaze/math/shims/Tanh.h>
91 #include <blaze/util/DisableIf.h>
92 #include <blaze/util/mpl/If.h>
94 
95 
96 namespace blaze {
97 
98 //=================================================================================================
99 //
100 // CLASS DEFINITION
101 //
102 //=================================================================================================
103 
104 //*************************************************************************************************
136 template< typename PT // Type of the proxy
137  , typename RT = int > // Type of the represented element
138 class Proxy
139  : public If_< IsVector<RT>
140  , If_< IsDenseVector<RT>
141  , DenseVectorProxy<PT,RT>
142  , SparseVectorProxy<PT,RT> >
143  , If_< IsMatrix<RT>
144  , If_< IsDenseMatrix<RT>
145  , DenseMatrixProxy<PT,RT>
146  , SparseMatrixProxy<PT,RT> >
147  , If_< IsComplex<RT>
148  , ComplexProxy<PT,RT>
149  , DefaultProxy<PT,RT> > > >
150 {};
151 //*************************************************************************************************
152 
153 
154 
155 
156 //=================================================================================================
157 //
158 // GLOBAL OPERATORS
159 //
160 //=================================================================================================
161 
162 //*************************************************************************************************
165 template< typename PT1, typename RT1, typename PT2, typename RT2 >
166 inline decltype(auto) operator+( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
167 
168 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
169 inline decltype(auto) operator+( const Proxy<PT,RT>& lhs, const T& rhs );
170 
171 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
172 inline decltype(auto) operator+( const T& lhs, const Proxy<PT,RT>& rhs );
173 
174 template< typename PT1, typename RT1, typename PT2, typename RT2 >
175 inline decltype(auto) operator-( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
176 
177 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
178 inline decltype(auto) operator-( const Proxy<PT,RT>& lhs, const T& rhs );
179 
180 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
181 inline decltype(auto) operator-( const T& lhs, const Proxy<PT,RT>& rhs );
182 
183 template< typename PT1, typename RT1, typename PT2, typename RT2 >
184 inline decltype(auto) operator*( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
185 
186 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
187 inline decltype(auto) operator*( const Proxy<PT,RT>& lhs, const T& rhs );
188 
189 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
190 inline decltype(auto) operator*( const T& lhs, const Proxy<PT,RT>& rhs );
191 
192 template< typename PT1, typename RT1, typename PT2, typename RT2 >
193 inline decltype(auto) operator/( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
194 
195 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
196 inline decltype(auto) operator/( const Proxy<PT,RT>& lhs, const T& rhs );
197 
198 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
199 inline decltype(auto) operator/( const T& lhs, const Proxy<PT,RT>& rhs );
200 
201 template< typename PT1, typename RT1, typename PT2, typename RT2 >
202 inline bool operator==( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
203 
204 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
205 inline bool operator==( const Proxy<PT,RT>& lhs, const T& rhs );
206 
207 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
208 inline bool operator==( const T& lhs, const Proxy<PT,RT>& rhs );
209 
210 template< typename PT1, typename RT1, typename PT2, typename RT2 >
211 inline bool operator!=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
212 
213 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
214 inline bool operator!=( const Proxy<PT,RT>& lhs, const T& rhs );
215 
216 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
217 inline bool operator!=( const T& lhs, const Proxy<PT,RT>& rhs );
218 
219 template< typename PT1, typename RT1, typename PT2, typename RT2 >
220 inline bool operator<( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
221 
222 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
223 inline bool operator<( const Proxy<PT,RT>& lhs, const T& rhs );
224 
225 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
226 inline bool operator<( const T& lhs, const Proxy<PT,RT>& rhs );
227 
228 template< typename PT1, typename RT1, typename PT2, typename RT2 >
229 inline bool operator>( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
230 
231 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
232 inline bool operator>( const Proxy<PT,RT>& lhs, const T& rhs );
233 
234 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
235 inline bool operator>( const T& lhs, const Proxy<PT,RT>& rhs );
236 
237 template< typename PT1, typename RT1, typename PT2, typename RT2 >
238 inline bool operator<=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
239 
240 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
241 inline bool operator<=( const Proxy<PT,RT>& lhs, const T& rhs );
242 
243 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
244 inline bool operator<=( const T& lhs, const Proxy<PT,RT>& rhs );
245 
246 template< typename PT1, typename RT1, typename PT2, typename RT2 >
247 inline bool operator>=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
248 
249 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
250 inline bool operator>=( const Proxy<PT,RT>& lhs, const T& rhs );
251 
252 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
253 inline bool operator>=( const T& lhs, const Proxy<PT,RT>& rhs );
254 
255 template< typename PT, typename RT >
256 inline std::ostream& operator<<( std::ostream& os, const Proxy<PT,RT>& proxy );
258 //*************************************************************************************************
259 
260 
261 //*************************************************************************************************
269 template< typename PT1, typename RT1, typename PT2, typename RT2 >
270 inline decltype(auto) operator+( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
271 {
272  return (~lhs).get() + (~rhs).get();
273 }
274 //*************************************************************************************************
275 
276 
277 //*************************************************************************************************
285 template< typename PT, typename RT, typename T, typename >
286 inline decltype(auto) operator+( const Proxy<PT,RT>& lhs, const T& rhs )
287 {
288  return (~lhs).get() + rhs;
289 }
290 //*************************************************************************************************
291 
292 
293 //*************************************************************************************************
301 template< typename T, typename PT, typename RT, typename >
302 inline decltype(auto) operator+( const T& lhs, const Proxy<PT,RT>& rhs )
303 {
304  return lhs + (~rhs).get();
305 }
306 //*************************************************************************************************
307 
308 
309 //*************************************************************************************************
317 template< typename PT1, typename RT1, typename PT2, typename RT2 >
318 inline decltype(auto) operator-( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
319 {
320  return (~lhs).get() - (~rhs).get();
321 }
322 //*************************************************************************************************
323 
324 
325 //*************************************************************************************************
333 template< typename PT, typename RT, typename T, typename >
334 inline decltype(auto) operator-( const Proxy<PT,RT>& lhs, const T& rhs )
335 {
336  return (~lhs).get() - rhs;
337 }
338 //*************************************************************************************************
339 
340 
341 //*************************************************************************************************
349 template< typename T, typename PT, typename RT, typename >
350 inline decltype(auto) operator-( const T& lhs, const Proxy<PT,RT>& rhs )
351 {
352  return lhs - (~rhs).get();
353 }
354 //*************************************************************************************************
355 
356 
357 //*************************************************************************************************
365 template< typename PT1, typename RT1, typename PT2, typename RT2 >
366 inline decltype(auto) operator*( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
367 {
368  return (~lhs).get() * (~rhs).get();
369 }
370 //*************************************************************************************************
371 
372 
373 //*************************************************************************************************
381 template< typename PT, typename RT, typename T, typename >
382 inline decltype(auto) operator*( const Proxy<PT,RT>& lhs, const T& rhs )
383 {
384  return (~lhs).get() * rhs;
385 }
386 //*************************************************************************************************
387 
388 
389 //*************************************************************************************************
397 template< typename T, typename PT, typename RT, typename >
398 inline decltype(auto) operator*( const T& lhs, const Proxy<PT,RT>& rhs )
399 {
400  return lhs * (~rhs).get();
401 }
402 //*************************************************************************************************
403 
404 
405 //*************************************************************************************************
413 template< typename PT1, typename RT1, typename PT2, typename RT2 >
414 inline decltype(auto) operator/( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
415 {
416  return (~lhs).get() / (~rhs).get();
417 }
418 //*************************************************************************************************
419 
420 
421 //*************************************************************************************************
429 template< typename PT, typename RT, typename T, typename >
430 inline decltype(auto) operator/( const Proxy<PT,RT>& lhs, const T& rhs )
431 {
432  return (~lhs).get() / rhs;
433 }
434 //*************************************************************************************************
435 
436 
437 //*************************************************************************************************
445 template< typename T, typename PT, typename RT, typename >
446 inline decltype(auto) operator/( const T& lhs, const Proxy<PT,RT>& rhs )
447 {
448  return lhs / (~rhs).get();
449 }
450 //*************************************************************************************************
451 
452 
453 //*************************************************************************************************
461 template< typename PT1, typename RT1, typename PT2, typename RT2 >
462 inline bool operator==( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
463 {
464  return ( (~lhs).get() == (~rhs).get() );
465 }
466 //*************************************************************************************************
467 
468 
469 //*************************************************************************************************
477 template< typename PT, typename RT, typename T, typename >
478 inline bool operator==( const Proxy<PT,RT>& lhs, const T& rhs )
479 {
480  return ( (~lhs).get() == rhs );
481 }
482 //*************************************************************************************************
483 
484 
485 //*************************************************************************************************
493 template< typename T, typename PT, typename RT, typename >
494 inline bool operator==( const T& lhs, const Proxy<PT,RT>& rhs )
495 {
496  return ( lhs == (~rhs).get() );
497 }
498 //*************************************************************************************************
499 
500 
501 //*************************************************************************************************
509 template< typename PT1, typename RT1, typename PT2, typename RT2 >
510 inline bool operator!=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
511 {
512  return ( (~lhs).get() != (~rhs).get() );
513 }
514 //*************************************************************************************************
515 
516 
517 //*************************************************************************************************
525 template< typename PT, typename RT, typename T, typename >
526 inline bool operator!=( const Proxy<PT,RT>& lhs, const T& rhs )
527 {
528  return ( (~lhs).get() != rhs );
529 }
530 //*************************************************************************************************
531 
532 
533 //*************************************************************************************************
541 template< typename T, typename PT, typename RT, typename >
542 inline bool operator!=( const T& lhs, const Proxy<PT,RT>& rhs )
543 {
544  return ( lhs != (~rhs).get() );
545 }
546 //*************************************************************************************************
547 
548 
549 //*************************************************************************************************
557 template< typename PT1, typename RT1, typename PT2, typename RT2 >
558 inline bool operator<( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
559 {
560  return ( (~lhs).get() < (~rhs).get() );
561 }
562 //*************************************************************************************************
563 
564 
565 //*************************************************************************************************
573 template< typename PT, typename RT, typename T, typename >
574 inline bool operator<( const Proxy<PT,RT>& lhs, const T& rhs )
575 {
576  return ( (~lhs).get() < rhs );
577 }
578 //*************************************************************************************************
579 
580 
581 //*************************************************************************************************
589 template< typename T, typename PT, typename RT, typename >
590 inline bool operator<( const T& lhs, const Proxy<PT,RT>& rhs )
591 {
592  return ( lhs < rhs.get() );
593 }
594 //*************************************************************************************************
595 
596 
597 //*************************************************************************************************
605 template< typename PT1, typename RT1, typename PT2, typename RT2 >
606 inline bool operator>( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
607 {
608  return ( (~lhs).get() > (~rhs).get() );
609 }
610 //*************************************************************************************************
611 
612 
613 //*************************************************************************************************
621 template< typename PT, typename RT, typename T, typename >
622 inline bool operator>( const Proxy<PT,RT>& lhs, const T& rhs )
623 {
624  return ( (~lhs).get() > rhs );
625 }
626 //*************************************************************************************************
627 
628 
629 //*************************************************************************************************
637 template< typename T, typename PT, typename RT, typename >
638 inline bool operator>( const T& lhs, const Proxy<PT,RT>& rhs )
639 {
640  return ( lhs > (~rhs).get() );
641 }
642 //*************************************************************************************************
643 
644 
645 //*************************************************************************************************
653 template< typename PT1, typename RT1, typename PT2, typename RT2 >
654 inline bool operator<=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
655 {
656  return ( (~lhs).get() <= (~rhs).get() );
657 }
658 //*************************************************************************************************
659 
660 
661 //*************************************************************************************************
669 template< typename PT, typename RT, typename T, typename >
670 inline bool operator<=( const Proxy<PT,RT>& lhs, const T& rhs )
671 {
672  return ( (~lhs).get() <= rhs );
673 }
674 //*************************************************************************************************
675 
676 
677 //*************************************************************************************************
685 template< typename T, typename PT, typename RT, typename >
686 inline bool operator<=( const T& lhs, const Proxy<PT,RT>& rhs )
687 {
688  return ( lhs <= (~rhs).get() );
689 }
690 //*************************************************************************************************
691 
692 
693 //*************************************************************************************************
701 template< typename PT1, typename RT1, typename PT2, typename RT2 >
702 inline bool operator>=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
703 {
704  return ( (~lhs).get() >= (~rhs).get() );
705 }
706 //*************************************************************************************************
707 
708 
709 //*************************************************************************************************
717 template< typename PT, typename RT, typename T, typename >
718 inline bool operator>=( const Proxy<PT,RT>& lhs, const T& rhs )
719 {
720  return ( (~lhs).get() >= rhs );
721 }
722 //*************************************************************************************************
723 
724 
725 //*************************************************************************************************
733 template< typename T, typename PT, typename RT, typename >
734 inline bool operator>=( const T& lhs, const Proxy<PT,RT>& rhs )
735 {
736  return ( lhs >= (~rhs).get() );
737 }
738 //*************************************************************************************************
739 
740 
741 //*************************************************************************************************
749 template< typename PT, typename RT >
750 inline std::ostream& operator<<( std::ostream& os, const Proxy<PT,RT>& proxy )
751 {
752  return os << (~proxy).get();
753 }
754 //*************************************************************************************************
755 
756 
757 
758 
759 //=================================================================================================
760 //
761 // GLOBAL FUNCTIONS
762 //
763 //=================================================================================================
764 
765 //*************************************************************************************************
768 template< typename PT, typename RT >
769 inline decltype(auto) trans( const Proxy<PT,RT>& proxy );
770 
771 template< typename PT, typename RT >
772 inline decltype(auto) ctrans( const Proxy<PT,RT>& proxy );
773 
774 template< typename PT, typename RT >
775 inline decltype(auto) abs( const Proxy<PT,RT>& proxy );
776 
777 template< typename PT, typename RT >
778 inline decltype(auto) conj( const Proxy<PT,RT>& proxy );
779 
780 template< typename PT, typename RT >
781 inline decltype(auto) real( const Proxy<PT,RT>& proxy );
782 
783 template< typename PT, typename RT >
784 inline decltype(auto) imag( const Proxy<PT,RT>& proxy );
785 
786 template< typename PT, typename RT >
787 inline decltype(auto) sqrt( const Proxy<PT,RT>& proxy );
788 
789 template< typename PT, typename RT >
790 inline decltype(auto) invsqrt( const Proxy<PT,RT>& proxy );
791 
792 template< typename PT, typename RT >
793 inline decltype(auto) cbrt( const Proxy<PT,RT>& proxy );
794 
795 template< typename PT, typename RT >
796 inline decltype(auto) invcbrt( const Proxy<PT,RT>& proxy );
797 
798 template< typename PT, typename RT >
799 inline decltype(auto) floor( const Proxy<PT,RT>& proxy );
800 
801 template< typename PT, typename RT >
802 inline decltype(auto) ceil( const Proxy<PT,RT>& proxy );
803 
804 template< typename PT, typename RT, typename ET >
805 inline decltype(auto) pow( const Proxy<PT,RT>& proxy, const ET& exp );
806 
807 template< typename PT, typename RT >
808 inline decltype(auto) exp( const Proxy<PT,RT>& proxy );
809 
810 template< typename PT, typename RT >
811 inline decltype(auto) sin( const Proxy<PT,RT>& proxy );
812 
813 template< typename PT, typename RT >
814 inline decltype(auto) asin( const Proxy<PT,RT>& proxy );
815 
816 template< typename PT, typename RT >
817 inline decltype(auto) sinh( const Proxy<PT,RT>& proxy );
818 
819 template< typename PT, typename RT >
820 inline decltype(auto) asinh( const Proxy<PT,RT>& proxy );
821 
822 template< typename PT, typename RT >
823 inline decltype(auto) cos( const Proxy<PT,RT>& proxy );
824 
825 template< typename PT, typename RT >
826 inline decltype(auto) acos( const Proxy<PT,RT>& proxy );
827 
828 template< typename PT, typename RT >
829 inline decltype(auto) cosh( const Proxy<PT,RT>& proxy );
830 
831 template< typename PT, typename RT >
832 inline decltype(auto) acosh( const Proxy<PT,RT>& proxy );
833 
834 template< typename PT, typename RT >
835 inline decltype(auto) tan( const Proxy<PT,RT>& proxy );
836 
837 template< typename PT, typename RT >
838 inline decltype(auto) atan( const Proxy<PT,RT>& proxy );
839 
840 template< typename PT, typename RT >
841 inline decltype(auto) tanh( const Proxy<PT,RT>& proxy );
842 
843 template< typename PT, typename RT >
844 inline decltype(auto) atanh( const Proxy<PT,RT>& proxy );
845 
846 template< typename PT1, typename RT1, typename PT2, typename RT2 >
847 inline decltype(auto) min( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
848 
849 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
850 inline decltype(auto) min( const Proxy<PT,RT>& lhs, const T& rhs );
851 
852 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
853 inline decltype(auto) min( const T& lhs, const Proxy<PT,RT>& rhs );
854 
855 template< typename PT1, typename RT1, typename PT2, typename RT2 >
856 inline decltype(auto) max( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
857 
858 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
859 inline decltype(auto) max( const Proxy<PT,RT>& lhs, const T& rhs );
860 
861 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
862 inline decltype(auto) max( const T& lhs, const Proxy<PT,RT>& rhs );
863 
864 template< typename PT, typename RT >
865 inline void transpose( const Proxy<PT,RT>& proxy );
866 
867 template< typename PT, typename RT >
868 inline void ctranspose( const Proxy<PT,RT>& proxy );
869 
870 template< typename PT, typename RT >
871 inline void invert( const Proxy<PT,RT>& proxy );
872 
873 template< InversionFlag IF, typename PT, typename RT >
874 inline void invert( const Proxy<PT,RT>& proxy );
875 
876 template< bool RF, typename PT, typename RT >
877 inline bool isReal( const Proxy<PT,RT>& proxy );
878 
879 template< bool RF, typename PT, typename RT >
880 inline bool isZero( const Proxy<PT,RT>& proxy );
881 
882 template< bool RF, typename PT, typename RT >
883 inline bool isOne( const Proxy<PT,RT>& proxy );
884 
885 template< typename PT, typename RT >
886 inline bool isnan( const Proxy<PT,RT>& proxy );
888 //*************************************************************************************************
889 
890 
891 //*************************************************************************************************
901 template< typename PT, typename RT >
902 inline decltype(auto) trans( const Proxy<PT,RT>& proxy )
903 {
904  using blaze::trans;
905 
906  return trans( (~proxy).get() );
907 }
908 //*************************************************************************************************
909 
910 
911 //*************************************************************************************************
921 template< typename PT, typename RT >
922 inline decltype(auto) ctrans( const Proxy<PT,RT>& proxy )
923 {
924  using blaze::ctrans;
925 
926  return ctrans( (~proxy).get() );
927 }
928 //*************************************************************************************************
929 
930 
931 //*************************************************************************************************
942 template< typename PT, typename RT >
943 inline decltype(auto) abs( const Proxy<PT,RT>& proxy )
944 {
945  using blaze::abs;
946 
947  return abs( (~proxy).get() );
948 }
949 //*************************************************************************************************
950 
951 
952 //*************************************************************************************************
963 template< typename PT, typename RT >
964 inline decltype(auto) conj( const Proxy<PT,RT>& proxy )
965 {
966  using blaze::conj;
967 
968  return conj( (~proxy).get() );
969 }
970 //*************************************************************************************************
971 
972 
973 //*************************************************************************************************
984 template< typename PT, typename RT >
985 inline decltype(auto) real( const Proxy<PT,RT>& proxy )
986 {
987  using blaze::real;
988 
989  return real( (~proxy).get() );
990 }
991 //*************************************************************************************************
992 
993 
994 //*************************************************************************************************
1005 template< typename PT, typename RT >
1006 inline decltype(auto) imag( const Proxy<PT,RT>& proxy )
1007 {
1008  using blaze::imag;
1009 
1010  return imag( (~proxy).get() );
1011 }
1012 //*************************************************************************************************
1013 
1014 
1015 //*************************************************************************************************
1026 template< typename PT, typename RT >
1027 inline decltype(auto) sqrt( const Proxy<PT,RT>& proxy )
1028 {
1029  using blaze::sqrt;
1030 
1031  return sqrt( (~proxy).get() );
1032 }
1033 //*************************************************************************************************
1034 
1035 
1036 //*************************************************************************************************
1047 template< typename PT, typename RT >
1048 inline decltype(auto) invsqrt( const Proxy<PT,RT>& proxy )
1049 {
1050  using blaze::invsqrt;
1051 
1052  return invsqrt( (~proxy).get() );
1053 }
1054 //*************************************************************************************************
1055 
1056 
1057 //*************************************************************************************************
1068 template< typename PT, typename RT >
1069 inline decltype(auto) cbrt( const Proxy<PT,RT>& proxy )
1070 {
1071  using blaze::cbrt;
1072 
1073  return cbrt( (~proxy).get() );
1074 }
1075 //*************************************************************************************************
1076 
1077 
1078 //*************************************************************************************************
1089 template< typename PT, typename RT >
1090 inline decltype(auto) invcbrt( const Proxy<PT,RT>& proxy )
1091 {
1092  using blaze::invcbrt;
1093 
1094  return invcbrt( (~proxy).get() );
1095 }
1096 //*************************************************************************************************
1097 
1098 
1099 //*************************************************************************************************
1110 template< typename PT, typename RT >
1111 inline decltype(auto) floor( const Proxy<PT,RT>& proxy )
1112 {
1113  using blaze::floor;
1114 
1115  return floor( (~proxy).get() );
1116 }
1117 //*************************************************************************************************
1118 
1119 
1120 //*************************************************************************************************
1131 template< typename PT, typename RT >
1132 inline decltype(auto) ceil( const Proxy<PT,RT>& proxy )
1133 {
1134  using blaze::ceil;
1135 
1136  return ceil( (~proxy).get() );
1137 }
1138 //*************************************************************************************************
1139 
1140 
1141 //*************************************************************************************************
1153 template< typename PT, typename RT, typename ET >
1154 inline decltype(auto) pow( const Proxy<PT,RT>& proxy, const ET& exp )
1155 {
1156  using blaze::pow;
1157 
1158  return pow( (~proxy).get(), exp );
1159 }
1160 //*************************************************************************************************
1161 
1162 
1163 //*************************************************************************************************
1174 template< typename PT, typename RT >
1175 inline decltype(auto) exp( const Proxy<PT,RT>& proxy )
1176 {
1177  using blaze::exp;
1178 
1179  return exp( (~proxy).get() );
1180 }
1181 //*************************************************************************************************
1182 
1183 
1184 //*************************************************************************************************
1195 template< typename PT, typename RT >
1196 inline decltype(auto) sin( const Proxy<PT,RT>& proxy )
1197 {
1198  using blaze::sin;
1199 
1200  return sin( (~proxy).get() );
1201 }
1202 //*************************************************************************************************
1203 
1204 
1205 //*************************************************************************************************
1216 template< typename PT, typename RT >
1217 inline decltype(auto) asin( const Proxy<PT,RT>& proxy )
1218 {
1219  using blaze::asin;
1220 
1221  return asin( (~proxy).get() );
1222 }
1223 //*************************************************************************************************
1224 
1225 
1226 //*************************************************************************************************
1237 template< typename PT, typename RT >
1238 inline decltype(auto) sinh( const Proxy<PT,RT>& proxy )
1239 {
1240  using blaze::sinh;
1241 
1242  return sinh( (~proxy).get() );
1243 }
1244 //*************************************************************************************************
1245 
1246 
1247 //*************************************************************************************************
1258 template< typename PT, typename RT >
1259 inline decltype(auto) asinh( const Proxy<PT,RT>& proxy )
1260 {
1261  using blaze::asinh;
1262 
1263  return asinh( (~proxy).get() );
1264 }
1265 //*************************************************************************************************
1266 
1267 
1268 //*************************************************************************************************
1279 template< typename PT, typename RT >
1280 inline decltype(auto) cos( const Proxy<PT,RT>& proxy )
1281 {
1282  using blaze::cos;
1283 
1284  return cos( (~proxy).get() );
1285 }
1286 //*************************************************************************************************
1287 
1288 
1289 //*************************************************************************************************
1300 template< typename PT, typename RT >
1301 inline decltype(auto) acos( const Proxy<PT,RT>& proxy )
1302 {
1303  using blaze::acos;
1304 
1305  return acos( (~proxy).get() );
1306 }
1307 //*************************************************************************************************
1308 
1309 
1310 //*************************************************************************************************
1321 template< typename PT, typename RT >
1322 inline decltype(auto) cosh( const Proxy<PT,RT>& proxy )
1323 {
1324  using blaze::cosh;
1325 
1326  return cosh( (~proxy).get() );
1327 }
1328 //*************************************************************************************************
1329 
1330 
1331 //*************************************************************************************************
1342 template< typename PT, typename RT >
1343 inline decltype(auto) acosh( const Proxy<PT,RT>& proxy )
1344 {
1345  using blaze::acosh;
1346 
1347  return acosh( (~proxy).get() );
1348 }
1349 //*************************************************************************************************
1350 
1351 
1352 //*************************************************************************************************
1363 template< typename PT, typename RT >
1364 inline decltype(auto) tan( const Proxy<PT,RT>& proxy )
1365 {
1366  using blaze::tan;
1367 
1368  return tan( (~proxy).get() );
1369 }
1370 //*************************************************************************************************
1371 
1372 
1373 //*************************************************************************************************
1384 template< typename PT, typename RT >
1385 inline decltype(auto) atan( const Proxy<PT,RT>& proxy )
1386 {
1387  using blaze::atan;
1388 
1389  return atan( (~proxy).get() );
1390 }
1391 //*************************************************************************************************
1392 
1393 
1394 //*************************************************************************************************
1405 template< typename PT, typename RT >
1406 inline decltype(auto) tanh( const Proxy<PT,RT>& proxy )
1407 {
1408  using blaze::tanh;
1409 
1410  return tanh( (~proxy).get() );
1411 }
1412 //*************************************************************************************************
1413 
1414 
1415 //*************************************************************************************************
1426 template< typename PT, typename RT >
1427 inline decltype(auto) atanh( const Proxy<PT,RT>& proxy )
1428 {
1429  using blaze::atanh;
1430 
1431  return atanh( (~proxy).get() );
1432 }
1433 //*************************************************************************************************
1434 
1435 
1436 //*************************************************************************************************
1444 template< typename PT1, typename RT1, typename PT2, typename RT2 >
1445 inline decltype(auto) min( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
1446 {
1447  using blaze::min;
1448 
1449  return min( (~lhs).get(), (~rhs).get() );
1450 }
1451 //*************************************************************************************************
1452 
1453 
1454 //*************************************************************************************************
1462 template< typename PT, typename RT, typename T, typename >
1463 inline decltype(auto) min( const Proxy<PT,RT>& lhs, const T& rhs )
1464 {
1465  using blaze::min;
1466 
1467  return min( (~lhs).get(), rhs );
1468 }
1469 //*************************************************************************************************
1470 
1471 
1472 //*************************************************************************************************
1480 template< typename T, typename PT, typename RT, typename >
1481 inline decltype(auto) min( const T& lhs, const Proxy<PT,RT>& rhs )
1482 {
1483  using blaze::min;
1484 
1485  return min( lhs, (~rhs).get() );
1486 }
1487 //*************************************************************************************************
1488 
1489 
1490 //*************************************************************************************************
1498 template< typename PT1, typename RT1, typename PT2, typename RT2 >
1499 inline decltype(auto) max( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
1500 {
1501  using blaze::max;
1502 
1503  return max( (~lhs).get(), (~rhs).get() );
1504 }
1505 //*************************************************************************************************
1506 
1507 
1508 //*************************************************************************************************
1516 template< typename PT, typename RT, typename T, typename >
1517 inline decltype(auto) max( const Proxy<PT,RT>& lhs, const T& rhs )
1518 {
1519  using blaze::max;
1520 
1521  return max( (~lhs).get(), rhs );
1522 }
1523 //*************************************************************************************************
1524 
1525 
1526 //*************************************************************************************************
1534 template< typename T, typename PT, typename RT, typename >
1535 inline decltype(auto) max( const T& lhs, const Proxy<PT,RT>& rhs )
1536 {
1537  using blaze::max;
1538 
1539  return max( lhs, (~rhs).get() );
1540 }
1541 //*************************************************************************************************
1542 
1543 
1544 //*************************************************************************************************
1555 template< typename PT, typename RT >
1556 inline decltype(auto) erf( const Proxy<PT,RT>& proxy )
1557 {
1558  using blaze::erf;
1559 
1560  return erf( (~proxy).get() );
1561 }
1562 //*************************************************************************************************
1563 
1564 
1565 //*************************************************************************************************
1577 template< typename PT, typename RT >
1578 inline decltype(auto) erfc( const Proxy<PT,RT>& proxy )
1579 {
1580  using blaze::erfc;
1581 
1582  return erfc( (~proxy).get() );
1583 }
1584 //*************************************************************************************************
1585 
1586 
1587 //*************************************************************************************************
1604 template< typename PT, typename RT >
1605 inline void transpose( const Proxy<PT,RT>& proxy )
1606 {
1607  if( (~proxy).isRestricted() ) {
1608  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
1609  }
1610 
1611  transpose( (~proxy).get() );
1612 }
1613 //*************************************************************************************************
1614 
1615 
1616 //*************************************************************************************************
1633 template< typename PT, typename RT >
1634 inline void ctranspose( const Proxy<PT,RT>& proxy )
1635 {
1636  if( (~proxy).isRestricted() ) {
1637  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
1638  }
1639 
1640  ctranspose( (~proxy).get() );
1641 }
1642 //*************************************************************************************************
1643 
1644 
1645 //*************************************************************************************************
1673 template< typename PT, typename RT >
1674 inline void invert( const Proxy<PT,RT>& proxy )
1675 {
1676  if( (~proxy).isRestricted() ) {
1677  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
1678  }
1679 
1680  invert( (~proxy).get() );
1681 }
1682 //*************************************************************************************************
1683 
1684 
1685 //*************************************************************************************************
1722 template< InversionFlag IF, typename PT, typename RT >
1723 inline void invert( const Proxy<PT,RT>& proxy )
1724 {
1725  if( (~proxy).isRestricted() ) {
1726  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
1727  }
1728 
1729  invert<IF>( (~proxy).get() );
1730 }
1731 //*************************************************************************************************
1732 
1733 
1734 //*************************************************************************************************
1746 template< bool RF, typename PT, typename RT >
1747 inline bool isReal( const Proxy<PT,RT>& proxy )
1748 {
1749  using blaze::isReal;
1750 
1751  return isReal<RF>( (~proxy).get() );
1752 }
1753 //*************************************************************************************************
1754 
1755 
1756 //*************************************************************************************************
1766 template< bool RF, typename PT, typename RT >
1767 inline bool isZero( const Proxy<PT,RT>& proxy )
1768 {
1769  using blaze::isZero;
1770 
1771  return isZero<RF>( (~proxy).get() );
1772 }
1773 //*************************************************************************************************
1774 
1775 
1776 //*************************************************************************************************
1786 template< bool RF, typename PT, typename RT >
1787 inline bool isOne( const Proxy<PT,RT>& proxy )
1788 {
1789  using blaze::isOne;
1790 
1791  return isOne<RF>( (~proxy).get() );
1792 }
1793 //*************************************************************************************************
1794 
1795 
1796 //*************************************************************************************************
1806 template< typename PT, typename RT >
1807 inline bool isnan( const Proxy<PT,RT>& proxy )
1808 {
1809  using blaze::isnan;
1810 
1811  return isnan( (~proxy).get() );
1812 }
1813 //*************************************************************************************************
1814 
1815 } // namespace blaze
1816 
1817 #endif
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:650
Header file for the isnan shim.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
decltype(auto) acosh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic cosine for each single element of the dense matrix dm...
Definition: DMatMapExpr.h:2033
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
Header file for the acos shim.
Header file for the asin shim.
Header file for the cosh shim.
Header file for the SparseVectorProxy class.
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
decltype(auto) real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatMapExpr.h:1387
Header file for the tan shim.
Header file for the dense matrix inversion flags.
Header file for the DefaultProxy class.
decltype(auto) ceil(const DenseMatrix< MT, SO > &dm)
Applies the ceil() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1234
decltype(auto) pow(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise exponential value for the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1267
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
Header file for the DenseMatrixProxy class.
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1903
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:827
Header file for the abs shim.
Header file for the pow shim.
Header file for the invert shim.
STL namespace.
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1950
decltype(auto) acos(const DenseMatrix< MT, SO > &dm)
Computes the inverse cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1972
Header file for the DenseVectorProxy class.
decltype(auto) erf(const DenseMatrix< MT, SO > &dm)
Computes the error function for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2184
Header file for the IsMatrix type trait.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:670
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:772
Header file for the sqrt shim.
Headerfile for the generic max algorithm.
Header file for the DisableIf class template.
Header file for the floor shim.
decltype(auto) cos(const DenseMatrix< MT, SO > &dm)
Computes the cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1940
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1359
Header file for the cos shim.
Header file for the If class template.
Header file for the ComplexProxy class.
decltype(auto) sinh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1882
decltype(auto) asin(const DenseMatrix< MT, SO > &dm)
Computes the inverse sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1853
decltype(auto) cosh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic cosine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2001
decltype(auto) cbrt(const DenseMatrix< MT, SO > &dm)
Computes the cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1512
Header file for the erf shim.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:367
constexpr 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:443
Header file for the isZero shim.
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
decltype(auto) atan(const DenseMatrix< MT, SO > &dm)
Computes the inverse tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2091
Header file for the sin shim.
decltype(auto) asinh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1911
Header file for the invsqrt shim.
bool isnan(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is not a number.
Definition: DiagonalProxy.h:710
Header file for the SparseMatrixProxy class.
Header file for the exception macros of the math module.
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
Header file for the erfc shim.
Header file for the IsVector type trait.
Header file for the IsDenseMatrix type trait.
decltype(auto) exp(const DenseMatrix< MT, SO > &dm)
Computes for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1638
decltype(auto) abs(const DenseMatrix< MT, SO > &dm)
Applies the abs() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1176
Header file for the isOne shim.
Header file for the conjugate shim.
decltype(auto) floor(const DenseMatrix< MT, SO > &dm)
Applies the floor() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1205
decltype(auto) tanh(const DenseMatrix< MT, SO > &dm)
Computes the hyperbolic tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2123
Header file for the acosh shim.
Header file for the cbrt shim.
decltype(auto) invcbrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1544
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
Header file for the atanh shim.
decltype(auto) atanh(const DenseMatrix< MT, SO > &dm)
Computes the inverse hyperbolic tangent for each single element of the dense matrix dm...
Definition: DMatMapExpr.h:2155
Header file for the invcbrt shim.
Header file for the IsProxy type trait.
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:690
Header file for the asinh shim.
Header file for the tanh shim.
Header file for the IsDenseVector type trait.
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
decltype(auto) sin(const DenseMatrix< MT, SO > &dm)
Computes the sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1821
decltype(auto) erfc(const DenseMatrix< MT, SO > &dm)
Computes the complementary error function for each single element of the dense matrix dm...
Definition: DMatMapExpr.h:2213
decltype(auto) sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1448
decltype(auto) tan(const DenseMatrix< MT, SO > &dm)
Computes the tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2062
Header file for the IsComplex type trait.
decltype(auto) imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatMapExpr.h:1416
Header file for the exp shim.
Header file for the real shim.
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1321
Header file for the sinh shim.
decltype(auto) invsqrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1480
Header file for the isReal shim.
Header file for the atan shim.
Header file for the ceil shim.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:801