1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 09:15:38 +01:00

Promote to strong inline to force ICPC's hand. Annoying.

This commit is contained in:
Peter Boyle 2015-05-15 11:39:25 +01:00
parent 46c4379592
commit 577325cb7a

View File

@ -13,13 +13,13 @@ namespace Grid {
// Scalar +/- Scalar // Scalar +/- Scalar
// Vector +/- Vector // Vector +/- Vector
// Matrix +/- Matrix // Matrix +/- Matrix
template<class vtype,class ltype,class rtype> inline void add(iScalar<vtype> * __restrict__ ret, template<class vtype,class ltype,class rtype> strong_inline void add(iScalar<vtype> * __restrict__ ret,
const iScalar<ltype> * __restrict__ lhs, const iScalar<ltype> * __restrict__ lhs,
const iScalar<rtype> * __restrict__ rhs) const iScalar<rtype> * __restrict__ rhs)
{ {
add(&ret->_internal,&lhs->_internal,&rhs->_internal); add(&ret->_internal,&lhs->_internal,&rhs->_internal);
} }
template<class vtype,class ltype,class rtype,int N> inline void add(iVector<vtype,N> * __restrict__ ret, template<class vtype,class ltype,class rtype,int N> strong_inline void add(iVector<vtype,N> * __restrict__ ret,
const iVector<ltype,N> * __restrict__ lhs, const iVector<ltype,N> * __restrict__ lhs,
const iVector<rtype,N> * __restrict__ rhs) const iVector<rtype,N> * __restrict__ rhs)
{ {
@ -29,7 +29,7 @@ namespace Grid {
return; return;
} }
template<class vtype,class ltype,class rtype, int N> inline void add(iMatrix<vtype,N> * __restrict__ ret, template<class vtype,class ltype,class rtype, int N> strong_inline void add(iMatrix<vtype,N> * __restrict__ ret,
const iMatrix<ltype,N> * __restrict__ lhs, const iMatrix<ltype,N> * __restrict__ lhs,
const iMatrix<rtype,N> * __restrict__ rhs) const iMatrix<rtype,N> * __restrict__ rhs)
{ {
@ -39,7 +39,7 @@ namespace Grid {
}} }}
return; return;
} }
template<class vtype,class ltype,class rtype, int N> inline void add(iMatrix<vtype,N> * __restrict__ ret, template<class vtype,class ltype,class rtype, int N> strong_inline void add(iMatrix<vtype,N> * __restrict__ ret,
const iScalar<ltype> * __restrict__ lhs, const iScalar<ltype> * __restrict__ lhs,
const iMatrix<rtype,N> * __restrict__ rhs) const iMatrix<rtype,N> * __restrict__ rhs)
{ {
@ -49,7 +49,7 @@ namespace Grid {
}} }}
return; return;
} }
template<class vtype,class ltype,class rtype, int N> inline void add(iMatrix<vtype,N> * __restrict__ ret, template<class vtype,class ltype,class rtype, int N> strong_inline void add(iMatrix<vtype,N> * __restrict__ ret,
const iMatrix<ltype,N> * __restrict__ lhs, const iMatrix<ltype,N> * __restrict__ lhs,
const iScalar<rtype> * __restrict__ rhs) const iScalar<rtype> * __restrict__ rhs)
{ {
@ -66,8 +66,8 @@ namespace Grid {
// + operator for scalar, vector, matrix // + operator for scalar, vector, matrix
template<class ltype,class rtype> template<class ltype,class rtype>
//inline auto operator + (iScalar<ltype>& lhs,iScalar<rtype>&& rhs) -> iScalar<decltype(lhs._internal + rhs._internal)> //strong_inline auto operator + (iScalar<ltype>& lhs,iScalar<rtype>&& rhs) -> iScalar<decltype(lhs._internal + rhs._internal)>
inline auto operator + (const iScalar<ltype>& lhs,const iScalar<rtype>& rhs) -> iScalar<decltype(lhs._internal + rhs._internal)> strong_inline auto operator + (const iScalar<ltype>& lhs,const iScalar<rtype>& rhs) -> iScalar<decltype(lhs._internal + rhs._internal)>
{ {
typedef iScalar<decltype(lhs._internal+rhs._internal)> ret_t; typedef iScalar<decltype(lhs._internal+rhs._internal)> ret_t;
ret_t ret; ret_t ret;
@ -75,7 +75,7 @@ namespace Grid {
return ret; return ret;
} }
template<class ltype,class rtype,int N> template<class ltype,class rtype,int N>
inline auto operator + (const iVector<ltype,N>& lhs,const iVector<rtype,N>& rhs) ->iVector<decltype(lhs._internal[0]+rhs._internal[0]),N> strong_inline auto operator + (const iVector<ltype,N>& lhs,const iVector<rtype,N>& rhs) ->iVector<decltype(lhs._internal[0]+rhs._internal[0]),N>
{ {
typedef iVector<decltype(lhs._internal[0]+rhs._internal[0]),N> ret_t; typedef iVector<decltype(lhs._internal[0]+rhs._internal[0]),N> ret_t;
ret_t ret; ret_t ret;
@ -83,7 +83,7 @@ namespace Grid {
return ret; return ret;
} }
template<class ltype,class rtype,int N> template<class ltype,class rtype,int N>
inline auto operator + (const iMatrix<ltype,N>& lhs,const iMatrix<rtype,N>& rhs) ->iMatrix<decltype(lhs._internal[0][0]+rhs._internal[0][0]),N> strong_inline auto operator + (const iMatrix<ltype,N>& lhs,const iMatrix<rtype,N>& rhs) ->iMatrix<decltype(lhs._internal[0][0]+rhs._internal[0][0]),N>
{ {
typedef iMatrix<decltype(lhs._internal[0][0]+rhs._internal[0][0]),N> ret_t; typedef iMatrix<decltype(lhs._internal[0][0]+rhs._internal[0][0]),N> ret_t;
ret_t ret; ret_t ret;
@ -91,7 +91,7 @@ namespace Grid {
return ret; return ret;
} }
template<class ltype,class rtype,int N> template<class ltype,class rtype,int N>
inline auto operator + (const iScalar<ltype>& lhs,const iMatrix<rtype,N>& rhs)->iMatrix<decltype(lhs._internal+rhs._internal[0][0]),N> strong_inline auto operator + (const iScalar<ltype>& lhs,const iMatrix<rtype,N>& rhs)->iMatrix<decltype(lhs._internal+rhs._internal[0][0]),N>
{ {
typedef iMatrix<decltype(lhs._internal+rhs._internal[0][0]),N> ret_t; typedef iMatrix<decltype(lhs._internal+rhs._internal[0][0]),N> ret_t;
ret_t ret; ret_t ret;
@ -100,7 +100,7 @@ inline auto operator + (const iScalar<ltype>& lhs,const iMatrix<rtype,N>& rhs)->
} }
template<class ltype,class rtype,int N> template<class ltype,class rtype,int N>
inline auto operator + (const iMatrix<ltype,N>& lhs,const iScalar<rtype>& rhs)->iMatrix<decltype(lhs._internal[0][0]+rhs._internal),N> strong_inline auto operator + (const iMatrix<ltype,N>& lhs,const iScalar<rtype>& rhs)->iMatrix<decltype(lhs._internal[0][0]+rhs._internal),N>
{ {
typedef iMatrix<decltype(lhs._internal[0][0]+rhs._internal),N> ret_t; typedef iMatrix<decltype(lhs._internal[0][0]+rhs._internal),N> ret_t;
ret_t ret; ret_t ret;