Skip to content
Snippets Groups Projects
Commit f7951ed0 authored by Lorenzo Moneta's avatar Lorenzo Moneta
Browse files

fix a bug on Windows in the TensorProd function

git-svn-id: http://root.cern.ch/svn/root/trunk@22920 27541ba8-7e3a-0410-8455-c3a389f83636
parent 35d5ca6c
No related branches found
No related tags found
No related merge requests found
...@@ -896,7 +896,7 @@ inline Expr<TensorMulOp<VecExpr<A,T,D1>, VecExpr<B,T,D2> >, T, D1, D2 > ...@@ -896,7 +896,7 @@ inline Expr<TensorMulOp<VecExpr<A,T,D1>, VecExpr<B,T,D2> >, T, D1, D2 >
} }
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
/// case of WINDOWS - problem using Expression ( C1001: INTERNAL COMPILER ERROR ) /// case of WINDOWS - problem using Expression ( C1001: INTERNAL COMPILER ERROR )
//============================================================================== //==============================================================================
...@@ -905,9 +905,10 @@ inline Expr<TensorMulOp<VecExpr<A,T,D1>, VecExpr<B,T,D2> >, T, D1, D2 > ...@@ -905,9 +905,10 @@ inline Expr<TensorMulOp<VecExpr<A,T,D1>, VecExpr<B,T,D2> >, T, D1, D2 >
template <class T, unsigned int D1, unsigned int D2> template <class T, unsigned int D1, unsigned int D2>
inline SMatrix<T,D1,D2> TensorProd(const SVector<T,D1>& lhs, const SVector<T,D2>& rhs) { inline SMatrix<T,D1,D2> TensorProd(const SVector<T,D1>& lhs, const SVector<T,D2>& rhs) {
SMatrix<T,D1,D2> tmp; SMatrix<T,D1,D2> tmp;
for (unsigned int i=0; i< D1; ++i) for (unsigned int i=0; i< D1; ++i)
for (unsigned int j=0; i< D2; ++j) for (unsigned int j=0; j< D2; ++j) {
tmp(i,j) = lhs[i]*rhs[j]; tmp(i,j) = lhs[i]*rhs[j];
}
return tmp; return tmp;
} }
...@@ -918,8 +919,8 @@ inline SMatrix<T,D1,D2> TensorProd(const SVector<T,D1>& lhs, const SVector<T,D2 ...@@ -918,8 +919,8 @@ inline SMatrix<T,D1,D2> TensorProd(const SVector<T,D1>& lhs, const SVector<T,D2
inline SMatrix<T,D1,D2> TensorProd(const VecExpr<A,T,D1>& lhs, const SVector<T,D2>& rhs) { inline SMatrix<T,D1,D2> TensorProd(const VecExpr<A,T,D1>& lhs, const SVector<T,D2>& rhs) {
SMatrix<T,D1,D2> tmp; SMatrix<T,D1,D2> tmp;
for (unsigned int i=0; i< D1; ++i) for (unsigned int i=0; i< D1; ++i)
for (unsigned int j=0; i< D2; ++j) for (unsigned int j=0; j< D2; ++j)
tmp(i,j) = rhs.apply(j)*lhs.apply(i); tmp(i,j) = lhs.apply(i) * rhs.apply(j);
return tmp; return tmp;
} }
...@@ -930,8 +931,8 @@ inline SMatrix<T,D1,D2> TensorProd(const VecExpr<A,T,D1>& lhs, const SVector<T, ...@@ -930,8 +931,8 @@ inline SMatrix<T,D1,D2> TensorProd(const VecExpr<A,T,D1>& lhs, const SVector<T,
inline SMatrix<T,D1,D2> TensorProd(const SVector<T,D1>& lhs, const VecExpr<A,T,D2>& rhs) { inline SMatrix<T,D1,D2> TensorProd(const SVector<T,D1>& lhs, const VecExpr<A,T,D2>& rhs) {
SMatrix<T,D1,D2> tmp; SMatrix<T,D1,D2> tmp;
for (unsigned int i=0; i< D1; ++i) for (unsigned int i=0; i< D1; ++i)
for (unsigned int j=0; i< D2; ++j) for (unsigned int j=0; j< D2; ++j)
tmp(i,j) = lhs.apply(i)*rhs.apply(j); tmp(i,j) = lhs.apply(i) * rhs.apply(j);
return tmp; return tmp;
} }
...@@ -944,8 +945,8 @@ inline SMatrix<T,D1,D2> TensorProd(const SVector<T,D1>& lhs, const VecExpr<A,T,D ...@@ -944,8 +945,8 @@ inline SMatrix<T,D1,D2> TensorProd(const SVector<T,D1>& lhs, const VecExpr<A,T,D
inline SMatrix<T,D1,D2 > TensorProd(const VecExpr<A,T,D1>& lhs, const VecExpr<B,T,D2>& rhs) { inline SMatrix<T,D1,D2 > TensorProd(const VecExpr<A,T,D1>& lhs, const VecExpr<B,T,D2>& rhs) {
SMatrix<T,D1,D2> tmp; SMatrix<T,D1,D2> tmp;
for (unsigned int i=0; i< D1; ++i) for (unsigned int i=0; i< D1; ++i)
for (unsigned int j=0; i< D2; ++j) for (unsigned int j=0; j< D2; ++j)
tmp(i,j) = lhs.apply(i)*rhs.apply(j); tmp(i,j) = lhs.apply(i) * rhs.apply(j);
return tmp; return tmp;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment