From: Brian H. <hel...@cl...> - 2005-11-07 22:29:41
|
blitzers: I have a code snippet that I want to use to do some vector arithmetic: TinyVector<Array<TinyVector<double,2>,2>,5> crvbd; int stage,j,m; crvbd(stage)(j,m) =3D crvbd(0)(j,m)-crvbd(1)(j,m); But this gives a compile time error: /Users/helenbrk/Codes/spectral_hp2/hp_boundary.h:423: error: no match =20= for 'operator-' in '(+((hp_curved*)this)->hp_curved::crvbd. =20 blitz::TinyVector<P_numtype, N_length>::operator() [with P_numtype =3D =20= blitz::Array<blitz::TinyVector<double, 2>, 2>, int N_length =3D 5](0u))-=20= >blitz::Array<T, N>::operator() [with P_numtype =3D =20 blitz::TinyVector<double, 2>, int N_rank =3D 2](j, m) - (+((hp_curved*)=20= this)->hp_curved::crvbd. blitz::TinyVector<P_numtype, =20 N_length>::operator() [with P_numtype =3D =20 blitz::Array<blitz::TinyVector<double, 2>, 2>, int N_length =3D 5](1u))-=20= >blitz::Array<T, N>::operator() [with P_numtype =3D =20 blitz::TinyVector<double, 2>, int N_rank =3D 2](j, m)' /Users/helenbrk/Codes/include/blitz/vecexpr.h:249: note: candidates =20 are: blitz::_bz_VecExpr<blitz::_bz_VecExprUnaryOp<blitz::Range, =20 blitz::_bz_negate<int> > > blitz::operator-(blitz::Range) However if I break the expression into steps such as: crvbd(stage)(j,m) =3D crvbd(0)(j,m); crvbd(stage)(j,m) -=3D crvbd(1)(j,m); Everything works. Am I doing something wrong? Brian Brian Helenbrook Assistant Professor Mechanical and Aeronautical Eng. Clarkson University Potsdam, NY 13699-5725 http://www.clarkson.edu/mae/faculty/helenbrook.html 315-268-2204 =EF=BF=BC |