36 #ifndef TF_BLITZUTIL_H_VERSION 38 #define TF_BLITZUTIL_H_VERSION \ 39 "TF_BLITZUTIL_H V1.0 " 41 #include<blitz/array.h> 42 #include<tfxx/error.h> 62 template<
class T1,
class T2,
int N1,
int N2>
64 const blitz::Array<T2,N2>& a2)
65 {
return(blitz::areShapesConformable(a1.shape(),a2.shape())); }
74 template<
class T1,
class T2,
int N1,
int N2>
76 const blitz::Array<T2,N2>& a2)
77 {
return(blitz::areShapesConformable(a1.lbound(),a2.lbound())&&
78 blitz::areShapesConformable(a1.ubound(),a2.ubound())); }
89 template<
class T,
int N>
91 const blitz::RectDomain<N>& domain,
92 const blitz::GeneralArrayStorage<N>&
93 storage=blitz::fortranArray)
95 blitz::TinyVector<int, N> extent;
96 for (
int i=0; i<N; i++)
97 { extent[i]=domain.ubound()[i]-domain.lbound()[i]+1; }
98 blitz::Array<T, N> result(domain.lbound(),extent,storage);
99 array.reference(result);
106 #endif // TF_BLITZUTIL_H_VERSION (includeguard) bool sameDomain(const blitz::Array< T1, N1 > &a1, const blitz::Array< T2, N2 > &a2)
test for conforming domains
void setToSameDomain(blitz::Array< T, N > &array, const blitz::RectDomain< N > &domain, const blitz::GeneralArrayStorage< N > &storage=blitz::fortranArray)
create a second array spanning the same domain
bool sameShape(const blitz::Array< T1, N1 > &a1, const blitz::Array< T2, N2 > &a2)
test for conforming shapes
Namespace containing all code of library libtfxx.