35 #ifndef _BLAZE_MATH_PROXY_PROXY_H_
36 #define _BLAZE_MATH_PROXY_PROXY_H_
117 template<
typename PT
118 ,
typename RT =
int >
119 class Proxy :
public If< IsVector<RT>
120 , typename If< IsDenseVector<RT>
121 , DenseVectorProxy<PT,RT>
122 , SparseVectorProxy<PT,RT>
124 , typename If< IsMatrix<RT>
125 , typename If< IsDenseMatrix<RT>
126 , DenseMatrixProxy<PT,RT>
127 , SparseMatrixProxy<PT,RT>
129 , typename If< IsComplex<RT>
130 , ComplexProxy<PT,RT>
131 , DefaultProxy<PT,RT>
150 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
151 inline typename AddExprTrait<RT1,RT2>::Type
152 operator+(
const Proxy<PT1,RT1>& lhs,
const Proxy<PT2,RT2>& rhs );
154 template<
typename PT,
typename RT,
typename T >
155 inline typename DisableIf< IsProxy<T>,
typename AddExprTrait<RT,T>::Type >::Type
156 operator+(
const Proxy<PT,RT>& lhs,
const T& rhs );
158 template<
typename T,
typename PT,
typename RT >
159 inline typename DisableIf< IsProxy<T>,
typename AddExprTrait<T,RT>::Type >::Type
160 operator+(
const T& lhs,
const Proxy<PT,RT>& rhs );
162 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
163 inline typename SubExprTrait<RT1,RT2>::Type
164 operator-(
const Proxy<PT1,RT1>& lhs,
const Proxy<PT2,RT2>& rhs );
166 template<
typename PT,
typename RT,
typename T >
167 inline typename DisableIf< IsProxy<T>,
typename SubExprTrait<RT,T>::Type >::Type
168 operator-(
const Proxy<PT,RT>& lhs,
const T& rhs );
170 template<
typename T,
typename PT,
typename RT >
171 inline typename DisableIf< IsProxy<T>,
typename SubExprTrait<T,RT>::Type >::Type
172 operator-(
const T& lhs,
const Proxy<PT,RT>& rhs );
174 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
175 inline typename MultExprTrait<RT1,RT2>::Type
176 operator*(
const Proxy<PT1,RT1>& lhs,
const Proxy<PT2,RT2>& rhs );
178 template<
typename PT,
typename RT,
typename T >
179 inline typename DisableIf< IsProxy<T>,
typename MultExprTrait<RT,T>::Type >::Type
180 operator*(
const Proxy<PT,RT>& lhs,
const T& rhs );
182 template<
typename T,
typename PT,
typename RT >
183 inline typename DisableIf< IsProxy<T>,
typename MultExprTrait<T,RT>::Type >::Type
184 operator*(
const T& lhs,
const Proxy<PT,RT>& rhs );
186 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
187 inline typename DivExprTrait<RT1,RT2>::Type
188 operator/(
const Proxy<PT1,RT1>& lhs,
const Proxy<PT2,RT2>& rhs );
190 template<
typename PT,
typename RT,
typename T >
191 inline typename DisableIf< IsProxy<T>,
typename DivExprTrait<RT,T>::Type >::Type
192 operator/(
const Proxy<PT,RT>& lhs,
const T& rhs );
194 template<
typename T,
typename PT,
typename RT >
195 inline typename DisableIf< IsProxy<T>,
typename DivExprTrait<T,RT>::Type >::Type
196 operator/(
const T& lhs,
const Proxy<PT,RT>& rhs );
198 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
199 inline bool operator==(
const Proxy<PT1,RT1>& lhs,
const Proxy<PT2,RT2>& rhs );
201 template<
typename PT,
typename RT,
typename T >
202 inline typename DisableIf< IsProxy<T>,
bool >::Type
203 operator==(
const Proxy<PT,RT>& lhs,
const T& rhs );
205 template<
typename T,
typename PT,
typename RT >
206 inline typename DisableIf< IsProxy<T>,
bool >::Type
207 operator==(
const T& lhs,
const Proxy<PT,RT>& rhs );
209 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
210 inline bool operator!=(
const Proxy<PT1,RT1>& lhs,
const Proxy<PT2,RT2>& rhs );
212 template<
typename PT,
typename RT,
typename T >
213 inline typename DisableIf< IsProxy<T>,
bool >::Type
214 operator!=(
const Proxy<PT,RT>& lhs,
const T& rhs );
216 template<
typename T,
typename PT,
typename RT >
217 inline typename DisableIf< IsProxy<T>,
bool >::Type
218 operator!=(
const T& lhs,
const Proxy<PT,RT>& rhs );
220 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
221 inline bool operator<( const Proxy<PT1,RT1>& lhs,
const Proxy<PT2,RT2>& rhs );
223 template<
typename PT,
typename RT,
typename T >
224 inline typename DisableIf< IsProxy<T>,
bool >::Type
225 operator<( const Proxy<PT,RT>& lhs,
const T& rhs );
227 template<
typename T,
typename PT,
typename RT >
228 inline typename DisableIf< IsProxy<T>,
bool >::Type
229 operator<( const T& lhs, const Proxy<PT,RT>& rhs );
231 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
232 inline bool operator>(
const Proxy<PT1,RT1>& lhs,
const Proxy<PT2,RT2>& rhs );
234 template<
typename PT,
typename RT,
typename T >
235 inline typename DisableIf< IsProxy<T>,
bool >::Type
236 operator>(
const Proxy<PT,RT>& lhs,
const T& rhs );
238 template<
typename T,
typename PT,
typename RT >
239 inline typename DisableIf< IsProxy<T>,
bool >::Type
240 operator>(
const T& lhs,
const Proxy<PT,RT>& rhs );
242 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
243 inline bool operator<=( const Proxy<PT1,RT1>& lhs,
const Proxy<PT2,RT2>& rhs );
245 template<
typename PT,
typename RT,
typename T >
246 inline typename DisableIf< IsProxy<T>,
bool >::Type
247 operator<=( const Proxy<PT,RT>& lhs,
const T& rhs );
249 template<
typename T,
typename PT,
typename RT >
250 inline typename DisableIf< IsProxy<T>,
bool >::Type
251 operator<=( const T& lhs, const Proxy<PT,RT>& rhs );
253 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
254 inline bool operator>=(
const Proxy<PT1,RT1>& lhs,
const Proxy<PT2,RT2>& rhs );
256 template<
typename PT,
typename RT,
typename T >
257 inline typename DisableIf< IsProxy<T>,
bool >::Type
258 operator>=(
const Proxy<PT,RT>& lhs,
const T& rhs );
260 template<
typename T,
typename PT,
typename RT >
261 inline typename DisableIf< IsProxy<T>,
bool >::Type
262 operator>=(
const T& lhs,
const Proxy<PT,RT>& rhs );
264 template<
typename PT,
typename RT >
265 inline std::ostream& operator<<( std::ostream& os, const Proxy<PT,RT>& proxy );
278 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
279 inline typename AddExprTrait<RT1,RT2>::Type
282 return (~lhs).get() + (~rhs).
get();
295 template<
typename PT,
typename RT,
typename T >
296 inline typename DisableIf< IsProxy<T>,
typename AddExprTrait<RT,T>::Type >::Type
299 return (~lhs).get() + rhs;
312 template<
typename T,
typename PT,
typename RT >
313 inline typename DisableIf< IsProxy<T>,
typename AddExprTrait<T,RT>::Type >::Type
316 return lhs + (~rhs).
get();
329 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
330 inline typename SubExprTrait<RT1,RT2>::Type
333 return (~lhs).get() - (~rhs).
get();
346 template<
typename PT,
typename RT,
typename T >
347 inline typename DisableIf< IsProxy<T>,
typename SubExprTrait<RT,T>::Type >::Type
350 return (~lhs).get() - rhs;
363 template<
typename T,
typename PT,
typename RT >
364 inline typename DisableIf< IsProxy<T>,
typename SubExprTrait<T,RT>::Type >::Type
367 return lhs - (~rhs).
get();
380 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
381 inline typename MultExprTrait<RT1,RT2>::Type
384 return (~lhs).get() * (~rhs).
get();
397 template<
typename PT,
typename RT,
typename T >
398 inline typename DisableIf< IsProxy<T>,
typename MultExprTrait<RT,T>::Type >::Type
401 return (~lhs).get() * rhs;
414 template<
typename T,
typename PT,
typename RT >
415 inline typename DisableIf< IsProxy<T>,
typename MultExprTrait<T,RT>::Type >::Type
418 return lhs * (~rhs).
get();
431 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
432 inline typename DivExprTrait<RT1,RT2>::Type
435 return (~lhs).get() / (~rhs).
get();
448 template<
typename PT,
typename RT,
typename T >
449 inline typename DisableIf< IsProxy<T>,
typename DivExprTrait<RT,T>::Type >::Type
452 return (~lhs).get() / rhs;
465 template<
typename T,
typename PT,
typename RT >
466 inline typename DisableIf< IsProxy<T>,
typename DivExprTrait<T,RT>::Type >::Type
469 return lhs / (~rhs).
get();
482 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
485 return ( (~lhs).
get() == (~rhs).
get() );
498 template<
typename PT,
typename RT,
typename T >
499 inline typename DisableIf< IsProxy<T>,
bool >::Type
502 return ( (~lhs).
get() == rhs );
515 template<
typename T,
typename PT,
typename RT >
516 inline typename DisableIf< IsProxy<T>,
bool >::Type
519 return ( lhs == (~rhs).
get() );
532 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
535 return ( (~lhs).
get() != (~rhs).
get() );
548 template<
typename PT,
typename RT,
typename T >
549 inline typename DisableIf< IsProxy<T>,
bool >::Type
552 return ( (~lhs).
get() != rhs );
565 template<
typename T,
typename PT,
typename RT >
566 inline typename DisableIf< IsProxy<T>,
bool >::Type
569 return ( lhs != (~rhs).
get() );
582 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
585 return ( (~lhs).get() < (~rhs).
get() );
598 template<
typename PT,
typename RT,
typename T >
599 inline typename DisableIf< IsProxy<T>,
bool >::Type
600 operator<( const Proxy<PT,RT>& lhs,
const T& rhs )
602 return ( (~lhs).get() < rhs );
615 template<
typename T,
typename PT,
typename RT >
616 inline typename DisableIf< IsProxy<T>,
bool >::Type
617 operator<( const T& lhs, const Proxy<PT,RT>& rhs )
619 return ( lhs < rhs.get() );
632 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
635 return ( (~lhs).
get() > (~rhs).
get() );
648 template<
typename PT,
typename RT,
typename T >
649 inline typename DisableIf< IsProxy<T>,
bool >::Type
652 return ( (~lhs).
get() > rhs );
665 template<
typename T,
typename PT,
typename RT >
666 inline typename DisableIf< IsProxy<T>,
bool >::Type
669 return ( lhs > (~rhs).
get() );
682 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
685 return ( (~lhs).get() <= (~rhs).
get() );
698 template<
typename PT,
typename RT,
typename T >
699 inline typename DisableIf< IsProxy<T>,
bool >::Type
700 operator<=( const Proxy<PT,RT>& lhs,
const T& rhs )
702 return ( (~lhs).get() <= rhs );
715 template<
typename T,
typename PT,
typename RT >
716 inline typename DisableIf< IsProxy<T>,
bool >::Type
717 operator<=( const T& lhs, const Proxy<PT,RT>& rhs )
719 return ( lhs <= (~rhs).get() );
732 template<
typename PT1,
typename RT1,
typename PT2,
typename RT2 >
735 return ( (~lhs).
get() >= (~rhs).
get() );
748 template<
typename PT,
typename RT,
typename T >
749 inline typename DisableIf< IsProxy<T>,
bool >::Type
752 return ( (~lhs).
get() >= rhs );
765 template<
typename T,
typename PT,
typename RT >
766 inline typename DisableIf< IsProxy<T>,
bool >::Type
769 return ( lhs >= (~rhs).
get() );
782 template<
typename PT,
typename RT >
783 inline std::ostream& operator<<( std::ostream& os, const Proxy<PT,RT>& proxy )
785 return os << (~proxy).
get();
801 template<
typename PT,
typename RT >
802 inline typename TransExprTrait< typename PT::RepresentedType >::Type
803 trans(
const Proxy<PT,RT>& proxy );
805 template<
typename PT,
typename RT >
806 inline typename AbsExprTrait< typename PT::RepresentedType >::Type
807 abs(
const Proxy<PT,RT>& proxy );
809 template<
typename PT,
typename RT >
810 inline typename CTransExprTrait< typename PT::RepresentedType >::Type
811 ctrans(
const Proxy<PT,RT>& proxy );
813 template<
typename PT,
typename RT >
814 inline typename RealExprTrait< typename PT::RepresentedType >::Type
815 real(
const Proxy<PT,RT>& proxy );
817 template<
typename PT,
typename RT >
818 inline typename ImagExprTrait< typename PT::RepresentedType >::Type
819 imag(
const Proxy<PT,RT>& proxy );
821 template<
typename PT,
typename RT >
822 inline void transpose(
const Proxy<PT,RT>& proxy );
824 template<
typename PT,
typename RT >
825 inline void ctranspose(
const Proxy<PT,RT>& proxy );
827 template<
typename PT,
typename RT >
828 inline void invert(
const Proxy<PT,RT>& proxy );
830 template< InversionFlag IF,
typename PT,
typename RT >
831 inline void invert(
const Proxy<PT,RT>& proxy );
833 template<
typename PT,
typename RT >
834 inline bool isReal(
const Proxy<PT,RT>& proxy );
836 template<
typename PT,
typename RT >
837 inline bool isZero(
const Proxy<PT,RT>& proxy );
839 template<
typename PT,
typename RT >
840 inline bool isOne(
const Proxy<PT,RT>& proxy );
842 template<
typename PT,
typename RT >
843 inline bool isnan(
const Proxy<PT,RT>& proxy );
858 template<
typename PT,
typename RT >
859 inline typename TransExprTrait< typename PT::RepresentedType >::Typ
864 return trans( (~proxy).
get() );
880 template<
typename PT,
typename RT >
881 inline typename AbsExprTrait< typename PT::RepresentedType >::Type
886 return abs( (~proxy).
get() );
901 template<
typename PT,
typename RT >
902 inline typename CTransExprTrait< typename PT::RepresentedType >::Type
907 return ctrans( (~proxy).
get() );
923 template<
typename PT,
typename RT >
924 inline typename RealExprTrait< typename PT::RepresentedType >::Type
929 return real( (~proxy).
get() );
945 template<
typename PT,
typename RT >
946 inline typename ImagExprTrait< typename PT::RepresentedType >::Type
951 return imag( (~proxy).
get() );
973 template<
typename PT,
typename RT >
976 if( (~proxy).isRestricted() ) {
1002 template<
typename PT,
typename RT >
1005 if( (~proxy).isRestricted() ) {
1042 template<
typename PT,
typename RT >
1045 if( (~proxy).isRestricted() ) {
1049 invert( (~proxy).
get() );
1091 template< InversionFlag IF,
typename PT,
typename RT >
1094 if( (~proxy).isRestricted() ) {
1098 invert<IF>( (~proxy).
get() );
1115 template<
typename PT,
typename RT >
1120 return isReal( (~proxy).
get() );
1135 template<
typename PT,
typename RT >
1140 return isZero( (~proxy).
get() );
1155 template<
typename PT,
typename RT >
1160 return isOne( (~proxy).
get() );
1175 template<
typename PT,
typename RT >
1180 return isnan( (~proxy).
get() );
Header file for the isnan shim.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
Header file for the ImagExprTrait class template.
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:609
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7820
const EnableIf< IsNumeric< T2 >, typename DivExprTrait< T1, T2 >::Type >::Type operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:962
Header file for the SparseVectorProxy class.
AbsExprTrait< typename PT::RepresentedType >::Type abs(const Proxy< PT, RT > &proxy)
Computing the absolute value of the represented element.
Definition: Proxy.h:882
Header file for the imaginary shim.
Proxy base class.The Proxy class is a base class for all proxy classes within the Blaze library that ...
Definition: Forward.h:51
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:569
Header file for the dense matrix inversion flags.
Header file for the DefaultProxy class.
Header file for the DenseMatrixProxy class.
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
const DMatAbsExpr< MT, SO > abs(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the absolute values of each single element of dm.
Definition: DMatAbsExpr.h:938
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:584
Header file for the AddExprTrait class template.
bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:442
Header file for the RealExprTrait class template.
Header file for the invert shim.
Header file for the DenseVectorProxy class.
const ImagExprTrait< MT >::Type imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatImagExpr.h:920
Header file for the IsMatrix type trait.
Header file for the DivExprTrait class template.
Header file for the MultExprTrait class template.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:767
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for the ComplexProxy class.
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:610
Header file for the isZero shim.
const CTransExprTrait< MT >::Type ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatConjExpr.h:974
const RealExprTrait< MT >::Type real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatRealExpr.h:920
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:642
Header file for the real shim.
bool isnan(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is not a number.
Definition: DiagonalProxy.h:629
Header file for the SparseMatrixProxy class.
Header file for the IsVector type trait.
Header file for the IsDenseMatrix type trait.
Header file for the isOne shim.
Header file for the IsProxy type trait.
Header file for the TransExprTrait class template.
Header file for the IsDenseVector type trait.
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:589
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
Header file for the IsComplex type trait.
Header file for exception macros.
Header file for the CTransExprTrait class template.
Header file for the AbsExprTrait class template.
Header file for the SubExprTrait class template.
Header file for the isReal shim.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:558