Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/python/test/numeric_tests.py @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 632 bytes
Line 
1# Copyright David Abrahams 2006. Distributed under the Boost
2# Software License, Version 1.0. (See accompanying
3# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4import printer
5'''
6>>> from numpy_ext import *
7>>> x = new_array()
8>>> x[1,1] = 0.0
9
10>>> try: take_array(3)
11... except TypeError: pass
12... else: print 'expected a TypeError'
13
14>>> take_array(x)
15
16>>> print x
17[[1 2 3]
18 [4 0 6]
19 [7 8 9]]
20
21>>> y = x.copy()
22
23
24>>> p = _printer()
25>>> check = p.check
26>>> exercise(x, p)
27>>> y[2,1] = 3
28>>> check(y);
29
30>>> check(y.astype('D'));
31
32>>> check(y.copy());
33
34>>> check(y.typecode());
35
36>>> p.results
37[]
38>>> del p
39'''
Note: See TracBrowser for help on using the repository browser.