~ubuntu-branches/ubuntu/raring/python-scipy/raring-proposed

« back to all changes in this revision

Viewing changes to Lib/weave/blitz/blitz/vecio.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-07 14:12:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070107141212-mm0ebkh5b37hcpzn
* Remove build dependency on python-numpy-dev.
* python-scipy: Depend on python-numpy instead of python-numpy-dev.
* Package builds on other archs than i386. Closes: #402783.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: vecio.cc 1414 2005-11-01 22:04:59Z cookedm $
 
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