Line | |
---|
1 | /* |
---|
2 | * $Id: vecio.cc,v 1.3 2003/12/11 03:44:22 julianc Exp $ |
---|
3 | * |
---|
4 | * Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org> |
---|
5 | * All rights reserved. Please see <blitz/blitz.h> for terms and |
---|
6 | * conditions of use. |
---|
7 | * |
---|
8 | */ |
---|
9 | |
---|
10 | #ifndef BZ_VECIO_CC |
---|
11 | #define BZ_VECIO_CC |
---|
12 | |
---|
13 | #ifndef BZ_VECTOR_H |
---|
14 | #include <blitz/vector.h> |
---|
15 | #endif |
---|
16 | |
---|
17 | BZ_NAMESPACE(blitz) |
---|
18 | |
---|
19 | // This version of operator<< is provided as a temporary measure |
---|
20 | // only. It will be revised in a future release. |
---|
21 | // NEEDS_WORK |
---|
22 | |
---|
23 | template<typename P_numtype> |
---|
24 | ostream& operator<<(ostream& os, const Vector<P_numtype>& x) |
---|
25 | { |
---|
26 | os << "[ "; |
---|
27 | for (int i=0; i < x.length(); ++i) |
---|
28 | { |
---|
29 | os << setw(10) << x[i]; |
---|
30 | if (!((i+1)%7)) |
---|
31 | os << endl << " "; |
---|
32 | } |
---|
33 | os << " ]"; |
---|
34 | return os; |
---|
35 | } |
---|
36 | |
---|
37 | template<typename P_expr> |
---|
38 | ostream& operator<<(ostream& os, _bz_VecExpr<P_expr> expr) |
---|
39 | { |
---|
40 | Vector<_bz_typename P_expr::T_numtype> result(expr); |
---|
41 | os << result; |
---|
42 | return os; |
---|
43 | } |
---|
44 | |
---|
45 | BZ_NAMESPACE_END |
---|
46 | |
---|
47 | #endif // BZ_VECIO_CC |
---|
Note: See
TracBrowser
for help on using the repository browser.