Index: blitz/array-impl.h =================================================================== RCS file: /cvsroot/blitz/blitz/blitz/array-impl.h,v retrieving revision 1.10 diff -c -3 -p -r1.10 array-impl.h *** blitz/array-impl.h 30 Aug 2002 22:12:49 -0000 1.10 --- blitz/array-impl.h 7 Oct 2002 14:38:23 -0000 *************** class IndirectArray; *** 162,167 **** --- 162,169 ---- struct _bz_endTag {}; + template + void swap(Array&,Array&); /* *************** protected: *** 2473,2478 **** --- 2475,2482 ---- void doTranspose(int destRank, int sourceRank, T_array& array); + friend void swap<>(Array&,Array&); + protected: ////////////////////////////////////////////// // Data members *************** ostream& operator<<(ostream&, const Arra *** 2552,2557 **** --- 2556,2571 ---- template istream& operator>>(istream& is, Array& x); + + template + void swap(Array& a,Array& b) { + MemoryBlockReference::swap(a,b); + std::swap(a.storage_,b.storage_); + std::swap(a.length_,b.length_); + std::swap(a.stride_,b.stride_); + std::swap(a.zeroOffset_,b.zeroOffset_); + } + BZ_NAMESPACE_END Index: blitz/blitz.h =================================================================== RCS file: /cvsroot/blitz/blitz/blitz/blitz.h,v retrieving revision 1.9 diff -c -3 -p -r1.9 blitz.h *** blitz/blitz.h 19 Jul 2002 20:40:32 -0000 1.9 --- blitz/blitz.h 7 Oct 2002 14:38:23 -0000 *************** *** 115,123 **** #ifdef BZ_MATH_FN_IN_NAMESPACE_STD #include #endif - - #include #ifdef BZ_HAVE_COMPLEX #include --- 115,123 ---- #ifdef BZ_MATH_FN_IN_NAMESPACE_STD #include + #else + #include #endif #ifdef BZ_HAVE_COMPLEX #include Index: blitz/memblock.h =================================================================== RCS file: /cvsroot/blitz/blitz/blitz/memblock.h,v retrieving revision 1.9 diff -c -3 -p -r1.9 memblock.h *** blitz/memblock.h 19 Jul 2002 20:42:53 -0000 1.9 --- blitz/memblock.h 7 Oct 2002 14:38:23 -0000 *************** public: *** 382,387 **** --- 382,392 ---- return block_->references(); } + static void swap(MemoryBlockReference& a,MemoryBlockReference& b) { + std::swap(a.data_,b.data_); + std::swap(a.block_,b.block_); + } + protected: void changeToNullBlock() Index: blitz/traversal.cc =================================================================== RCS file: /cvsroot/blitz/blitz/blitz/traversal.cc,v retrieving revision 1.3 diff -c -3 -p -r1.3 traversal.cc *** blitz/traversal.cc 6 Mar 2002 17:18:11 -0000 1.3 --- blitz/traversal.cc 7 Oct 2002 14:38:23 -0000 *************** *** 48,56 **** --- 48,58 ---- BZ_NAMESPACE(blitz) + #ifdef INTEL // Next line is a workaround for Intel C++ V4.0 oddity, due // to Allan Stokes. static set > *_bz_intel_kludge; + #endif //template //_bz_typename TraversalOrderCollection::T_set Index: blitz/array/eval.cc =================================================================== RCS file: /cvsroot/blitz/blitz/blitz/array/eval.cc,v retrieving revision 1.6 diff -c -3 -p -r1.6 eval.cc *** blitz/array/eval.cc 27 May 2002 19:48:57 -0000 1.6 --- blitz/array/eval.cc 7 Oct 2002 14:38:23 -0000 *************** Array::evaluateWithSt *** 444,450 **** */ const int maxRank = ordering(0); - const int secondLastRank = ordering(1); // Create an iterator for the array receiving the result FastArrayIterator iter(*this); --- 444,449 ---- *************** Array::evaluateWithSt *** 567,575 **** if ((useUnitStride) || (useCommonStride)) { - T_numtype * _bz_restrict end = const_cast(iter.data()) - + lastLength; - #ifdef BZ_USE_FAST_READ_ARRAY_EXPR /* --- 566,571 ---- *************** Array::evaluateWithSt *** 618,623 **** --- 614,622 ---- // This bit of code not really needed; should remove at some // point, along with the test for BZ_USE_FAST_READ_ARRAY_EXPR + T_numtype * _bz_restrict end = const_cast(iter.data()) + + lastLength; + while (iter.data() != end) { T_update::update(*const_cast(iter.data()), *expr); *************** Array::evaluateWithIn *** 736,744 **** // index traversal for the source expression const int maxRank = ordering(0); - const int secondLastRank = ordering(1); #ifdef BZ_DEBUG_TRAVERSE cout << "Index traversal: N_rank = " << N_rank << endl; cout << "maxRank = " << maxRank << " secondLastRank = " << secondLastRank << endl; --- 735,743 ---- // index traversal for the source expression const int maxRank = ordering(0); #ifdef BZ_DEBUG_TRAVERSE + const int secondLastRank = ordering(1); cout << "Index traversal: N_rank = " << N_rank << endl; cout << "maxRank = " << maxRank << " secondLastRank = " << secondLastRank << endl; *************** cout.flush(); *** 757,764 **** for (int i=0; i < N_rank; ++i) last(i) = storage_.base(i) + length_(i); - - int lastLength = length(maxRank); while (true) { --- 756,761 ----