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)
6
# So we can coerce portably across Python versions
10
>>> from numpy_ext import *
15
>>> exercise_numarray(x, p)
19
>>> check(y.argmax());
20
>>> check(y.argmax(0));
22
>>> check(y.argmin());
23
>>> check(y.argmin(0));
25
>>> check(y.argsort());
26
>>> check(y.argsort(1));
31
>>> check(y.diagonal());
32
>>> check(y.diagonal(1));
33
>>> check(y.diagonal(0, 0));
34
>>> check(y.diagonal(0, 1, 0));
36
>>> check(y.is_c_array());
38
# coerce because numarray still returns an int and the C++ interface forces
39
# the return type to bool
40
>>> check( bool(y.isbyteswapped()) );
43
>>> check(y.trace(1));
44
>>> check(y.trace(0, 0));
45
>>> check(y.trace(0, 1, 0));
47
>>> check(y.new('D').getshape());
48
>>> check(y.new('D').type());
53
>>> check(y.factory((1.2, 3.4)));
54
>>> check(y.factory((1.2, 3.4), "f8"))
55
>>> check(y.factory((1.2, 3.4), "f8", true))
56
>>> check(y.factory((1.2, 3.4), "f8", true, false))
57
>>> check(y.factory((1.2, 3.4), "f8", true, false, None))
58
>>> check(y.factory((1.2, 3.4), "f8", true, false, None, (1,2,1)))