Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:14

0001 // @(#)root/smatrix:$Id$
0002 // Authors: T. Glebe, L. Moneta    2005
0003 
0004 #ifndef ROOT_Math_BinaryOperators
0005 #define ROOT_Math_BinaryOperators
0006 //======================================================
0007 //
0008 // ATTENTION: This file was automatically generated,
0009 //            do not edit!
0010 //
0011 // author:    Thorsten Glebe
0012 //            HERA-B Collaboration
0013 //            Max-Planck-Institut fuer Kernphysik
0014 //            Saupfercheckweg 1
0015 //            69117 Heidelberg
0016 //            Germany
0017 //            E-mail: T.Glebe@mpi-hd.mpg.de
0018 //
0019 //======================================================
0020 
0021 #include "Math/BinaryOpPolicy.h"
0022 #include "Math/Expression.h"
0023 
0024 namespace ROOT {
0025 
0026   namespace Math {
0027 
0028 
0029 
0030 template <class T, unsigned int D> class SVector;
0031 template <class T, unsigned int D1, unsigned int D2, class R> class SMatrix;
0032 
0033 
0034 //==============================================================================
0035 // AddOp
0036 //==============================================================================
0037 /**
0038    Addition Operation Class
0039 
0040    @ingroup Expression
0041  */
0042 template <class T>
0043 class AddOp {
0044 public:
0045   static inline T apply(const T& lhs, const T& rhs) {
0046     return lhs + rhs;
0047   }
0048 };
0049 
0050 
0051 /**
0052    Addition of two vectors v3 = v1+v2
0053    returning a vector expression
0054 
0055    @ingroup VectFunction
0056 */
0057 //==============================================================================
0058 // operator+ (SVector, binary)
0059 //==============================================================================
0060 template <  class T, unsigned int D>
0061 inline VecExpr<BinaryOp<AddOp<T>, SVector<T,D>, SVector<T,D>, T>, T, D>
0062  operator+(const SVector<T,D>& lhs, const SVector<T,D>& rhs) {
0063   typedef BinaryOp<AddOp<T>, SVector<T,D>, SVector<T,D>, T> AddOpBinOp;
0064 
0065   return VecExpr<AddOpBinOp,T,D>(AddOpBinOp(AddOp<T>(),lhs,rhs));
0066 }
0067 
0068 
0069 //==============================================================================
0070 // operator+ (SVector, binary)
0071 //==============================================================================
0072 template <class A,  class T, unsigned int D>
0073 inline VecExpr<BinaryOp<AddOp<T>, VecExpr<A,T,D>, SVector<T,D>, T>, T, D>
0074  operator+(const VecExpr<A,T,D>& lhs, const SVector<T,D>& rhs) {
0075   typedef BinaryOp<AddOp<T>, VecExpr<A,T,D>, SVector<T,D>, T> AddOpBinOp;
0076 
0077   return VecExpr<AddOpBinOp,T,D>(AddOpBinOp(AddOp<T>(),lhs,rhs));
0078 }
0079 
0080 
0081 //==============================================================================
0082 // operator+ (SVector, binary)
0083 //==============================================================================
0084 template < class A, class T, unsigned int D>
0085 inline VecExpr<BinaryOp<AddOp<T>, SVector<T,D>, VecExpr<A,T,D>, T>, T, D>
0086  operator+(const SVector<T,D>& lhs, const VecExpr<A,T,D>& rhs) {
0087   typedef BinaryOp<AddOp<T>, SVector<T,D>, VecExpr<A,T,D>, T> AddOpBinOp;
0088 
0089   return VecExpr<AddOpBinOp,T,D>(AddOpBinOp(AddOp<T>(),lhs,rhs));
0090 }
0091 
0092 
0093 //==============================================================================
0094 // operator+ (SVector, binary)
0095 //==============================================================================
0096 template <class A, class B, class T, unsigned int D>
0097 inline VecExpr<BinaryOp<AddOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T>, T, D>
0098  operator+(const VecExpr<A,T,D>& lhs, const VecExpr<B,T,D>& rhs) {
0099   typedef BinaryOp<AddOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T> AddOpBinOp;
0100 
0101   return VecExpr<AddOpBinOp,T,D>(AddOpBinOp(AddOp<T>(),lhs,rhs));
0102 }
0103 
0104 
0105 /**
0106    Addition of a scalar to a each vector element:  v2(i) = v1(i) + a
0107    returning a vector expression
0108 
0109    @ingroup VectFunction
0110 */
0111 //==============================================================================
0112 // operator+ (SVector, binary, Constant)
0113 //==============================================================================
0114 template <class A,  class T, unsigned int D>
0115 inline VecExpr<BinaryOpCopyR<AddOp<T>, SVector<T,D>, Constant<A>, T>, T, D>
0116  operator+(const SVector<T,D>& lhs, const A& rhs) {
0117   typedef BinaryOpCopyR<AddOp<T>, SVector<T,D>, Constant<A>, T> AddOpBinOp;
0118 
0119   return VecExpr<AddOpBinOp,T,D>(AddOpBinOp(AddOp<T>(),lhs,Constant<A>(rhs)));
0120 }
0121 
0122 /**
0123    Addition of a scalar to each vector element v2(i) = a + v1(i)
0124    returning a vector expression
0125 
0126    @ingroup VectFunction
0127 */
0128 //==============================================================================
0129 // operator+ (SVector, binary, Constant)
0130 //==============================================================================
0131 template <class A,  class T, unsigned int D>
0132 inline VecExpr<BinaryOpCopyL<AddOp<T>, Constant<A>, SVector<T,D>, T>, T, D>
0133  operator+(const A& lhs, const SVector<T,D>& rhs) {
0134   typedef BinaryOpCopyL<AddOp<T>, Constant<A>, SVector<T,D>, T> AddOpBinOp;
0135 
0136   return VecExpr<AddOpBinOp,T,D>(AddOpBinOp(AddOp<T>(),Constant<A>(lhs),rhs));
0137 }
0138 
0139 
0140 //==============================================================================
0141 // operator+ (SVector, binary, Constant)
0142 //==============================================================================
0143 template <class A, class B, class T, unsigned int D>
0144 inline VecExpr<BinaryOpCopyR<AddOp<T>, VecExpr<B,T,D>, Constant<A>, T>, T, D>
0145  operator+(const VecExpr<B,T,D>& lhs, const A& rhs) {
0146   typedef BinaryOpCopyR<AddOp<T>, VecExpr<B,T,D>, Constant<A>, T> AddOpBinOp;
0147 
0148   return VecExpr<AddOpBinOp,T,D>(AddOpBinOp(AddOp<T>(),lhs,Constant<A>(rhs)));
0149 }
0150 
0151 //==============================================================================
0152 // operator+ (SVector, binary, Constant)
0153 //==============================================================================
0154 template <class A, class B, class T, unsigned int D>
0155 inline VecExpr<BinaryOpCopyL<AddOp<T>, Constant<A>, VecExpr<B,T,D>, T>, T, D>
0156  operator+(const A& lhs, const VecExpr<B,T,D>& rhs) {
0157   typedef BinaryOpCopyL<AddOp<T>, Constant<A>, VecExpr<B,T,D>, T> AddOpBinOp;
0158 
0159   return VecExpr<AddOpBinOp,T,D>(AddOpBinOp(AddOp<T>(),Constant<A>(lhs),rhs));
0160 }
0161 
0162 
0163 /**
0164    Addition of two matrices C = A+B
0165    returning a matrix expression
0166 
0167    @ingroup MatrixFunctions
0168 */
0169 //==============================================================================
0170 // operator+ (SMatrix, binary)
0171 //==============================================================================
0172 template <  class T, unsigned int D, unsigned int D2, class R1, class R2>
0173 inline Expr<BinaryOp<AddOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType >
0174  operator+(const SMatrix<T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
0175   typedef BinaryOp<AddOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> AddOpBinOp;
0176 
0177   return Expr<AddOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(AddOpBinOp(AddOp<T>(),lhs,rhs));
0178 }
0179 
0180 
0181 //==============================================================================
0182 // operator+ (SMatrix, binary)
0183 //==============================================================================
0184 template <class A,  class T, unsigned int D, unsigned int D2, class R1, class R2>
0185 inline Expr<BinaryOp<AddOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
0186  operator+(const Expr<A,T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
0187   typedef BinaryOp<AddOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> AddOpBinOp;
0188 
0189   return Expr<AddOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(AddOpBinOp(AddOp<T>(),lhs,rhs));
0190 }
0191 
0192 
0193 //==============================================================================
0194 // operator+ (SMatrix, binary)
0195 //==============================================================================
0196 template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
0197 inline Expr<BinaryOp<AddOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T>, T, D, D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>
0198  operator+(const SMatrix<T,D,D2,R1>& lhs, const Expr<A,T,D,D2,R2>& rhs) {
0199   typedef BinaryOp<AddOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T> AddOpBinOp;
0200 
0201   return Expr<AddOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(AddOpBinOp(AddOp<T>(),lhs,rhs));
0202 }
0203 
0204 
0205 //==============================================================================
0206 // operator+ (SMatrix, binary)
0207 //==============================================================================
0208 template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
0209 inline Expr<BinaryOp<AddOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType >
0210  operator+(const Expr<A,T,D,D2,R1>& lhs, const Expr<B,T,D,D2,R2>& rhs) {
0211   typedef BinaryOp<AddOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T> AddOpBinOp;
0212 
0213   return Expr<AddOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(AddOpBinOp(AddOp<T>(),lhs,rhs));
0214 }
0215 
0216 
0217 /**
0218    Addition element by element of matrix and a scalar  C(i,j) = A(i,j) + s
0219    returning a matrix expression
0220 
0221    @ingroup MatrixFunctions
0222 */
0223 //=============================================================================
0224 // operator+ (SMatrix, binary, Constant)
0225 //=============================================================================
0226 template <class A,  class T, unsigned int D, unsigned int D2, class R>
0227 inline Expr<BinaryOpCopyR<AddOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
0228  operator+(const SMatrix<T,D,D2,R>& lhs, const A& rhs) {
0229   typedef BinaryOpCopyR<AddOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T> AddOpBinOp;
0230 
0231   return Expr<AddOpBinOp,T,D,D2,R>(AddOpBinOp(AddOp<T>(),lhs,Constant<A>(rhs)));
0232 }
0233 
0234 /**
0235    Addition element by element of matrix and a scalar  C(i,j) = s + A(i,j)
0236    returning a matrix expression
0237 
0238    @ingroup MatrixFunctions
0239 */
0240 //==============================================================================
0241 // operator+ (SMatrix, binary, Constant)
0242 //==============================================================================
0243 template <class A,  class T, unsigned int D, unsigned int D2, class R>
0244 inline Expr<BinaryOpCopyL<AddOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R>
0245  operator+(const A& lhs, const SMatrix<T,D,D2,R>& rhs) {
0246   typedef BinaryOpCopyL<AddOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T> AddOpBinOp;
0247 
0248   return Expr<AddOpBinOp,T,D,D2,R>(AddOpBinOp(AddOp<T>(),
0249                                               Constant<A>(lhs),rhs));
0250 }
0251 
0252 
0253 //==============================================================================
0254 // operator+ (SMatrix, binary, Constant)
0255 //==============================================================================
0256 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
0257 inline Expr<BinaryOpCopyR<AddOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
0258  operator+(const Expr<B,T,D,D2,R>& lhs, const A& rhs) {
0259   typedef BinaryOpCopyR<AddOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T> AddOpBinOp;
0260 
0261   return Expr<AddOpBinOp,T,D,D2,R>(AddOpBinOp(AddOp<T>(),
0262                                               lhs,Constant<A>(rhs)));
0263 }
0264 
0265 //==============================================================================
0266 // operator+ (SMatrix, binary, Constant)
0267 //==============================================================================
0268 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
0269 inline Expr<BinaryOpCopyL<AddOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T>, T, D, D2, R>
0270  operator+(const A& lhs, const Expr<B,T,D,D2,R>& rhs) {
0271   typedef BinaryOpCopyL<AddOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T> AddOpBinOp;
0272 
0273   return Expr<AddOpBinOp,T,D,D2,R>(AddOpBinOp(AddOp<T>(),
0274                                               Constant<A>(lhs),rhs));
0275 }
0276 
0277 
0278 //==============================================================================
0279 // MinOp
0280 //==============================================================================
0281 /**
0282    Subtraction Operation Class
0283 
0284    @ingroup Expression
0285  */
0286 template <class T>
0287 class MinOp {
0288 public:
0289   static inline T apply(const T& lhs, const T& rhs) {
0290     return lhs - rhs;
0291   }
0292 };
0293 
0294 
0295 /**
0296    Vector Subtraction:  v3 = v1 - v2
0297    returning a vector expression
0298 
0299    @ingroup VectFunction
0300 */
0301 //==============================================================================
0302 // operator- (SVector, binary)
0303 //==============================================================================
0304 template <  class T, unsigned int D>
0305 inline VecExpr<BinaryOp<MinOp<T>, SVector<T,D>, SVector<T,D>, T>, T, D>
0306  operator-(const SVector<T,D>& lhs, const SVector<T,D>& rhs) {
0307   typedef BinaryOp<MinOp<T>, SVector<T,D>, SVector<T,D>, T> MinOpBinOp;
0308 
0309   return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,rhs));
0310 }
0311 
0312 
0313 //==============================================================================
0314 // operator- (SVector, binary)
0315 //==============================================================================
0316 template <class A,  class T, unsigned int D>
0317 inline VecExpr<BinaryOp<MinOp<T>, VecExpr<A,T,D>, SVector<T,D>, T>, T, D>
0318  operator-(const VecExpr<A,T,D>& lhs, const SVector<T,D>& rhs) {
0319   typedef BinaryOp<MinOp<T>, VecExpr<A,T,D>, SVector<T,D>, T> MinOpBinOp;
0320 
0321   return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,rhs));
0322 }
0323 
0324 
0325 //==============================================================================
0326 // operator- (SVector, binary)
0327 //==============================================================================
0328 template < class A, class T, unsigned int D>
0329 inline VecExpr<BinaryOp<MinOp<T>, SVector<T,D>, VecExpr<A,T,D>, T>, T, D>
0330  operator-(const SVector<T,D>& lhs, const VecExpr<A,T,D>& rhs) {
0331   typedef BinaryOp<MinOp<T>, SVector<T,D>, VecExpr<A,T,D>, T> MinOpBinOp;
0332 
0333   return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,rhs));
0334 }
0335 
0336 
0337 //==============================================================================
0338 // operator- (SVector, binary)
0339 //==============================================================================
0340 template <class A, class B, class T, unsigned int D>
0341 inline VecExpr<BinaryOp<MinOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T>, T, D>
0342  operator-(const VecExpr<A,T,D>& lhs, const VecExpr<B,T,D>& rhs) {
0343   typedef BinaryOp<MinOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T> MinOpBinOp;
0344 
0345   return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,rhs));
0346 }
0347 
0348 
0349 /**
0350    Subtraction of a scalar from each vector element:  v2(i) = v1(i) - a
0351    returning a vector expression
0352 
0353    @ingroup VectFunction
0354 */
0355 //==============================================================================
0356 // operator- (SVector, binary, Constant)
0357 //==============================================================================
0358 template <class A,  class T, unsigned int D>
0359 inline VecExpr<BinaryOpCopyR<MinOp<T>, SVector<T,D>, Constant<A>, T>, T, D>
0360  operator-(const SVector<T,D>& lhs, const A& rhs) {
0361   typedef BinaryOpCopyR<MinOp<T>, SVector<T,D>, Constant<A>, T> MinOpBinOp;
0362 
0363   return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,Constant<A>(rhs)));
0364 }
0365 
0366 /**
0367    Subtraction  scalar vector (for each vector element) v2(i) = a - v1(i)
0368    returning a vector expression
0369 
0370    @ingroup VectFunction
0371 */
0372 //==============================================================================
0373 // operator- (SVector, binary, Constant)
0374 //==============================================================================
0375 template <class A,  class T, unsigned int D>
0376 inline VecExpr<BinaryOpCopyL<MinOp<T>, Constant<A>, SVector<T,D>, T>, T, D>
0377  operator-(const A& lhs, const SVector<T,D>& rhs) {
0378   typedef BinaryOpCopyL<MinOp<T>, Constant<A>, SVector<T,D>, T> MinOpBinOp;
0379 
0380   return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),Constant<A>(lhs),rhs));
0381 }
0382 
0383 
0384 //==============================================================================
0385 // operator- (SVector, binary, Constant)
0386 //==============================================================================
0387 template <class A, class B, class T, unsigned int D>
0388 inline VecExpr<BinaryOpCopyR<MinOp<T>, VecExpr<B,T,D>, Constant<A>, T>, T, D>
0389  operator-(const VecExpr<B,T,D>& lhs, const A& rhs) {
0390   typedef BinaryOpCopyR<MinOp<T>, VecExpr<B,T,D>, Constant<A>, T> MinOpBinOp;
0391 
0392   return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),lhs,Constant<A>(rhs)));
0393 }
0394 
0395 //==============================================================================
0396 // operator- (SVector, binary, Constant)
0397 //==============================================================================
0398 template <class A, class B, class T, unsigned int D>
0399 inline VecExpr<BinaryOpCopyL<MinOp<T>, Constant<A>, VecExpr<B,T,D>, T>, T, D>
0400  operator-(const A& lhs, const VecExpr<B,T,D>& rhs) {
0401   typedef BinaryOpCopyL<MinOp<T>, Constant<A>, VecExpr<B,T,D>, T> MinOpBinOp;
0402 
0403   return VecExpr<MinOpBinOp,T,D>(MinOpBinOp(MinOp<T>(),Constant<A>(lhs),rhs));
0404 }
0405 
0406 
0407 /**
0408    Subtraction of two matrices  C = A-B
0409    returning a matrix expression
0410 
0411    @ingroup MatrixFunctions
0412 */
0413 //==============================================================================
0414 // operator- (SMatrix, binary)
0415 //==============================================================================
0416 template <  class T, unsigned int D, unsigned int D2, class R1, class R2>
0417 inline Expr<BinaryOp<MinOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
0418  operator-(const SMatrix<T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
0419   typedef BinaryOp<MinOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> MinOpBinOp;
0420 
0421   return Expr<MinOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(MinOpBinOp(MinOp<T>(),lhs,rhs));
0422 }
0423 
0424 
0425 //==============================================================================
0426 // operator- (SMatrix, binary)
0427 //==============================================================================
0428 template <class A,  class T, unsigned int D, unsigned int D2, class R1, class R2>
0429 inline Expr<BinaryOp<MinOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>
0430  operator-(const Expr<A,T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
0431   typedef BinaryOp<MinOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> MinOpBinOp;
0432 
0433   return Expr<MinOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(MinOpBinOp(MinOp<T>(),lhs,rhs));
0434 }
0435 
0436 
0437 //==============================================================================
0438 // operator- (SMatrix, binary)
0439 //==============================================================================
0440 template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
0441 inline Expr<BinaryOp<MinOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
0442  operator-(const SMatrix<T,D,D2,R1>& lhs, const Expr<A,T,D,D2,R2>& rhs) {
0443   typedef BinaryOp<MinOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T> MinOpBinOp;
0444 
0445   return Expr<MinOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(MinOpBinOp(MinOp<T>(),lhs,rhs));
0446 }
0447 
0448 
0449 //==============================================================================
0450 // operator- (SMatrix, binary)
0451 //==============================================================================
0452 template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
0453 inline Expr<BinaryOp<MinOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T>, T, D, D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>
0454  operator-(const Expr<A,T,D,D2,R1>& lhs, const Expr<B,T,D,D2,R2>& rhs) {
0455   typedef BinaryOp<MinOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T> MinOpBinOp;
0456 
0457   return Expr<MinOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(MinOpBinOp(MinOp<T>(),lhs,rhs));
0458 }
0459 
0460 
0461 /**
0462    Subtraction of a scalar and a matrix (element wise)  B(i,j)  = A(i,j) - s
0463    returning a matrix expression
0464 
0465    @ingroup MatrixFunctions
0466 */
0467 //==============================================================================
0468 // operator- (SMatrix, binary, Constant)
0469 //==============================================================================
0470 template <class A,  class T, unsigned int D, unsigned int D2, class R>
0471 inline Expr<BinaryOpCopyR<MinOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
0472  operator-(const SMatrix<T,D,D2,R>& lhs, const A& rhs) {
0473   typedef BinaryOpCopyR<MinOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T> MinOpBinOp;
0474 
0475   return Expr<MinOpBinOp,T,D,D2,R>(MinOpBinOp(MinOp<T>(),
0476                                               lhs,Constant<A>(rhs)));
0477 }
0478 
0479 /**
0480    Subtraction of a scalar and a matrix (element wise)  B(i,j)  = s - A(i,j)
0481    returning a matrix expression
0482 
0483    @ingroup MatrixFunctions
0484 */
0485 //==============================================================================
0486 // operator- (SMatrix, binary, Constant)
0487 //==============================================================================
0488 template <class A,  class T, unsigned int D, unsigned int D2, class R>
0489 inline Expr<BinaryOpCopyL<MinOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R>
0490  operator-(const A& lhs, const SMatrix<T,D,D2,R>& rhs) {
0491   typedef BinaryOpCopyL<MinOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T> MinOpBinOp;
0492 
0493   return Expr<MinOpBinOp,T,D,D2,R>(MinOpBinOp(MinOp<T>(),Constant<A>(lhs),rhs));
0494 }
0495 
0496 //==============================================================================
0497 // operator- (SMatrix, binary, Constant)
0498 //==============================================================================
0499 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
0500 inline Expr<BinaryOpCopyR<MinOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
0501  operator-(const Expr<B,T,D,D2,R>& lhs, const A& rhs) {
0502   typedef BinaryOpCopyR<MinOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T> MinOpBinOp;
0503 
0504   return Expr<MinOpBinOp,T,D,D2,R>(MinOpBinOp(MinOp<T>(),lhs,Constant<A>(rhs)));
0505 }
0506 
0507 //==============================================================================
0508 // operator- (SMatrix, binary, Constant)
0509 //==============================================================================
0510 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
0511 inline Expr<BinaryOpCopyL<MinOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T>, T, D, D2, R>
0512  operator-(const A& lhs, const Expr<B,T,D,D2,R>& rhs) {
0513   typedef BinaryOpCopyL<MinOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T> MinOpBinOp;
0514 
0515   return Expr<MinOpBinOp,T,D,D2,R>(MinOpBinOp(MinOp<T>(),
0516                                               Constant<A>(lhs),rhs));
0517 }
0518 
0519 
0520 /**
0521    Multiplication (element-wise) Operation Class
0522 
0523    @ingroup Expression
0524  */
0525 //==============================================================================
0526 // MulOp
0527 //==============================================================================
0528 template <class T>
0529 class MulOp {
0530 public:
0531   static inline T apply(const T& lhs, const T& rhs) {
0532     return lhs * rhs;
0533   }
0534 };
0535 
0536 /**
0537    Element by element vector product v3(i) = v1(i)*v2(i)
0538    returning a vector expression.
0539    Note this is NOT the Dot, Cross or Tensor product.
0540 
0541    @ingroup VectFunction
0542 */
0543 //==============================================================================
0544 // operator* (SVector, binary)
0545 //==============================================================================
0546 template <  class T, unsigned int D>
0547 inline VecExpr<BinaryOp<MulOp<T>, SVector<T,D>, SVector<T,D>, T>, T, D>
0548  operator*(const SVector<T,D>& lhs, const SVector<T,D>& rhs) {
0549   typedef BinaryOp<MulOp<T>, SVector<T,D>, SVector<T,D>, T> MulOpBinOp;
0550 
0551   return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,rhs));
0552 }
0553 
0554 
0555 //==============================================================================
0556 // operator* (SVector, binary)
0557 //==============================================================================
0558 // template <class A,  class T, unsigned int D, class R>
0559 // inline VecExpr<BinaryOp<MulOp<T>, VecExpr<A,T,D>, SVector<T,D>, T>, T, D>
0560 //  operator*(const VecExpr<A,T,D,1,R>& lhs, const SVector<T,D>& rhs) {
0561 //   typedef BinaryOp<MulOp<T>, VecExpr<A,T,D,1,R>, SVector<T,D>, T> MulOpBinOp;
0562 //   return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,rhs));
0563 // }
0564 template <class A,  class T, unsigned int D>
0565 inline VecExpr<BinaryOp<MulOp<T>, Expr<A,T,D>, SVector<T,D>, T>, T, D>
0566  operator*(const VecExpr<A,T,D>& lhs, const SVector<T,D>& rhs) {
0567   typedef BinaryOp<MulOp<T>, VecExpr<A,T,D>, SVector<T,D>, T> MulOpBinOp;
0568   return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,rhs));
0569 }
0570 
0571 
0572 //==============================================================================
0573 // operator* (SVector, binary)
0574 //==============================================================================
0575 template < class A, class T, unsigned int D>
0576 inline VecExpr<BinaryOp<MulOp<T>, SVector<T,D>, VecExpr<A,T,D>, T>, T, D>
0577  operator*(const SVector<T,D>& lhs, const VecExpr<A,T,D>& rhs) {
0578   typedef BinaryOp<MulOp<T>, SVector<T,D>, VecExpr<A,T,D>, T> MulOpBinOp;
0579   return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,rhs));
0580 }
0581 
0582 
0583 //==============================================================================
0584 // operator* (SVector, binary)
0585 //==============================================================================
0586 template <class A, class B, class T, unsigned int D>
0587 inline VecExpr<BinaryOp<MulOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T>, T, D>
0588  operator*(const VecExpr<A,T,D>& lhs, const VecExpr<B,T,D>& rhs) {
0589   typedef BinaryOp<MulOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T> MulOpBinOp;
0590   return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,rhs));
0591 }
0592 
0593 
0594 //==============================================================================
0595 // operator* (SVector, binary, Constant)
0596 //==============================================================================
0597 template <class A,  class T, unsigned int D>
0598 inline VecExpr<BinaryOpCopyR<MulOp<T>, SVector<T,D>, Constant<A>, T>, T, D>
0599  operator*(const SVector<T,D>& lhs, const A& rhs) {
0600   typedef BinaryOpCopyR<MulOp<T>, SVector<T,D>, Constant<A>, T> MulOpBinOp;
0601 
0602   return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,Constant<A>(rhs)));
0603 }
0604 
0605 //==============================================================================
0606 // operator* (SVector, binary, Constant)
0607 //==============================================================================
0608 template <class A,  class T, unsigned int D>
0609 inline VecExpr<BinaryOpCopyL<MulOp<T>, Constant<A>, SVector<T,D>, T>, T, D>
0610  operator*(const A& lhs, const SVector<T,D>& rhs) {
0611   typedef BinaryOpCopyL<MulOp<T>, Constant<A>, SVector<T,D>, T> MulOpBinOp;
0612 
0613   return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),Constant<A>(lhs),rhs));
0614 }
0615 
0616 
0617 //==============================================================================
0618 // operator* (SVector, binary, Constant)
0619 //==============================================================================
0620 template <class A, class B, class T, unsigned int D>
0621 inline VecExpr<BinaryOpCopyR<MulOp<T>, VecExpr<B,T,D>, Constant<A>, T>, T, D>
0622  operator*(const VecExpr<B,T,D>& lhs, const A& rhs) {
0623   typedef BinaryOpCopyR<MulOp<T>, VecExpr<B,T,D>, Constant<A>, T> MulOpBinOp;
0624 
0625   return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),lhs,Constant<A>(rhs)));
0626 }
0627 
0628 //==============================================================================
0629 // operator* (SVector, binary, Constant)
0630 //==============================================================================
0631 template <class A, class B, class T, unsigned int D>
0632 inline VecExpr<BinaryOpCopyL<MulOp<T>, Constant<A>, VecExpr<B,T,D>, T>, T, D>
0633  operator*(const A& lhs, const VecExpr<B,T,D>& rhs) {
0634   typedef BinaryOpCopyL<MulOp<T>, Constant<A>, VecExpr<B,T,D>, T> MulOpBinOp;
0635 
0636   return VecExpr<MulOpBinOp,T,D>(MulOpBinOp(MulOp<T>(),Constant<A>(lhs),rhs));
0637 }
0638 
0639 /**
0640    Element by element matrix multiplication  C(i,j) = A(i,j)*B(i,j)
0641    returning a matrix expression. This is not a matrix-matrix multiplication and works only
0642    for matrices of the same dimensions.
0643 
0644    @ingroup MatrixFunctions
0645 */
0646 // Times:  Function for element - wise multiplication
0647 //==============================================================================
0648 // Times (SMatrix, binary)
0649 //==============================================================================
0650 template <  class T, unsigned int D, unsigned int D2, class R1, class R2>
0651 inline Expr<BinaryOp<MulOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
0652  Times(const SMatrix<T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
0653   typedef BinaryOp<MulOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> MulOpBinOp;
0654 
0655   return Expr<MulOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(MulOpBinOp(MulOp<T>(),lhs,rhs));
0656 }
0657 
0658 
0659 //==============================================================================
0660 // Times (SMatrix, binary)
0661 //==============================================================================
0662 template <class A,  class T, unsigned int D, unsigned int D2, class R1, class R2>
0663 inline Expr<BinaryOp<MulOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
0664  Times(const Expr<A,T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
0665   typedef BinaryOp<MulOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> MulOpBinOp;
0666 
0667   return Expr<MulOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(MulOpBinOp(MulOp<T>(),lhs,rhs));
0668 }
0669 
0670 
0671 //==============================================================================
0672 // Times (SMatrix, binary)
0673 //==============================================================================
0674 template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
0675 inline Expr<BinaryOp<MulOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
0676  Times(const SMatrix<T,D,D2,R1>& lhs, const Expr<A,T,D,D2,R2>& rhs) {
0677   typedef BinaryOp<MulOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T> MulOpBinOp;
0678 
0679   return Expr<MulOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(MulOpBinOp(MulOp<T>(),lhs,rhs));
0680 }
0681 
0682 
0683 //==============================================================================
0684 // Times (SMatrix, binary)
0685 //==============================================================================
0686 template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
0687 inline Expr<BinaryOp<MulOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
0688  Times(const Expr<A,T,D,D2,R1>& lhs, const Expr<B,T,D,D2,R2>& rhs) {
0689   typedef BinaryOp<MulOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T> MulOpBinOp;
0690 
0691   return Expr<MulOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(MulOpBinOp(MulOp<T>(),lhs,rhs));
0692 }
0693 
0694 
0695 /**
0696    Multiplication (element wise) of a matrix and a scalar, B(i,j) = A(i,j) * s
0697    returning a matrix expression
0698 
0699    @ingroup MatrixFunctions
0700 */
0701 //=============================================================================
0702 // operator* (SMatrix, binary, Constant)
0703 //=============================================================================
0704 template <class A,  class T, unsigned int D, unsigned int D2, class R>
0705 inline Expr<BinaryOpCopyR<MulOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
0706  operator*(const SMatrix<T,D,D2,R>& lhs, const A& rhs) {
0707   typedef BinaryOpCopyR<MulOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T> MulOpBinOp;
0708 
0709   return Expr<MulOpBinOp,T,D,D2,R>(MulOpBinOp(MulOp<T>(),
0710                                               lhs,Constant<A>(rhs)));
0711 }
0712 
0713 /**
0714    Multiplication (element wise) of a matrix and a scalar, B(i,j) = s * A(i,j)
0715    returning a matrix expression
0716 
0717    @ingroup MatrixFunctions
0718 */
0719 //=============================================================================
0720 // operator* (SMatrix, binary, Constant)
0721 //=============================================================================
0722 template <class A,  class T, unsigned int D, unsigned int D2, class R>
0723 inline Expr<BinaryOpCopyL<MulOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R>
0724  operator*(const A& lhs, const SMatrix<T,D,D2,R>& rhs) {
0725   typedef BinaryOpCopyL<MulOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T> MulOpBinOp;
0726 
0727   return Expr<MulOpBinOp,T,D,D2,R>(MulOpBinOp(MulOp<T>(),
0728                                               Constant<A>(lhs),rhs));
0729 }
0730 
0731 
0732 //==============================================================================
0733 // operator* (SMatrix, binary, Constant)
0734 //==============================================================================
0735 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
0736 inline Expr<BinaryOpCopyR<MulOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
0737  operator*(const Expr<B,T,D,D2,R>& lhs, const A& rhs) {
0738   typedef BinaryOpCopyR<MulOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T> MulOpBinOp;
0739 
0740   return Expr<MulOpBinOp,T,D,D2,R>(MulOpBinOp(MulOp<T>(),
0741                                               lhs,Constant<A>(rhs)));
0742 }
0743 
0744 //==============================================================================
0745 // operator* (SMatrix, binary, Constant)
0746 //==============================================================================
0747 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
0748 inline Expr<BinaryOpCopyL<MulOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T>, T, D, D2, R>
0749  operator*(const A& lhs, const Expr<B,T,D,D2,R>& rhs) {
0750   typedef BinaryOpCopyL<MulOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T> MulOpBinOp;
0751 
0752   return Expr<MulOpBinOp,T,D,D2,R>(MulOpBinOp(MulOp<T>(),
0753                                               Constant<A>(lhs),rhs));
0754 }
0755 
0756 
0757 //=============================================================================
0758 // DivOp
0759 //=============================================================================
0760 /**
0761    Division (element-wise) Operation Class
0762 
0763    @ingroup Expression
0764  */
0765 template <class T>
0766 class DivOp {
0767 public:
0768   static inline T apply(const T& lhs, const T& rhs) {
0769     return lhs / rhs;
0770   }
0771 };
0772 
0773 /**
0774    Element by element division of vectors of the same dimension:   v3(i) = v1(i)/v2(i)
0775    returning a vector expression
0776 
0777    @ingroup VectFunction
0778  */
0779 //==============================================================================
0780 // operator/ (SVector, binary)
0781 //==============================================================================
0782 template <  class T, unsigned int D>
0783 inline VecExpr<BinaryOp<DivOp<T>, SVector<T,D>, SVector<T,D>, T>, T, D>
0784  operator/(const SVector<T,D>& lhs, const SVector<T,D>& rhs) {
0785   typedef BinaryOp<DivOp<T>, SVector<T,D>, SVector<T,D>, T> DivOpBinOp;
0786 
0787   return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,rhs));
0788 }
0789 
0790 
0791 //==============================================================================
0792 // operator/ (SVector, binary)
0793 //==============================================================================
0794 template <class A,  class T, unsigned int D>
0795 inline VecExpr<BinaryOp<DivOp<T>, VecExpr<A,T,D>, SVector<T,D>, T>, T, D>
0796  operator/(const VecExpr<A,T,D>& lhs, const SVector<T,D>& rhs) {
0797   typedef BinaryOp<DivOp<T>, VecExpr<A,T,D>, SVector<T,D>, T> DivOpBinOp;
0798   return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,rhs));
0799 }
0800 
0801 
0802 //==============================================================================
0803 // operator/ (SVector, binary)
0804 //==============================================================================
0805 template < class A, class T, unsigned int D>
0806 inline VecExpr<BinaryOp<DivOp<T>, SVector<T,D>, VecExpr<A,T,D>, T>, T, D>
0807  operator/(const SVector<T,D>& lhs, const VecExpr<A,T,D>& rhs) {
0808   typedef BinaryOp<DivOp<T>, SVector<T,D>, VecExpr<A,T,D>, T> DivOpBinOp;
0809 
0810   return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,rhs));
0811 }
0812 
0813 
0814 //=============================================================================
0815 // operator/ (SVector, binary)
0816 //=============================================================================
0817 template <class A, class B, class T, unsigned int D>
0818 inline VecExpr<BinaryOp<DivOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T>, T, D>
0819  operator/(const VecExpr<A,T,D>& lhs, const VecExpr<B,T,D>& rhs) {
0820   typedef BinaryOp<DivOp<T>, VecExpr<A,T,D>, VecExpr<B,T,D>, T> DivOpBinOp;
0821 
0822   return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,rhs));
0823 }
0824 
0825 
0826 /**
0827    Division of the vector element by a scalar value:  v2(i) = v1(i)/a
0828    returning a vector expression
0829 
0830    @ingroup VectFunction
0831 */
0832 //==============================================================================
0833 // operator/ (SVector, binary, Constant)
0834 //==============================================================================
0835 template <class A,  class T, unsigned int D>
0836 inline VecExpr<BinaryOpCopyR<DivOp<T>, SVector<T,D>, Constant<A>, T>, T, D>
0837  operator/(const SVector<T,D>& lhs, const A& rhs) {
0838   typedef BinaryOpCopyR<DivOp<T>, SVector<T,D>, Constant<A>, T> DivOpBinOp;
0839 
0840   return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,Constant<A>(rhs)));
0841 }
0842 
0843 /**
0844    Division of a scalar value by the vector element:  v2(i) = a/v1(i)
0845    returning a vector expression
0846 
0847    @ingroup VectFunction
0848 */
0849 //==============================================================================
0850 // operator/ (SVector, binary, Constant)
0851 //==============================================================================
0852 template <class A,  class T, unsigned int D>
0853 inline VecExpr<BinaryOpCopyL<DivOp<T>, Constant<A>, SVector<T,D>, T>, T, D>
0854  operator/(const A& lhs, const SVector<T,D>& rhs) {
0855   typedef BinaryOpCopyL<DivOp<T>, Constant<A>, SVector<T,D>, T> DivOpBinOp;
0856 
0857   return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),Constant<A>(lhs),rhs));
0858 }
0859 
0860 
0861 //==============================================================================
0862 // operator/ (SVector, binary, Constant)
0863 //==============================================================================
0864 template <class A, class B, class T, unsigned int D>
0865 inline VecExpr<BinaryOpCopyR<DivOp<T>, VecExpr<B,T,D>, Constant<A>, T>, T, D>
0866  operator/(const VecExpr<B,T,D>& lhs, const A& rhs) {
0867   typedef BinaryOpCopyR<DivOp<T>, VecExpr<B,T,D>, Constant<A>, T> DivOpBinOp;
0868 
0869   return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),lhs,Constant<A>(rhs)));
0870 }
0871 
0872 //==============================================================================
0873 // operator/ (SVector, binary, Constant)
0874 //==============================================================================
0875 template <class A, class B, class T, unsigned int D>
0876 inline VecExpr<BinaryOpCopyL<DivOp<T>, Constant<A>, VecExpr<B,T,D>, T>, T, D>
0877  operator/(const A& lhs, const VecExpr<B,T,D>& rhs) {
0878   typedef BinaryOpCopyL<DivOp<T>, Constant<A>, VecExpr<B,T,D>, T> DivOpBinOp;
0879 
0880   return VecExpr<DivOpBinOp,T,D>(DivOpBinOp(DivOp<T>(),Constant<A>(lhs),rhs));
0881 }
0882 
0883 
0884 /**
0885    Division (element wise) of two matrices of the same dimensions:  C(i,j) = A(i,j) / B(i,j)
0886    returning a matrix expression
0887 
0888    @ingroup MatrixFunctions
0889 */
0890 //==============================================================================
0891 // Div (SMatrix, binary)
0892 //==============================================================================
0893 template <  class T, unsigned int D, unsigned int D2, class R1, class R2>
0894 inline Expr<BinaryOp<DivOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
0895  Div(const SMatrix<T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
0896   typedef BinaryOp<DivOp<T>, SMatrix<T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> DivOpBinOp;
0897 
0898   return Expr<DivOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(DivOpBinOp(DivOp<T>(),lhs,rhs));
0899 }
0900 
0901 
0902 //==============================================================================
0903 // Div (SMatrix, binary)
0904 //==============================================================================
0905 template <class A,  class T, unsigned int D, unsigned int D2, class R1, class R2>
0906 inline Expr<BinaryOp<DivOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
0907  Div(const Expr<A,T,D,D2,R1>& lhs, const SMatrix<T,D,D2,R2>& rhs) {
0908   typedef BinaryOp<DivOp<T>, Expr<A,T,D,D2,R1>, SMatrix<T,D,D2,R2>, T> DivOpBinOp;
0909 
0910   return Expr<DivOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(DivOpBinOp(DivOp<T>(),lhs,rhs));
0911 }
0912 
0913 
0914 //==============================================================================
0915 // Div (SMatrix, binary)
0916 //==============================================================================
0917 template < class A, class T, unsigned int D, unsigned int D2, class R1, class R2>
0918 inline Expr<BinaryOp<DivOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T>, T, D, D2, typename AddPolicy<T,D,D2,R1,R2>::RepType>
0919  Div(const SMatrix<T,D,D2,R1>& lhs, const Expr<A,T,D,D2,R2>& rhs) {
0920   typedef BinaryOp<DivOp<T>, SMatrix<T,D,D2,R1>, Expr<A,T,D,D2,R2>, T> DivOpBinOp;
0921 
0922   return Expr<DivOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(DivOpBinOp(DivOp<T>(),lhs,rhs));
0923 }
0924 
0925 
0926 //==============================================================================
0927 // Div (SMatrix, binary)
0928 //==============================================================================
0929 template <class A, class B, class T, unsigned int D, unsigned int D2, class R1, class R2>
0930 inline Expr<BinaryOp<DivOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T>, T, D, D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>
0931  Div(const Expr<A,T,D,D2,R1>& lhs, const Expr<B,T,D,D2,R2>& rhs) {
0932   typedef BinaryOp<DivOp<T>, Expr<A,T,D,D2,R1>, Expr<B,T,D,D2,R2>, T> DivOpBinOp;
0933 
0934   return Expr<DivOpBinOp,T,D,D2,typename AddPolicy<T,D,D2,R1,R2>::RepType>(DivOpBinOp(DivOp<T>(),lhs,rhs));
0935 }
0936 
0937 
0938 /**
0939    Division (element wise) of a matrix and a scalar, B(i,j) = A(i,j) / s
0940    returning a matrix expression
0941 
0942    @ingroup MatrixFunctions
0943 */
0944 //=============================================================================
0945 // operator/ (SMatrix, binary, Constant)
0946 //=============================================================================
0947 template <class A,  class T, unsigned int D, unsigned int D2, class R>
0948 inline Expr<BinaryOpCopyR<DivOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
0949  operator/(const SMatrix<T,D,D2,R>& lhs, const A& rhs) {
0950   typedef BinaryOpCopyR<DivOp<T>, SMatrix<T,D,D2,R>, Constant<A>, T> DivOpBinOp;
0951 
0952   return Expr<DivOpBinOp,T,D,D2,R>(DivOpBinOp(DivOp<T>(),
0953                                               lhs,Constant<A>(rhs)));
0954 }
0955 
0956 /**
0957    Division (element wise) of a matrix and a scalar, B(i,j) = s / A(i,j)
0958    returning a matrix expression
0959 
0960    @ingroup MatrixFunctions
0961 */
0962 //==============================================================================
0963 // operator/ (SMatrix, binary, Constant)
0964 //==============================================================================
0965 template <class A,  class T, unsigned int D, unsigned int D2, class R>
0966 inline Expr<BinaryOpCopyL<DivOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T>, T, D, D2, R>
0967  operator/(const A& lhs, const SMatrix<T,D,D2,R>& rhs) {
0968   typedef BinaryOpCopyL<DivOp<T>, Constant<A>, SMatrix<T,D,D2,R>, T> DivOpBinOp;
0969 
0970   return Expr<DivOpBinOp,T,D,D2,R>(DivOpBinOp(DivOp<T>(),
0971                                               Constant<A>(lhs),rhs));
0972 }
0973 
0974 
0975 //==============================================================================
0976 // operator/ (SMatrix, binary, Constant)
0977 //==============================================================================
0978 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
0979 inline Expr<BinaryOpCopyR<DivOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T>, T, D, D2, R>
0980  operator/(const Expr<B,T,D,D2,R>& lhs, const A& rhs) {
0981   typedef BinaryOpCopyR<DivOp<T>, Expr<B,T,D,D2,R>, Constant<A>, T> DivOpBinOp;
0982 
0983   return Expr<DivOpBinOp,T,D,D2,R>(DivOpBinOp(DivOp<T>(),
0984                                               lhs,Constant<A>(rhs)));
0985 }
0986 
0987 //==============================================================================
0988 // operator/ (SMatrix, binary, Constant)
0989 //==============================================================================
0990 template <class A, class B, class T, unsigned int D, unsigned int D2, class R>
0991 inline Expr<BinaryOpCopyL<DivOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T>, T, D, D2,R>
0992  operator/(const A& lhs, const Expr<B,T,D,D2,R>& rhs) {
0993   typedef BinaryOpCopyL<DivOp<T>, Constant<A>, Expr<B,T,D,D2,R>, T> DivOpBinOp;
0994 
0995   return Expr<DivOpBinOp,T,D,D2,R>(DivOpBinOp(DivOp<T>(),Constant<A>(lhs),rhs));
0996 }
0997 
0998 
0999 
1000   }  // namespace Math
1001 
1002 }  // namespace ROOT
1003 
1004 
1005 #endif  /*ROOT_Math_BinaryOperators */