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 <blaze/math/Aliases.h>
44 #include <blaze/math/Exception.h>
52 #include <blaze/math/shims/Abs.h>
53 #include <blaze/math/shims/Acos.h>
54 #include <blaze/math/shims/Acosh.h>
55 #include <blaze/math/shims/Asin.h>
56 #include <blaze/math/shims/Asinh.h>
57 #include <blaze/math/shims/Atan.h>
58 #include <blaze/math/shims/Atanh.h>
59 #include <blaze/math/shims/Cbrt.h>
60 #include <blaze/math/shims/Ceil.h>
62 #include <blaze/math/shims/Cos.h>
63 #include <blaze/math/shims/Cosh.h>
64 #include <blaze/math/shims/Erf.h>
65 #include <blaze/math/shims/Erfc.h>
66 #include <blaze/math/shims/Exp.h>
67 #include <blaze/math/shims/Floor.h>
72 #include <blaze/math/shims/IsNaN.h>
73 #include <blaze/math/shims/IsOne.h>
76 #include <blaze/math/shims/Pow.h>
77 #include <blaze/math/shims/Real.h>
78 #include <blaze/math/shims/Sin.h>
79 #include <blaze/math/shims/Sinh.h>
80 #include <blaze/math/shims/Sqrt.h>
81 #include <blaze/math/shims/Tan.h>
82 #include <blaze/math/shims/Tanh.h>
90 #include <blaze/util/DisableIf.h>
91 #include <blaze/util/mpl/If.h>
93 
94 
95 namespace blaze {
96 
97 //=================================================================================================
98 //
99 // CLASS DEFINITION
100 //
101 //=================================================================================================
102 
103 //*************************************************************************************************
135 template< typename PT // Type of the proxy
136  , typename RT = int > // Type of the represented element
137 class Proxy
138  : public If_< IsVector<RT>
139  , If_< IsDenseVector<RT>
140  , DenseVectorProxy<PT,RT>
141  , SparseVectorProxy<PT,RT> >
142  , If_< IsMatrix<RT>
143  , If_< IsDenseMatrix<RT>
144  , DenseMatrixProxy<PT,RT>
145  , SparseMatrixProxy<PT,RT> >
146  , If_< IsComplex<RT>
147  , ComplexProxy<PT,RT>
148  , DefaultProxy<PT,RT> > > >
149 {};
150 //*************************************************************************************************
151 
152 
153 
154 
155 //=================================================================================================
156 //
157 // GLOBAL OPERATORS
158 //
159 //=================================================================================================
160 
161 //*************************************************************************************************
164 template< typename PT1, typename RT1, typename PT2, typename RT2 >
165 inline decltype(auto) operator+( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
166 
167 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
168 inline decltype(auto) operator+( const Proxy<PT,RT>& lhs, const T& rhs );
169 
170 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
171 inline decltype(auto) operator+( const T& lhs, const Proxy<PT,RT>& rhs );
172 
173 template< typename PT1, typename RT1, typename PT2, typename RT2 >
174 inline decltype(auto) operator-( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
175 
176 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
177 inline decltype(auto) operator-( const Proxy<PT,RT>& lhs, const T& rhs );
178 
179 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
180 inline decltype(auto) operator-( const T& lhs, const Proxy<PT,RT>& rhs );
181 
182 template< typename PT1, typename RT1, typename PT2, typename RT2 >
183 inline decltype(auto) operator*( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
184 
185 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
186 inline decltype(auto) operator*( const Proxy<PT,RT>& lhs, const T& rhs );
187 
188 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
189 inline decltype(auto) operator*( const T& lhs, const Proxy<PT,RT>& rhs );
190 
191 template< typename PT1, typename RT1, typename PT2, typename RT2 >
192 inline decltype(auto) operator/( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
193 
194 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
195 inline decltype(auto) operator/( const Proxy<PT,RT>& lhs, const T& rhs );
196 
197 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
198 inline decltype(auto) operator/( const T& lhs, const Proxy<PT,RT>& rhs );
199 
200 template< typename PT1, typename RT1, typename PT2, typename RT2 >
201 inline bool operator==( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
202 
203 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
204 inline bool operator==( const Proxy<PT,RT>& lhs, const T& rhs );
205 
206 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
207 inline bool 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, typename = DisableIf_< IsProxy<T> > >
213 inline bool operator!=( const Proxy<PT,RT>& lhs, const T& rhs );
214 
215 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
216 inline bool operator!=( const T& lhs, const Proxy<PT,RT>& rhs );
217 
218 template< typename PT1, typename RT1, typename PT2, typename RT2 >
219 inline bool operator<( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
220 
221 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
222 inline bool operator<( const Proxy<PT,RT>& lhs, const T& rhs );
223 
224 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
225 inline bool operator<( const T& lhs, const Proxy<PT,RT>& rhs );
226 
227 template< typename PT1, typename RT1, typename PT2, typename RT2 >
228 inline bool operator>( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
229 
230 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
231 inline bool operator>( const Proxy<PT,RT>& lhs, const T& rhs );
232 
233 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
234 inline bool operator>( const T& lhs, const Proxy<PT,RT>& rhs );
235 
236 template< typename PT1, typename RT1, typename PT2, typename RT2 >
237 inline bool operator<=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
238 
239 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
240 inline bool operator<=( const Proxy<PT,RT>& lhs, const T& rhs );
241 
242 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
243 inline bool operator<=( const T& lhs, const Proxy<PT,RT>& rhs );
244 
245 template< typename PT1, typename RT1, typename PT2, typename RT2 >
246 inline bool operator>=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
247 
248 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
249 inline bool operator>=( const Proxy<PT,RT>& lhs, const T& rhs );
250 
251 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
252 inline bool operator>=( const T& lhs, const Proxy<PT,RT>& rhs );
253 
254 template< typename PT, typename RT >
255 inline std::ostream& operator<<( std::ostream& os, const Proxy<PT,RT>& proxy );
257 //*************************************************************************************************
258 
259 
260 //*************************************************************************************************
268 template< typename PT1, typename RT1, typename PT2, typename RT2 >
269 inline decltype(auto) operator+( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
270 {
271  return (~lhs).get() + (~rhs).get();
272 }
273 //*************************************************************************************************
274 
275 
276 //*************************************************************************************************
284 template< typename PT, typename RT, typename T, typename >
285 inline decltype(auto) operator+( const Proxy<PT,RT>& lhs, const T& rhs )
286 {
287  return (~lhs).get() + rhs;
288 }
289 //*************************************************************************************************
290 
291 
292 //*************************************************************************************************
300 template< typename T, typename PT, typename RT, typename >
301 inline decltype(auto) operator+( const T& lhs, const Proxy<PT,RT>& rhs )
302 {
303  return lhs + (~rhs).get();
304 }
305 //*************************************************************************************************
306 
307 
308 //*************************************************************************************************
316 template< typename PT1, typename RT1, typename PT2, typename RT2 >
317 inline decltype(auto) operator-( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
318 {
319  return (~lhs).get() - (~rhs).get();
320 }
321 //*************************************************************************************************
322 
323 
324 //*************************************************************************************************
332 template< typename PT, typename RT, typename T, typename >
333 inline decltype(auto) operator-( const Proxy<PT,RT>& lhs, const T& rhs )
334 {
335  return (~lhs).get() - rhs;
336 }
337 //*************************************************************************************************
338 
339 
340 //*************************************************************************************************
348 template< typename T, typename PT, typename RT, typename >
349 inline decltype(auto) operator-( const T& lhs, const Proxy<PT,RT>& rhs )
350 {
351  return lhs - (~rhs).get();
352 }
353 //*************************************************************************************************
354 
355 
356 //*************************************************************************************************
364 template< typename PT1, typename RT1, typename PT2, typename RT2 >
365 inline decltype(auto) operator*( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
366 {
367  return (~lhs).get() * (~rhs).get();
368 }
369 //*************************************************************************************************
370 
371 
372 //*************************************************************************************************
380 template< typename PT, typename RT, typename T, typename >
381 inline decltype(auto) operator*( const Proxy<PT,RT>& lhs, const T& rhs )
382 {
383  return (~lhs).get() * rhs;
384 }
385 //*************************************************************************************************
386 
387 
388 //*************************************************************************************************
396 template< typename T, typename PT, typename RT, typename >
397 inline decltype(auto) operator*( const T& lhs, const Proxy<PT,RT>& rhs )
398 {
399  return lhs * (~rhs).get();
400 }
401 //*************************************************************************************************
402 
403 
404 //*************************************************************************************************
412 template< typename PT1, typename RT1, typename PT2, typename RT2 >
413 inline decltype(auto) operator/( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
414 {
415  return (~lhs).get() / (~rhs).get();
416 }
417 //*************************************************************************************************
418 
419 
420 //*************************************************************************************************
428 template< typename PT, typename RT, typename T, typename >
429 inline decltype(auto) operator/( const Proxy<PT,RT>& lhs, const T& rhs )
430 {
431  return (~lhs).get() / rhs;
432 }
433 //*************************************************************************************************
434 
435 
436 //*************************************************************************************************
444 template< typename T, typename PT, typename RT, typename >
445 inline decltype(auto) operator/( const T& lhs, const Proxy<PT,RT>& rhs )
446 {
447  return lhs / (~rhs).get();
448 }
449 //*************************************************************************************************
450 
451 
452 //*************************************************************************************************
460 template< typename PT1, typename RT1, typename PT2, typename RT2 >
461 inline bool operator==( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
462 {
463  return ( (~lhs).get() == (~rhs).get() );
464 }
465 //*************************************************************************************************
466 
467 
468 //*************************************************************************************************
476 template< typename PT, typename RT, typename T, typename >
477 inline bool operator==( const Proxy<PT,RT>& lhs, const T& rhs )
478 {
479  return ( (~lhs).get() == rhs );
480 }
481 //*************************************************************************************************
482 
483 
484 //*************************************************************************************************
492 template< typename T, typename PT, typename RT, typename >
493 inline decltype(auto) operator==( const T& lhs, const Proxy<PT,RT>& rhs )
494 {
495  return ( lhs == (~rhs).get() );
496 }
497 //*************************************************************************************************
498 
499 
500 //*************************************************************************************************
508 template< typename PT1, typename RT1, typename PT2, typename RT2 >
509 inline bool operator!=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
510 {
511  return ( (~lhs).get() != (~rhs).get() );
512 }
513 //*************************************************************************************************
514 
515 
516 //*************************************************************************************************
524 template< typename PT, typename RT, typename T, typename >
525 inline bool operator!=( const Proxy<PT,RT>& lhs, const T& rhs )
526 {
527  return ( (~lhs).get() != rhs );
528 }
529 //*************************************************************************************************
530 
531 
532 //*************************************************************************************************
540 template< typename T, typename PT, typename RT, typename >
541 inline bool operator!=( const T& lhs, const Proxy<PT,RT>& rhs )
542 {
543  return ( lhs != (~rhs).get() );
544 }
545 //*************************************************************************************************
546 
547 
548 //*************************************************************************************************
556 template< typename PT1, typename RT1, typename PT2, typename RT2 >
557 inline bool operator<( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
558 {
559  return ( (~lhs).get() < (~rhs).get() );
560 }
561 //*************************************************************************************************
562 
563 
564 //*************************************************************************************************
572 template< typename PT, typename RT, typename T, typename >
573 inline bool operator<( const Proxy<PT,RT>& lhs, const T& rhs )
574 {
575  return ( (~lhs).get() < rhs );
576 }
577 //*************************************************************************************************
578 
579 
580 //*************************************************************************************************
588 template< typename T, typename PT, typename RT, typename >
589 inline bool operator<( const T& lhs, const Proxy<PT,RT>& rhs )
590 {
591  return ( lhs < rhs.get() );
592 }
593 //*************************************************************************************************
594 
595 
596 //*************************************************************************************************
604 template< typename PT1, typename RT1, typename PT2, typename RT2 >
605 inline bool operator>( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
606 {
607  return ( (~lhs).get() > (~rhs).get() );
608 }
609 //*************************************************************************************************
610 
611 
612 //*************************************************************************************************
620 template< typename PT, typename RT, typename T, typename >
621 inline bool operator>( const Proxy<PT,RT>& lhs, const T& rhs )
622 {
623  return ( (~lhs).get() > rhs );
624 }
625 //*************************************************************************************************
626 
627 
628 //*************************************************************************************************
636 template< typename T, typename PT, typename RT, typename >
637 inline bool operator>( const T& lhs, const Proxy<PT,RT>& rhs )
638 {
639  return ( lhs > (~rhs).get() );
640 }
641 //*************************************************************************************************
642 
643 
644 //*************************************************************************************************
652 template< typename PT1, typename RT1, typename PT2, typename RT2 >
653 inline bool operator<=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
654 {
655  return ( (~lhs).get() <= (~rhs).get() );
656 }
657 //*************************************************************************************************
658 
659 
660 //*************************************************************************************************
668 template< typename PT, typename RT, typename T, typename >
669 inline bool operator<=( const Proxy<PT,RT>& lhs, const T& rhs )
670 {
671  return ( (~lhs).get() <= rhs );
672 }
673 //*************************************************************************************************
674 
675 
676 //*************************************************************************************************
684 template< typename T, typename PT, typename RT, typename >
685 inline bool operator<=( const T& lhs, const Proxy<PT,RT>& rhs )
686 {
687  return ( lhs <= (~rhs).get() );
688 }
689 //*************************************************************************************************
690 
691 
692 //*************************************************************************************************
700 template< typename PT1, typename RT1, typename PT2, typename RT2 >
701 inline bool operator>=( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
702 {
703  return ( (~lhs).get() >= (~rhs).get() );
704 }
705 //*************************************************************************************************
706 
707 
708 //*************************************************************************************************
716 template< typename PT, typename RT, typename T, typename >
717 inline bool operator>=( const Proxy<PT,RT>& lhs, const T& rhs )
718 {
719  return ( (~lhs).get() >= rhs );
720 }
721 //*************************************************************************************************
722 
723 
724 //*************************************************************************************************
732 template< typename T, typename PT, typename RT, typename >
733 inline bool operator>=( const T& lhs, const Proxy<PT,RT>& rhs )
734 {
735  return ( lhs >= (~rhs).get() );
736 }
737 //*************************************************************************************************
738 
739 
740 //*************************************************************************************************
748 template< typename PT, typename RT >
749 inline std::ostream& operator<<( std::ostream& os, const Proxy<PT,RT>& proxy )
750 {
751  return os << (~proxy).get();
752 }
753 //*************************************************************************************************
754 
755 
756 
757 
758 //=================================================================================================
759 //
760 // GLOBAL FUNCTIONS
761 //
762 //=================================================================================================
763 
764 //*************************************************************************************************
767 template< typename PT, typename RT >
768 inline decltype(auto) trans( const Proxy<PT,RT>& proxy );
769 
770 template< typename PT, typename RT >
771 inline decltype(auto) ctrans( const Proxy<PT,RT>& proxy );
772 
773 template< typename PT, typename RT >
774 inline decltype(auto) abs( const Proxy<PT,RT>& proxy );
775 
776 template< typename PT, typename RT >
777 inline decltype(auto) conj( const Proxy<PT,RT>& proxy );
778 
779 template< typename PT, typename RT >
780 inline decltype(auto) real( const Proxy<PT,RT>& proxy );
781 
782 template< typename PT, typename RT >
783 inline decltype(auto) imag( const Proxy<PT,RT>& proxy );
784 
785 template< typename PT, typename RT >
786 inline decltype(auto) sqrt( const Proxy<PT,RT>& proxy );
787 
788 template< typename PT, typename RT >
789 inline decltype(auto) invsqrt( const Proxy<PT,RT>& proxy );
790 
791 template< typename PT, typename RT >
792 inline decltype(auto) cbrt( const Proxy<PT,RT>& proxy );
793 
794 template< typename PT, typename RT >
795 inline decltype(auto) invcbrt( const Proxy<PT,RT>& proxy );
796 
797 template< typename PT, typename RT >
798 inline decltype(auto) floor( const Proxy<PT,RT>& proxy );
799 
800 template< typename PT, typename RT >
801 inline decltype(auto) ceil( const Proxy<PT,RT>& proxy );
802 
803 template< typename PT, typename RT, typename ET >
804 inline decltype(auto) pow( const Proxy<PT,RT>& proxy, const ET& exp );
805 
806 template< typename PT, typename RT >
807 inline decltype(auto) exp( const Proxy<PT,RT>& proxy );
808 
809 template< typename PT, typename RT >
810 inline decltype(auto) sin( const Proxy<PT,RT>& proxy );
811 
812 template< typename PT, typename RT >
813 inline decltype(auto) asin( const Proxy<PT,RT>& proxy );
814 
815 template< typename PT, typename RT >
816 inline decltype(auto) sinh( const Proxy<PT,RT>& proxy );
817 
818 template< typename PT, typename RT >
819 inline decltype(auto) asinh( const Proxy<PT,RT>& proxy );
820 
821 template< typename PT, typename RT >
822 inline decltype(auto) cos( const Proxy<PT,RT>& proxy );
823 
824 template< typename PT, typename RT >
825 inline decltype(auto) acos( const Proxy<PT,RT>& proxy );
826 
827 template< typename PT, typename RT >
828 inline decltype(auto) cosh( const Proxy<PT,RT>& proxy );
829 
830 template< typename PT, typename RT >
831 inline decltype(auto) acosh( const Proxy<PT,RT>& proxy );
832 
833 template< typename PT, typename RT >
834 inline decltype(auto) tan( const Proxy<PT,RT>& proxy );
835 
836 template< typename PT, typename RT >
837 inline decltype(auto) atan( const Proxy<PT,RT>& proxy );
838 
839 template< typename PT, typename RT >
840 inline decltype(auto) tanh( const Proxy<PT,RT>& proxy );
841 
842 template< typename PT, typename RT >
843 inline decltype(auto) atanh( const Proxy<PT,RT>& proxy );
844 
845 template< typename PT1, typename RT1, typename PT2, typename RT2 >
846 inline decltype(auto) min( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
847 
848 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
849 inline decltype(auto) min( const Proxy<PT,RT>& lhs, const T& rhs );
850 
851 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
852 inline decltype(auto) min( const T& lhs, const Proxy<PT,RT>& rhs );
853 
854 template< typename PT1, typename RT1, typename PT2, typename RT2 >
855 inline decltype(auto) max( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs );
856 
857 template< typename PT, typename RT, typename T, typename = DisableIf_< IsProxy<T> > >
858 inline decltype(auto) max( const Proxy<PT,RT>& lhs, const T& rhs );
859 
860 template< typename T, typename PT, typename RT, typename = DisableIf_< IsProxy<T> > >
861 inline decltype(auto) max( const T& lhs, const Proxy<PT,RT>& rhs );
862 
863 template< typename PT, typename RT >
864 inline void transpose( const Proxy<PT,RT>& proxy );
865 
866 template< typename PT, typename RT >
867 inline void ctranspose( const Proxy<PT,RT>& proxy );
868 
869 template< typename PT, typename RT >
870 inline void invert( const Proxy<PT,RT>& proxy );
871 
872 template< InversionFlag IF, typename PT, typename RT >
873 inline void invert( const Proxy<PT,RT>& proxy );
874 
875 template< bool RF, typename PT, typename RT >
876 inline bool isReal( const Proxy<PT,RT>& proxy );
877 
878 template< bool RF, typename PT, typename RT >
879 inline bool isZero( const Proxy<PT,RT>& proxy );
880 
881 template< bool RF, typename PT, typename RT >
882 inline bool isOne( const Proxy<PT,RT>& proxy );
883 
884 template< typename PT, typename RT >
885 inline bool isnan( const Proxy<PT,RT>& proxy );
887 //*************************************************************************************************
888 
889 
890 //*************************************************************************************************
900 template< typename PT, typename RT >
901 inline decltype(auto) trans( const Proxy<PT,RT>& proxy )
902 {
903  using blaze::trans;
904 
905  return trans( (~proxy).get() );
906 }
907 //*************************************************************************************************
908 
909 
910 //*************************************************************************************************
920 template< typename PT, typename RT >
921 inline decltype(auto) ctrans( const Proxy<PT,RT>& proxy )
922 {
923  using blaze::ctrans;
924 
925  return ctrans( (~proxy).get() );
926 }
927 //*************************************************************************************************
928 
929 
930 //*************************************************************************************************
941 template< typename PT, typename RT >
942 inline decltype(auto) abs( const Proxy<PT,RT>& proxy )
943 {
944  using blaze::abs;
945 
946  return abs( (~proxy).get() );
947 }
948 //*************************************************************************************************
949 
950 
951 //*************************************************************************************************
962 template< typename PT, typename RT >
963 inline decltype(auto) conj( const Proxy<PT,RT>& proxy )
964 {
965  using blaze::conj;
966 
967  return conj( (~proxy).get() );
968 }
969 //*************************************************************************************************
970 
971 
972 //*************************************************************************************************
983 template< typename PT, typename RT >
984 inline decltype(auto) real( const Proxy<PT,RT>& proxy )
985 {
986  using blaze::real;
987 
988  return real( (~proxy).get() );
989 }
990 //*************************************************************************************************
991 
992 
993 //*************************************************************************************************
1004 template< typename PT, typename RT >
1005 inline decltype(auto) imag( const Proxy<PT,RT>& proxy )
1006 {
1007  using blaze::imag;
1008 
1009  return imag( (~proxy).get() );
1010 }
1011 //*************************************************************************************************
1012 
1013 
1014 //*************************************************************************************************
1025 template< typename PT, typename RT >
1026 inline decltype(auto) sqrt( const Proxy<PT,RT>& proxy )
1027 {
1028  using blaze::sqrt;
1029 
1030  return sqrt( (~proxy).get() );
1031 }
1032 //*************************************************************************************************
1033 
1034 
1035 //*************************************************************************************************
1046 template< typename PT, typename RT >
1047 inline decltype(auto) invsqrt( const Proxy<PT,RT>& proxy )
1048 {
1049  using blaze::invsqrt;
1050 
1051  return invsqrt( (~proxy).get() );
1052 }
1053 //*************************************************************************************************
1054 
1055 
1056 //*************************************************************************************************
1067 template< typename PT, typename RT >
1068 inline decltype(auto) cbrt( const Proxy<PT,RT>& proxy )
1069 {
1070  using blaze::cbrt;
1071 
1072  return cbrt( (~proxy).get() );
1073 }
1074 //*************************************************************************************************
1075 
1076 
1077 //*************************************************************************************************
1088 template< typename PT, typename RT >
1089 inline decltype(auto) invcbrt( const Proxy<PT,RT>& proxy )
1090 {
1091  using blaze::invcbrt;
1092 
1093  return invcbrt( (~proxy).get() );
1094 }
1095 //*************************************************************************************************
1096 
1097 
1098 //*************************************************************************************************
1109 template< typename PT, typename RT >
1110 inline decltype(auto) floor( const Proxy<PT,RT>& proxy )
1111 {
1112  using blaze::floor;
1113 
1114  return floor( (~proxy).get() );
1115 }
1116 //*************************************************************************************************
1117 
1118 
1119 //*************************************************************************************************
1130 template< typename PT, typename RT >
1131 inline decltype(auto) ceil( const Proxy<PT,RT>& proxy )
1132 {
1133  using blaze::ceil;
1134 
1135  return ceil( (~proxy).get() );
1136 }
1137 //*************************************************************************************************
1138 
1139 
1140 //*************************************************************************************************
1152 template< typename PT, typename RT, typename ET >
1153 inline decltype(auto) pow( const Proxy<PT,RT>& proxy, const ET& exp )
1154 {
1155  using blaze::pow;
1156 
1157  return pow( (~proxy).get(), exp );
1158 }
1159 //*************************************************************************************************
1160 
1161 
1162 //*************************************************************************************************
1173 template< typename PT, typename RT >
1174 inline decltype(auto) exp( const Proxy<PT,RT>& proxy )
1175 {
1176  using blaze::exp;
1177 
1178  return exp( (~proxy).get() );
1179 }
1180 //*************************************************************************************************
1181 
1182 
1183 //*************************************************************************************************
1194 template< typename PT, typename RT >
1195 inline decltype(auto) sin( const Proxy<PT,RT>& proxy )
1196 {
1197  using blaze::sin;
1198 
1199  return sin( (~proxy).get() );
1200 }
1201 //*************************************************************************************************
1202 
1203 
1204 //*************************************************************************************************
1215 template< typename PT, typename RT >
1216 inline decltype(auto) asin( const Proxy<PT,RT>& proxy )
1217 {
1218  using blaze::asin;
1219 
1220  return asin( (~proxy).get() );
1221 }
1222 //*************************************************************************************************
1223 
1224 
1225 //*************************************************************************************************
1236 template< typename PT, typename RT >
1237 inline decltype(auto) sinh( const Proxy<PT,RT>& proxy )
1238 {
1239  using blaze::sinh;
1240 
1241  return sinh( (~proxy).get() );
1242 }
1243 //*************************************************************************************************
1244 
1245 
1246 //*************************************************************************************************
1257 template< typename PT, typename RT >
1258 inline decltype(auto) asinh( const Proxy<PT,RT>& proxy )
1259 {
1260  using blaze::asinh;
1261 
1262  return asinh( (~proxy).get() );
1263 }
1264 //*************************************************************************************************
1265 
1266 
1267 //*************************************************************************************************
1278 template< typename PT, typename RT >
1279 inline decltype(auto) cos( const Proxy<PT,RT>& proxy )
1280 {
1281  using blaze::cos;
1282 
1283  return cos( (~proxy).get() );
1284 }
1285 //*************************************************************************************************
1286 
1287 
1288 //*************************************************************************************************
1299 template< typename PT, typename RT >
1300 inline decltype(auto) acos( const Proxy<PT,RT>& proxy )
1301 {
1302  using blaze::acos;
1303 
1304  return acos( (~proxy).get() );
1305 }
1306 //*************************************************************************************************
1307 
1308 
1309 //*************************************************************************************************
1320 template< typename PT, typename RT >
1321 inline decltype(auto) cosh( const Proxy<PT,RT>& proxy )
1322 {
1323  using blaze::cosh;
1324 
1325  return cosh( (~proxy).get() );
1326 }
1327 //*************************************************************************************************
1328 
1329 
1330 //*************************************************************************************************
1341 template< typename PT, typename RT >
1342 inline decltype(auto) acosh( const Proxy<PT,RT>& proxy )
1343 {
1344  using blaze::acosh;
1345 
1346  return acosh( (~proxy).get() );
1347 }
1348 //*************************************************************************************************
1349 
1350 
1351 //*************************************************************************************************
1362 template< typename PT, typename RT >
1363 inline decltype(auto) tan( const Proxy<PT,RT>& proxy )
1364 {
1365  using blaze::tan;
1366 
1367  return tan( (~proxy).get() );
1368 }
1369 //*************************************************************************************************
1370 
1371 
1372 //*************************************************************************************************
1383 template< typename PT, typename RT >
1384 inline decltype(auto) atan( const Proxy<PT,RT>& proxy )
1385 {
1386  using blaze::atan;
1387 
1388  return atan( (~proxy).get() );
1389 }
1390 //*************************************************************************************************
1391 
1392 
1393 //*************************************************************************************************
1404 template< typename PT, typename RT >
1405 inline decltype(auto) tanh( const Proxy<PT,RT>& proxy )
1406 {
1407  using blaze::tanh;
1408 
1409  return tanh( (~proxy).get() );
1410 }
1411 //*************************************************************************************************
1412 
1413 
1414 //*************************************************************************************************
1425 template< typename PT, typename RT >
1426 inline decltype(auto) atanh( const Proxy<PT,RT>& proxy )
1427 {
1428  using blaze::atanh;
1429 
1430  return atanh( (~proxy).get() );
1431 }
1432 //*************************************************************************************************
1433 
1434 
1435 //*************************************************************************************************
1443 template< typename PT1, typename RT1, typename PT2, typename RT2 >
1444 inline decltype(auto) min( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
1445 {
1446  using blaze::min;
1447 
1448  return min( (~lhs).get(), (~rhs).get() );
1449 }
1450 //*************************************************************************************************
1451 
1452 
1453 //*************************************************************************************************
1461 template< typename PT, typename RT, typename T, typename >
1462 inline decltype(auto) min( const Proxy<PT,RT>& lhs, const T& rhs )
1463 {
1464  using blaze::min;
1465 
1466  return min( (~lhs).get(), rhs );
1467 }
1468 //*************************************************************************************************
1469 
1470 
1471 //*************************************************************************************************
1479 template< typename T, typename PT, typename RT, typename >
1480 inline decltype(auto) min( const T& lhs, const Proxy<PT,RT>& rhs )
1481 {
1482  using blaze::min;
1483 
1484  return min( lhs, (~rhs).get() );
1485 }
1486 //*************************************************************************************************
1487 
1488 
1489 //*************************************************************************************************
1497 template< typename PT1, typename RT1, typename PT2, typename RT2 >
1498 inline decltype(auto) max( const Proxy<PT1,RT1>& lhs, const Proxy<PT2,RT2>& rhs )
1499 {
1500  using blaze::max;
1501 
1502  return max( (~lhs).get(), (~rhs).get() );
1503 }
1504 //*************************************************************************************************
1505 
1506 
1507 //*************************************************************************************************
1515 template< typename PT, typename RT, typename T, typename >
1516 inline decltype(auto) max( const Proxy<PT,RT>& lhs, const T& rhs )
1517 {
1518  using blaze::max;
1519 
1520  return max( (~lhs).get(), rhs );
1521 }
1522 //*************************************************************************************************
1523 
1524 
1525 //*************************************************************************************************
1533 template< typename T, typename PT, typename RT, typename >
1534 inline decltype(auto) max( const T& lhs, const Proxy<PT,RT>& rhs )
1535 {
1536  using blaze::max;
1537 
1538  return max( lhs, (~rhs).get() );
1539 }
1540 //*************************************************************************************************
1541 
1542 
1543 //*************************************************************************************************
1554 template< typename PT, typename RT >
1555 inline decltype(auto) erf( const Proxy<PT,RT>& proxy )
1556 {
1557  using blaze::erf;
1558 
1559  return erf( (~proxy).get() );
1560 }
1561 //*************************************************************************************************
1562 
1563 
1564 //*************************************************************************************************
1576 template< typename PT, typename RT >
1577 inline decltype(auto) erfc( const Proxy<PT,RT>& proxy )
1578 {
1579  using blaze::erfc;
1580 
1581  return erfc( (~proxy).get() );
1582 }
1583 //*************************************************************************************************
1584 
1585 
1586 //*************************************************************************************************
1603 template< typename PT, typename RT >
1604 inline void transpose( const Proxy<PT,RT>& proxy )
1605 {
1606  if( (~proxy).isRestricted() ) {
1607  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
1608  }
1609 
1610  transpose( (~proxy).get() );
1611 }
1612 //*************************************************************************************************
1613 
1614 
1615 //*************************************************************************************************
1632 template< typename PT, typename RT >
1633 inline void ctranspose( const Proxy<PT,RT>& proxy )
1634 {
1635  if( (~proxy).isRestricted() ) {
1636  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
1637  }
1638 
1639  ctranspose( (~proxy).get() );
1640 }
1641 //*************************************************************************************************
1642 
1643 
1644 //*************************************************************************************************
1672 template< typename PT, typename RT >
1673 inline void invert( const Proxy<PT,RT>& proxy )
1674 {
1675  if( (~proxy).isRestricted() ) {
1676  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
1677  }
1678 
1679  invert( (~proxy).get() );
1680 }
1681 //*************************************************************************************************
1682 
1683 
1684 //*************************************************************************************************
1721 template< InversionFlag IF, typename PT, typename RT >
1722 inline void invert( const Proxy<PT,RT>& proxy )
1723 {
1724  if( (~proxy).isRestricted() ) {
1725  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to restricted element" );
1726  }
1727 
1728  invert<IF>( (~proxy).get() );
1729 }
1730 //*************************************************************************************************
1731 
1732 
1733 //*************************************************************************************************
1745 template< bool RF, typename PT, typename RT >
1746 inline bool isReal( const Proxy<PT,RT>& proxy )
1747 {
1748  using blaze::isReal;
1749 
1750  return isReal<RF>( (~proxy).get() );
1751 }
1752 //*************************************************************************************************
1753 
1754 
1755 //*************************************************************************************************
1765 template< bool RF, typename PT, typename RT >
1766 inline bool isZero( const Proxy<PT,RT>& proxy )
1767 {
1768  using blaze::isZero;
1769 
1770  return isZero<RF>( (~proxy).get() );
1771 }
1772 //*************************************************************************************************
1773 
1774 
1775 //*************************************************************************************************
1785 template< bool RF, typename PT, typename RT >
1786 inline bool isOne( const Proxy<PT,RT>& proxy )
1787 {
1788  using blaze::isOne;
1789 
1790  return isOne<RF>( (~proxy).get() );
1791 }
1792 //*************************************************************************************************
1793 
1794 
1795 //*************************************************************************************************
1805 template< typename PT, typename RT >
1806 inline bool isnan( const Proxy<PT,RT>& proxy )
1807 {
1808  using blaze::isnan;
1809 
1810  return isnan( (~proxy).get() );
1811 }
1812 //*************************************************************************************************
1813 
1814 } // namespace blaze
1815 
1816 #endif
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:622
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
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:1762
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:661
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:1809
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:642
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:57
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:682
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) pow(const DenseMatrix< MT, SO > &dm, ET exp)
Computes the exponential value for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1607
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:662
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:790
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:635