/* * $Id: vecall.cc,v 1.3 2003/12/11 03:44:22 julianc Exp $ * * Copyright (C) 1997 Todd Veldhuizen * All rights reserved. Please see for terms and * conditions of use. * */ #ifndef BZ_VECALL_CC #define BZ_VECALL_CC #ifndef BZ_VECGLOBS_H #error must be included via #endif BZ_NAMESPACE(blitz) template inline bool _bz_vec_all(P_expr vector) { int length = vector._bz_suggestLength(); if (vector._bz_hasFastAccess()) { for (int i=0; i < length; ++i) if (!vector._bz_fastAccess(i)) return false; } else { for (int i=0; i < length; ++i) if (!vector[i]) return false; } return true; } template inline bool all(const Vector& x) { return _bz_vec_all(x._bz_asVecExpr()); } template inline bool all(_bz_VecExpr expr) { return _bz_vec_all(expr); } template inline bool all(const VectorPick& x) { return _bz_vec_all(x._bz_asVecExpr()); } template inline bool all(const TinyVector& x) { return _bz_vec_all(x._bz_asVecExpr()); } BZ_NAMESPACE_END #endif // BZ_VECALL_CC