diff options
Diffstat (limited to 'scipy/f2py/doc/f2python9-final/src/examples')
5 files changed, 90 insertions, 0 deletions
diff --git a/scipy/f2py/doc/f2python9-final/src/examples/exp1.f b/scipy/f2py/doc/f2python9-final/src/examples/exp1.f new file mode 100644 index 000000000..36bee50b0 --- /dev/null +++ b/scipy/f2py/doc/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/scipy/f2py/doc/f2python9-final/src/examples/exp1mess.txt b/scipy/f2py/doc/f2python9-final/src/examples/exp1mess.txt new file mode 100644 index 000000000..ae1545718 --- /dev/null +++ b/scipy/f2py/doc/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/scipy/f2py/doc/f2python9-final/src/examples/exp1session.txt b/scipy/f2py/doc/f2python9-final/src/examples/exp1session.txt new file mode 100644 index 000000000..9bec9198e --- /dev/null +++ b/scipy/f2py/doc/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
\ No newline at end of file diff --git a/scipy/f2py/doc/f2python9-final/src/examples/foo.pyf b/scipy/f2py/doc/f2python9-final/src/examples/foo.pyf new file mode 100644 index 000000000..516bb292f --- /dev/null +++ b/scipy/f2py/doc/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/scipy/f2py/doc/f2python9-final/src/examples/foom.pyf b/scipy/f2py/doc/f2python9-final/src/examples/foom.pyf new file mode 100644 index 000000000..6392ebc95 --- /dev/null +++ b/scipy/f2py/doc/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/ |