![]() |
Blitz Devel : |
From: Theodore Papadopoulo (Theodore.Papadopoulo_at_[hidden])
Date: 2004-07-28 09:18:31
Hi, yet another (big but simple) patch.
This one is a no-brainer IMHO. It just makes the parameters passed to
operator() to be const. It should not change the blitz behaviour in
any way and improves the efficiency slightly in the Range case since
the copy constructor is no longer called.
I think that enough for today, more tomorrow...
Again, please comment and Julian please give an OK for commit.
Theo.
2004-07-28 Theodore Papadopoulo <Theodore.Papadopoulo_at_[hidden]>
* blitz/tinyvec.h: Added support for initialising a TinyVector from a C array.
* blitz/tinyvec.h,blitz/tinyvec.cc: constification of the operator() arguments,
ie replace operator()(XXX) by operator()(const XXX). For Range, pass a
const Range& instead of a Range avoids a copy constructor. Minor reformatting of the
code.
Index: blitz/tinyvec.cc
===================================================================
RCS file: /cvsroot/blitz/blitz/blitz/tinyvec.cc,v
retrieving revision 1.6
diff -c -3 -p -r1.6 tinyvec.cc
*** blitz/tinyvec.cc 11 Dec 2003 03:44:22 -0000 1.6
--- blitz/tinyvec.cc 28 Jul 2004 13:17:30 -0000
***************
*** 43,85 ****
BZ_NAMESPACE(blitz)
template<typename P_numtype, int N_length>
! inline TinyVector<P_numtype, N_length>::TinyVector(T_numtype initValue)
! {
for (int i=0; i < N_length; ++i)
data_[i] = initValue;
}
template<typename P_numtype, int N_length>
! inline TinyVector<P_numtype, N_length>::TinyVector(const
! TinyVector<T_numtype, N_length>& x)
! {
for (int i=0; i < N_length; ++i)
data_[i] = x.data_[i];
}
! template<typename P_numtype, int N_length> template<typename P_numtype2>
! inline TinyVector<P_numtype, N_length>::TinyVector(const
! TinyVector<P_numtype2, N_length>& x)
! {
for (int i=0; i < N_length; ++i)
data_[i] = static_cast<P_numtype>(x[i]);
}
! template<typename P_numtype, int N_length> template<typename P_expr, typename P_updater>
! inline
! void TinyVector<P_numtype, N_length>::_bz_assign(P_expr expr, P_updater up)
! {
BZPRECHECK(expr.length(N_length) == N_length,
"An expression with length " << expr.length(N_length)
<< " was assigned to a TinyVector<"
<< BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(T_numtype)
<< "," << N_length << ">");
! if (expr._bz_hasFastAccess())
! {
_bz_meta_vecAssign<N_length, 0>::fastAssign(*this, expr, up);
! }
! else {
_bz_meta_vecAssign<N_length, 0>::assign(*this, expr, up);
}
}
--- 43,78 ----
BZ_NAMESPACE(blitz)
template<typename P_numtype, int N_length>
! inline TinyVector<P_numtype, N_length>::TinyVector(const T_numtype initValue) {
for (int i=0; i < N_length; ++i)
data_[i] = initValue;
}
template<typename P_numtype, int N_length>
! inline TinyVector<P_numtype, N_length>::TinyVector(const TinyVector<T_numtype, N_length>& x) {
for (int i=0; i < N_length; ++i)
data_[i] = x.data_[i];
}
! template<typename P_numtype, int N_length>
! template<typename P_numtype2>
! inline TinyVector<P_numtype, N_length>::TinyVector(const TinyVector<P_numtype2, N_length>& x) {
for (int i=0; i < N_length; ++i)
data_[i] = static_cast<P_numtype>(x[i]);
}
! template<typename P_numtype, int N_length>
! template<typename P_expr, typename P_updater>
! inline void TinyVector<P_numtype, N_length>::_bz_assign(P_expr expr, P_updater up) {
BZPRECHECK(expr.length(N_length) == N_length,
"An expression with length " << expr.length(N_length)
<< " was assigned to a TinyVector<"
<< BZ_DEBUG_TEMPLATE_AS_STRING_LITERAL(T_numtype)
<< "," << N_length << ">");
! if (expr._bz_hasFastAccess()) {
_bz_meta_vecAssign<N_length, 0>::fastAssign(*this, expr, up);
! } else {
_bz_meta_vecAssign<N_length, 0>::assign(*this, expr, up);
}
}
*************** TinyVector<P_numtype, N_length>::operato
*** 199,205 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::initialize(T_numtype x)
{
#ifndef BZ_KCC_COPY_PROPAGATION_KLUDGE
typedef _bz_VecExprConstant<T_numtype> T_expr;
--- 192,198 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::initialize(const T_numtype x)
{
#ifndef BZ_KCC_COPY_PROPAGATION_KLUDGE
typedef _bz_VecExprConstant<T_numtype> T_expr;
*************** TinyVector<P_numtype, N_length>::initial
*** 215,221 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator+=(T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) += _bz_VecExpr<T_expr>(T_expr(x));
--- 208,214 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator+=(const T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) += _bz_VecExpr<T_expr>(T_expr(x));
*************** TinyVector<P_numtype, N_length>::operato
*** 224,230 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator-=(T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) -= _bz_VecExpr<T_expr>(T_expr(x));
--- 217,223 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator-=(const T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) -= _bz_VecExpr<T_expr>(T_expr(x));
*************** TinyVector<P_numtype, N_length>::operato
*** 233,239 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator*=(T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) *= _bz_VecExpr<T_expr>(T_expr(x));
--- 226,232 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator*=(const T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) *= _bz_VecExpr<T_expr>(T_expr(x));
*************** TinyVector<P_numtype, N_length>::operato
*** 242,248 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator/=(T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) /= _bz_VecExpr<T_expr>(T_expr(x));
--- 235,241 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator/=(const T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) /= _bz_VecExpr<T_expr>(T_expr(x));
*************** TinyVector<P_numtype, N_length>::operato
*** 251,257 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator%=(T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) %= _bz_VecExpr<T_expr>(T_expr(x));
--- 244,250 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator%=(const T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) %= _bz_VecExpr<T_expr>(T_expr(x));
*************** TinyVector<P_numtype, N_length>::operato
*** 260,266 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator^=(T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) ^= _bz_VecExpr<T_expr>(T_expr(x));
--- 253,259 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator^=(const T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) ^= _bz_VecExpr<T_expr>(T_expr(x));
*************** TinyVector<P_numtype, N_length>::operato
*** 269,275 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator&=(T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) &= _bz_VecExpr<T_expr>(T_expr(x));
--- 262,268 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator&=(const T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) &= _bz_VecExpr<T_expr>(T_expr(x));
*************** TinyVector<P_numtype, N_length>::operato
*** 278,284 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator|=(T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) |= _bz_VecExpr<T_expr>(T_expr(x));
--- 271,277 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator|=(const T_numtype x)
{
typedef _bz_VecExprConstant<T_numtype> T_expr;
(*this) |= _bz_VecExpr<T_expr>(T_expr(x));
*************** TinyVector<P_numtype, N_length>::operato
*** 287,293 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator<<=(int x)
{
typedef _bz_VecExprConstant<int> T_expr;
(*this) <<= _bz_VecExpr<T_expr>(T_expr(x));
--- 280,286 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator<<=(const int x)
{
typedef _bz_VecExprConstant<int> T_expr;
(*this) <<= _bz_VecExpr<T_expr>(T_expr(x));
*************** TinyVector<P_numtype, N_length>::operato
*** 296,302 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator>>=(int x)
{
typedef _bz_VecExprConstant<int> T_expr;
(*this) >>= _bz_VecExpr<T_expr>(T_expr(x));
--- 289,295 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator>>=(const int x)
{
typedef _bz_VecExprConstant<int> T_expr;
(*this) >>= _bz_VecExpr<T_expr>(T_expr(x));
*************** TinyVector<P_numtype, N_length>::operato
*** 309,317 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator=(const
! TinyVector<P_numtype2, N_length>& x)
! {
(*this) = _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
--- 302,308 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator=(const TinyVector<P_numtype2, N_length>& x) {
(*this) = _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
*************** TinyVector<P_numtype, N_length>::operato
*** 319,327 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator+=(const
! TinyVector<P_numtype2, N_length>& x)
! {
(*this) += _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
--- 310,316 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator+=(const TinyVector<P_numtype2, N_length>& x) {
(*this) += _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
*************** TinyVector<P_numtype, N_length>::operato
*** 329,337 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator-=(const
! TinyVector<P_numtype2, N_length>& x)
! {
(*this) -= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
--- 318,324 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator-=(const TinyVector<P_numtype2, N_length>& x) {
(*this) -= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
*************** TinyVector<P_numtype, N_length>::operato
*** 339,347 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator*=(const
! TinyVector<P_numtype2, N_length>& x)
! {
(*this) *= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
--- 326,332 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator*=(const TinyVector<P_numtype2, N_length>& x) {
(*this) *= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
*************** TinyVector<P_numtype, N_length>::operato
*** 349,357 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator/=(const
! TinyVector<P_numtype2, N_length>& x)
! {
(*this) /= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
--- 334,340 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator/=(const TinyVector<P_numtype2, N_length>& x) {
(*this) /= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
*************** TinyVector<P_numtype, N_length>::operato
*** 359,367 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator%=(const
! TinyVector<P_numtype2, N_length>& x)
! {
(*this) %= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
--- 342,348 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator%=(const TinyVector<P_numtype2, N_length>& x) {
(*this) %= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
*************** TinyVector<P_numtype, N_length>::operato
*** 369,377 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator^=(const
! TinyVector<P_numtype2, N_length>& x)
! {
(*this) ^= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
--- 350,356 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator^=(const TinyVector<P_numtype2, N_length>& x) {
(*this) ^= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
*************** TinyVector<P_numtype, N_length>::operato
*** 379,387 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator&=(const
! TinyVector<P_numtype2, N_length>& x)
! {
(*this) &= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
--- 358,364 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator&=(const TinyVector<P_numtype2, N_length>& x) {
(*this) &= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
*************** TinyVector<P_numtype, N_length>::operato
*** 389,397 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator|=(const
! TinyVector<P_numtype2, N_length>& x)
! {
(*this) |= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
--- 366,372 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator|=(const TinyVector<P_numtype2, N_length>& x) {
(*this) |= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
*************** TinyVector<P_numtype, N_length>::operato
*** 399,407 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator<<=(const
! TinyVector<P_numtype2, N_length>& x)
! {
(*this) <<= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
--- 374,380 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator<<=(const TinyVector<P_numtype2, N_length>& x) {
(*this) <<= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
*************** TinyVector<P_numtype, N_length>::operato
*** 409,417 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator>>=(const
! TinyVector<P_numtype2, N_length>& x)
! {
(*this) >>= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
--- 382,388 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator>>=(const TinyVector<P_numtype2, N_length>& x) {
(*this) >>= _bz_VecExpr<_bz_typename
TinyVector<P_numtype2, N_length>::T_constIterator>(x.begin());
return *this;
*************** TinyVector<P_numtype, N_length>::operato
*** 423,510 ****
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator=(const Vector<P_numtype2>& x)
! {
(*this) = x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator+=(const Vector<P_numtype2>& x)
! {
(*this) += x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator-=(const Vector<P_numtype2>& x)
! {
(*this) -= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator*=(const Vector<P_numtype2>& x)
! {
(*this) *= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator/=(const Vector<P_numtype2>& x)
! {
(*this) /= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator%=(const Vector<P_numtype2>& x)
! {
(*this) %= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator^=(const Vector<P_numtype2>& x)
! {
(*this) ^= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator&=(const Vector<P_numtype2>& x)
! {
(*this) &= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator|=(const Vector<P_numtype2>& x)
! {
(*this) |= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator<<=(const Vector<P_numtype2>& x)
! {
(*this) <<= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator>>=(const Vector<P_numtype2>& x)
! {
(*this) >>= x._bz_asVecExpr();
return *this;
}
--- 394,470 ----
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator=(const Vector<P_numtype2>& x) {
(*this) = x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator+=(const Vector<P_numtype2>& x) {
(*this) += x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator-=(const Vector<P_numtype2>& x) {
(*this) -= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator*=(const Vector<P_numtype2>& x) {
(*this) *= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator/=(const Vector<P_numtype2>& x) {
(*this) /= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator%=(const Vector<P_numtype2>& x) {
(*this) %= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator^=(const Vector<P_numtype2>& x) {
(*this) ^= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator&=(const Vector<P_numtype2>& x) {
(*this) &= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator|=(const Vector<P_numtype2>& x) {
(*this) |= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator<<=(const Vector<P_numtype2>& x) {
(*this) <<= x._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length> template<typename P_numtype2>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator>>=(const Vector<P_numtype2>& x) {
(*this) >>= x._bz_asVecExpr();
return *this;
}
*************** TinyVector<P_numtype, N_length>::operato
*** 515,602 ****
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator=(Range r)
! {
(*this) = r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator+=(Range r)
! {
(*this) += r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator-=(Range r)
! {
(*this) -= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator*=(Range r)
! {
(*this) *= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator/=(Range r)
! {
(*this) /= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator%=(Range r)
! {
(*this) %= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator^=(Range r)
! {
(*this) ^= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator&=(Range r)
! {
(*this) &= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator|=(Range r)
! {
(*this) |= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator<<=(Range r)
! {
(*this) <<= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator>>=(Range r)
! {
(*this) >>= r._bz_asVecExpr();
return *this;
}
--- 475,551 ----
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator=(const Range& r) {
(*this) = r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator+=(const Range& r) {
(*this) += r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator-=(const Range& r) {
(*this) -= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator*=(const Range& r) {
(*this) *= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator/=(const Range& r) {
(*this) /= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator%=(const Range& r) {
(*this) %= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator^=(const Range& r) {
(*this) ^= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator&=(const Range& r) {
(*this) &= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator|=(const Range& r) {
(*this) |= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator<<=(const Range& r) {
(*this) <<= r._bz_asVecExpr();
return *this;
}
template<typename P_numtype, int N_length>
inline TinyVector<P_numtype, N_length>&
! TinyVector<P_numtype, N_length>::operator>>=(const Range& r) {
(*this) >>= r._bz_asVecExpr();
return *this;
}
Index: blitz/tinyvec.h
===================================================================
RCS file: /cvsroot/blitz/blitz/blitz/tinyvec.h,v
retrieving revision 1.7
diff -c -3 -p -r1.7 tinyvec.h
*** blitz/tinyvec.h 11 Dec 2003 03:44:22 -0000 1.7
--- blitz/tinyvec.h 28 Jul 2004 13:17:30 -0000
*************** public:
*** 90,107 ****
typedef T_constIterator const_iterator;
enum { numElements = N_length };
! TinyVector()
! { }
!
! ~TinyVector()
! { }
inline TinyVector(const TinyVector<T_numtype,N_length>& x);
template <typename T_numtype2>
inline TinyVector(const TinyVector<T_numtype2,N_length>& x);
! inline TinyVector(T_numtype initValue);
TinyVector(T_numtype x0, T_numtype x1)
{
--- 90,108 ----
typedef T_constIterator const_iterator;
enum { numElements = N_length };
! TinyVector() { }
! ~TinyVector() { }
inline TinyVector(const TinyVector<T_numtype,N_length>& x);
template <typename T_numtype2>
inline TinyVector(const TinyVector<T_numtype2,N_length>& x);
! inline TinyVector(const T_numtype initValue);
!
! inline TinyVector(const T_numtype x[]) {
! memcpy(data_,x,N_length*sizeof(T_numtype));
! }
TinyVector(T_numtype x0, T_numtype x1)
{
*************** public:
*** 318,334 ****
return ListInitializationSwitch<T_vector,T_numtype*>(*this, x);
}
! T_vector& initialize(T_numtype);
! T_vector& operator+=(T_numtype);
! T_vector& operator-=(T_numtype);
! T_vector& operator*=(T_numtype);
! T_vector& operator/=(T_numtype);
! T_vector& operator%=(T_numtype);
! T_vector& operator^=(T_numtype);
! T_vector& operator&=(T_numtype);
! T_vector& operator|=(T_numtype);
! T_vector& operator>>=(int);
! T_vector& operator<<=(int);
template<typename P_numtype2>
T_vector& operator=(const TinyVector<P_numtype2, N_length> &);
--- 319,335 ----
return ListInitializationSwitch<T_vector,T_numtype*>(*this, x);
}
! T_vector& initialize(const T_numtype);
! T_vector& operator+=(const T_numtype);
! T_vector& operator-=(const T_numtype);
! T_vector& operator*=(const T_numtype);
! T_vector& operator/=(const T_numtype);
! T_vector& operator%=(const T_numtype);
! T_vector& operator^=(const T_numtype);
! T_vector& operator&=(const T_numtype);
! T_vector& operator|=(const T_numtype);
! T_vector& operator>>=(const int);
! T_vector& operator<<=(const int);
template<typename P_numtype2>
T_vector& operator=(const TinyVector<P_numtype2, N_length> &);
*************** public:
*** 403,419 ****
T_vector& operator<<=(const VectorPick<P_numtype2> &);
// Range operand
! T_vector& operator=(Range);
! T_vector& operator+=(Range);
! T_vector& operator-=(Range);
! T_vector& operator*=(Range);
! T_vector& operator/=(Range);
! T_vector& operator%=(Range);
! T_vector& operator^=(Range);
! T_vector& operator&=(Range);
! T_vector& operator|=(Range);
! T_vector& operator>>=(Range);
! T_vector& operator<<=(Range);
T_numtype* restrict getInitializationIterator()
{ return dataFirst(); }
--- 404,420 ----
T_vector& operator<<=(const VectorPick<P_numtype2> &);
// Range operand
! T_vector& operator=(const Range&);
! T_vector& operator+=(const Range&);
! T_vector& operator-=(const Range&);
! T_vector& operator*=(const Range&);
! T_vector& operator/=(const Range&);
! T_vector& operator%=(const Range&);
! T_vector& operator^=(const Range&);
! T_vector& operator&=(const Range&);
! T_vector& operator|=(const Range&);
! T_vector& operator>>=(const Range&);
! T_vector& operator<<=(const Range&);
T_numtype* restrict getInitializationIterator()
{ return dataFirst(); }
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo_at_[hidden] Tel: (33) 04 92 38 76 01
--------------------------------------------------------------------