File: info.py

package info (click to toggle)
python-scipy 0.6.0-12
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 32,016 kB
  • ctags: 46,675
  • sloc: cpp: 124,854; ansic: 110,614; python: 108,664; fortran: 76,260; objc: 424; makefile: 384; sh: 10
file content (28 lines) | stat: -rw-r--r-- 757 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""Fast numerical expression evaluator

Usage:

Build an expression up by using E.<variable> for the variables:

>>> ex = 2.0 * E.a + 3 * E.b * E.c

then compile it to a function:

>>> func = numexpr(ex, input_names=('a', 'b', 'c'))

(if input_names is not given to compile, the variables are sort lexically.)

Then, you can use that function for elementwise operations:

>>> func(array([1., 2, 3]), array([4., 5, 6]), array([7., 8, 9]))
array([  86.,  124.,  168.])

Currently, this is only implemented for arrays of float64, and only
for the simple operations +, -, *, and /.

Copyright 2006 David M. Cooke <cookedm@physics.mcmaster.ca>
Licenced under a BSD-style license. See LICENSE.txt in the scipy source
directory.
"""

depends = ['core', 'testing']