diff options
author | Pauli Virtanen <pav@iki.fi> | 2014-01-02 22:12:01 +0200 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2014-01-02 22:19:47 +0200 |
commit | 75c2d2fe3cc9daa6589707fb6b8512ffa48fc365 (patch) | |
tree | 32e729ca94dd28e06c7c2e10fd250f2ce4b91a2a /doc/f2py/f2python9-final/src | |
parent | a32807e61b25205cc08d552127234b56709c6242 (diff) | |
download | numpy-75c2d2fe3cc9daa6589707fb6b8512ffa48fc365.tar.gz |
DOC: move f2py documentation under doc/ and link its user guide with Sphinx
Diffstat (limited to 'doc/f2py/f2python9-final/src')
-rw-r--r-- | doc/f2py/f2python9-final/src/examples/exp1.f | 26 | ||||
-rw-r--r-- | doc/f2py/f2python9-final/src/examples/exp1mess.txt | 17 | ||||
-rw-r--r-- | doc/f2py/f2python9-final/src/examples/exp1session.txt | 20 | ||||
-rw-r--r-- | doc/f2py/f2python9-final/src/examples/foo.pyf | 13 | ||||
-rw-r--r-- | doc/f2py/f2python9-final/src/examples/foom.pyf | 14 |
5 files changed, 90 insertions, 0 deletions
diff --git a/doc/f2py/f2python9-final/src/examples/exp1.f b/doc/f2py/f2python9-final/src/examples/exp1.f new file mode 100644 index 000000000..36bee50b0 --- /dev/null +++ b/doc/f2py/f2python9-final/src/examples/exp1.f @@ -0,0 +1,26 @@ + subroutine exp1(l,u,n) +C Input: n is number of iterations +C Output: l,u are such that +C l(1)/l(2) < exp(1) < u(1)/u(2) +C +Cf2py integer*4 :: n = 1 +Cf2py intent(out) l,u + integer*4 n,i + real*8 l(2),u(2),t,t1,t2,t3,t4 + l(2) = 1 + l(1) = 0 + u(2) = 0 + u(1) = 1 + do 10 i=0,n + t1 = 4 + 32*(1+i)*i + t2 = 11 + (40+32*i)*i + t3 = 3 + (24+32*i)*i + t4 = 8 + 32*(1+i)*i + t = u(1) + u(1) = l(1)*t1 + t*t2 + l(1) = l(1)*t3 + t*t4 + t = u(2) + u(2) = l(2)*t1 + t*t2 + l(2) = l(2)*t3 + t*t4 + 10 continue + end diff --git a/doc/f2py/f2python9-final/src/examples/exp1mess.txt b/doc/f2py/f2python9-final/src/examples/exp1mess.txt new file mode 100644 index 000000000..d4188a91b --- /dev/null +++ b/doc/f2py/f2python9-final/src/examples/exp1mess.txt @@ -0,0 +1,17 @@ +Reading fortran codes... + Reading file 'exp1.f' +Post-processing... + Block: foo + Block: exp1 +Creating 'Makefile-foo'... + Linker: ld ('GNU ld' 2.9.5) + Fortran compiler: f77 ('g77 2.x.x' 2.95.2) + C compiler: cc ('gcc 2.x.x' 2.95.2) +Building modules... + Building module "foo"... + Constructing wrapper function "exp1"... + l,u = exp1([n]) + Wrote C/API module "foo" to file "foomodule.c" + Documentation is saved to file "foomodule.tex" +Run GNU make to build shared modules: + gmake -f Makefile-<modulename> [test] diff --git a/doc/f2py/f2python9-final/src/examples/exp1session.txt b/doc/f2py/f2python9-final/src/examples/exp1session.txt new file mode 100644 index 000000000..5ae75ebd1 --- /dev/null +++ b/doc/f2py/f2python9-final/src/examples/exp1session.txt @@ -0,0 +1,20 @@ +>>> import foo,Numeric +>>> print foo.exp1.__doc__ +exp1 - Function signature: + l,u = exp1([n]) +Optional arguments: + n := 1 input int +Return objects: + l : rank-1 array('d') with bounds (2) + u : rank-1 array('d') with bounds (2) + +>>> l,u = foo.exp1() +>>> print l,u +[ 1264. 465.] [ 1457. 536.] +>>> print l[0]/l[1], u[0]/u[1]-l[0]/l[1] +2.71827956989 2.25856657199e-06 +>>> l,u = foo.exp1(2) +>>> print l,u +[ 517656. 190435.] [ 566827. 208524.] +>>> print l[0]/l[1], u[0]/u[1]-l[0]/l[1] +2.71828182845 1.36437527942e-11 diff --git a/doc/f2py/f2python9-final/src/examples/foo.pyf b/doc/f2py/f2python9-final/src/examples/foo.pyf new file mode 100644 index 000000000..516bb292f --- /dev/null +++ b/doc/f2py/f2python9-final/src/examples/foo.pyf @@ -0,0 +1,13 @@ +!%f90 -*- f90 -*- +python module foo + interface + subroutine exp1(l,u,n) + real*8 dimension(2) :: l + real*8 dimension(2) :: u + integer*4 :: n + end subroutine exp1 + end interface +end python module foo +! This file was auto-generated with f2py +! (version:2.298). +! See http://cens.ioc.ee/projects/f2py2e/ diff --git a/doc/f2py/f2python9-final/src/examples/foom.pyf b/doc/f2py/f2python9-final/src/examples/foom.pyf new file mode 100644 index 000000000..6392ebc95 --- /dev/null +++ b/doc/f2py/f2python9-final/src/examples/foom.pyf @@ -0,0 +1,14 @@ +!%f90 -*- f90 -*- +python module foo + interface + subroutine exp1(l,u,n) + real*8 dimension(2) :: l + real*8 dimension(2) :: u + intent(out) l,u + integer*4 optional :: n = 1 + end subroutine exp1 + end interface +end python module foo +! This file was auto-generated with f2py +! (version:2.298) and modified by pearu. +! See http://cens.ioc.ee/projects/f2py2e/ |