[Scipy-svn] r5103 - in scipy-docs/trunk/source/tutorial: . examples

scipy-svn@scip... scipy-svn@scip...
Thu Nov 13 19:02:15 CST 2008


Author: ptvirtan
Date: 2008-11-13 18:56:39 -0600 (Thu, 13 Nov 2008)
New Revision: 5103

Added:
   scipy-docs/trunk/source/tutorial/examples/1-1
   scipy-docs/trunk/source/tutorial/examples/10-2-1
   scipy-docs/trunk/source/tutorial/examples/10-2-2
   scipy-docs/trunk/source/tutorial/examples/10-2-3
   scipy-docs/trunk/source/tutorial/examples/10-2-5
   scipy-docs/trunk/source/tutorial/examples/10-3-1
   scipy-docs/trunk/source/tutorial/examples/10-3-2
   scipy-docs/trunk/source/tutorial/examples/10-3-6
   scipy-docs/trunk/source/tutorial/examples/10-4-4
   scipy-docs/trunk/source/tutorial/examples/2-1
   scipy-docs/trunk/source/tutorial/examples/2-2
   scipy-docs/trunk/source/tutorial/examples/2-3
   scipy-docs/trunk/source/tutorial/examples/3-1
   scipy-docs/trunk/source/tutorial/examples/3-2
   scipy-docs/trunk/source/tutorial/examples/4-1
   scipy-docs/trunk/source/tutorial/examples/4-2
   scipy-docs/trunk/source/tutorial/examples/4-3
   scipy-docs/trunk/source/tutorial/examples/4-4
   scipy-docs/trunk/source/tutorial/examples/4-5
   scipy-docs/trunk/source/tutorial/examples/4-6
   scipy-docs/trunk/source/tutorial/examples/5-1
   scipy-docs/trunk/source/tutorial/examples/5-2
   scipy-docs/trunk/source/tutorial/examples/5-3
   scipy-docs/trunk/source/tutorial/examples/5-4
   scipy-docs/trunk/source/tutorial/examples/5-5
   scipy-docs/trunk/source/tutorial/examples/5-6
   scipy-docs/trunk/source/tutorial/examples/5-7
   scipy-docs/trunk/source/tutorial/examples/5-8
   scipy-docs/trunk/source/tutorial/examples/5-9
   scipy-docs/trunk/source/tutorial/examples/6-1
   scipy-docs/trunk/source/tutorial/examples/6-2
   scipy-docs/trunk/source/tutorial/examples/6-3
   scipy-docs/trunk/source/tutorial/examples/6-4
Removed:
   scipy-docs/trunk/source/tutorial/examples/1.1
   scipy-docs/trunk/source/tutorial/examples/10.2.1
   scipy-docs/trunk/source/tutorial/examples/10.2.2
   scipy-docs/trunk/source/tutorial/examples/10.2.3
   scipy-docs/trunk/source/tutorial/examples/10.2.5
   scipy-docs/trunk/source/tutorial/examples/10.3.1
   scipy-docs/trunk/source/tutorial/examples/10.3.2
   scipy-docs/trunk/source/tutorial/examples/10.3.6
   scipy-docs/trunk/source/tutorial/examples/10.4.4
   scipy-docs/trunk/source/tutorial/examples/2.1
   scipy-docs/trunk/source/tutorial/examples/2.2
   scipy-docs/trunk/source/tutorial/examples/2.3
   scipy-docs/trunk/source/tutorial/examples/3.1
   scipy-docs/trunk/source/tutorial/examples/3.2
   scipy-docs/trunk/source/tutorial/examples/4.1
   scipy-docs/trunk/source/tutorial/examples/4.2
   scipy-docs/trunk/source/tutorial/examples/4.3
   scipy-docs/trunk/source/tutorial/examples/4.4
   scipy-docs/trunk/source/tutorial/examples/4.5
   scipy-docs/trunk/source/tutorial/examples/4.6
   scipy-docs/trunk/source/tutorial/examples/5.1
   scipy-docs/trunk/source/tutorial/examples/5.2
   scipy-docs/trunk/source/tutorial/examples/5.3
   scipy-docs/trunk/source/tutorial/examples/5.4
   scipy-docs/trunk/source/tutorial/examples/5.5
   scipy-docs/trunk/source/tutorial/examples/5.6
   scipy-docs/trunk/source/tutorial/examples/5.7
   scipy-docs/trunk/source/tutorial/examples/5.8
   scipy-docs/trunk/source/tutorial/examples/5.9
   scipy-docs/trunk/source/tutorial/examples/6.1
   scipy-docs/trunk/source/tutorial/examples/6.2
   scipy-docs/trunk/source/tutorial/examples/6.3
   scipy-docs/trunk/source/tutorial/examples/6.4
Modified:
   scipy-docs/trunk/source/tutorial/index.rst
Log:
docs: Rename files so that the generated images get names that Latex approves of

Copied: scipy-docs/trunk/source/tutorial/examples/1-1 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/1.1)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/1.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/1-1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,37 @@
+>>> info(optimize.fmin)
+ fmin(func, x0, args=(), xtol=0.0001, ftol=0.0001, maxiter=None, maxfun=None,
+      full_output=0, printmessg=1)
+
+Minimize a function using the simplex algorithm.
+
+Description:
+
+  Uses a Nelder-Mead simplex algorithm to find the minimum of function
+  of one or more variables.
+
+Inputs:
+
+  func -- the Python function or method to be minimized.
+  x0 -- the initial guess.
+  args -- extra arguments for func.
+  xtol -- relative tolerance
+
+Outputs: (xopt, {fopt, warnflag})
+
+  xopt -- minimizer of function
+
+  fopt -- value of function at minimum: fopt = func(xopt)
+  warnflag -- Integer warning flag:
+              1 : 'Maximum number of function evaluations.'
+              2 : 'Maximum number of iterations.'
+
+Additional Inputs:
+
+  xtol -- acceptable relative error in xopt for convergence.
+  ftol -- acceptable relative error in func(xopt) for convergence.
+  maxiter -- the maximum number of iterations to perform.
+  maxfun -- the maximum number of function evaluations.
+  full_output -- non-zero if fval and warnflag outputs are desired.
+  printmessg -- non-zero to print convergence messages.
+  
+  

Deleted: scipy-docs/trunk/source/tutorial/examples/1.1
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/1.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/1.1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,37 +0,0 @@
->>> info(optimize.fmin)
- fmin(func, x0, args=(), xtol=0.0001, ftol=0.0001, maxiter=None, maxfun=None,
-      full_output=0, printmessg=1)
-
-Minimize a function using the simplex algorithm.
-
-Description:
-
-  Uses a Nelder-Mead simplex algorithm to find the minimum of function
-  of one or more variables.
-
-Inputs:
-
-  func -- the Python function or method to be minimized.
-  x0 -- the initial guess.
-  args -- extra arguments for func.
-  xtol -- relative tolerance
-
-Outputs: (xopt, {fopt, warnflag})
-
-  xopt -- minimizer of function
-
-  fopt -- value of function at minimum: fopt = func(xopt)
-  warnflag -- Integer warning flag:
-              1 : 'Maximum number of function evaluations.'
-              2 : 'Maximum number of iterations.'
-
-Additional Inputs:
-
-  xtol -- acceptable relative error in xopt for convergence.
-  ftol -- acceptable relative error in func(xopt) for convergence.
-  maxiter -- the maximum number of iterations to perform.
-  maxfun -- the maximum number of function evaluations.
-  full_output -- non-zero if fval and warnflag outputs are desired.
-  printmessg -- non-zero to print convergence messages.
-  
-  

Copied: scipy-docs/trunk/source/tutorial/examples/10-2-1 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/10.2.1)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.2.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10-2-1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,13 @@
+>>> A = mat('[1 3 5; 2 5 1; 2 3 8]')
+>>> A
+Matrix([[1, 3, 5],
+       [2, 5, 1],
+       [2, 3, 8]])
+>>> A.I
+Matrix([[-1.48,  0.36,  0.88],
+       [ 0.56,  0.08, -0.36],
+       [ 0.16, -0.12,  0.04]])
+>>> linalg.inv(A)
+array([[-1.48,  0.36,  0.88],
+       [ 0.56,  0.08, -0.36],
+       [ 0.16, -0.12,  0.04]])

Copied: scipy-docs/trunk/source/tutorial/examples/10-2-2 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/10.2.2)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.2.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10-2-2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,10 @@
+>>> A = mat('[1 3 5; 2 5 1; 2 3 8]')
+>>> b = mat('[10;8;3]')
+>>> A.I*b
+Matrix([[-9.28],
+       [ 5.16],
+       [ 0.76]])
+>>> linalg.solve(A,b)
+array([[-9.28],
+       [ 5.16],
+       [ 0.76]])

Copied: scipy-docs/trunk/source/tutorial/examples/10-2-3 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/10.2.3)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.2.3	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10-2-3	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,4 @@
+>>> A = mat('[1 3 5; 2 5 1; 2 3 8]')
+>>> linalg.det(A)
+-25.000000000000004
+        

Copied: scipy-docs/trunk/source/tutorial/examples/10-2-5 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/10.2.5)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.2.5	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10-2-5	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,21 @@
+from numpy import *
+from scipy import linalg
+import matplotlib.pyplot as plt
+
+c1,c2= 5.0,2.0
+i = r_[1:11]
+xi = 0.1*i
+yi = c1*exp(-xi)+c2*xi
+zi = yi + 0.05*max(yi)*random.randn(len(yi))
+
+A = c_[exp(-xi)[:,newaxis],xi[:,newaxis]]
+c,resid,rank,sigma = linalg.lstsq(A,zi)
+
+xi2 = r_[0.1:1.0:100j]
+yi2 = c[0]*exp(-xi2) + c[1]*xi2
+
+plt.plot(xi,zi,'x',xi2,yi2)
+plt.axis([0,1.1,3.0,5.5])
+plt.xlabel('$x_i$')
+plt.title('Data fitting with linalg.lstsq')
+plt.show()

Copied: scipy-docs/trunk/source/tutorial/examples/10-3-1 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/10.3.1)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.3.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10-3-1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,18 @@
+>>> A = mat('[1 5 2; 2 4 1; 3 6 2]')
+>>> la,v = linalg.eig(A)
+>>> l1,l2,l3 = la
+>>> print l1, l2, l3
+(7.95791620491+0j) (-1.25766470568+0j) (0.299748500767+0j)
+
+>>> print v[:,0]
+array([-0.5297, -0.4494, -0.7193])
+>>> print v[:,1]
+[-0.9073  0.2866  0.3076]
+>>> print v[:,2]
+[ 0.2838 -0.3901  0.8759]
+>>> print sum(abs(v**2),axis=0)
+[ 1.  1.  1.]
+
+>>> v1 = mat(v[:,0]).T
+>>> print max(ravel(abs(A*v1-l1*v1)))
+4.4408920985e-16

Copied: scipy-docs/trunk/source/tutorial/examples/10-3-2 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/10.3.2)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.3.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10-3-2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,22 @@
+>>> A = mat('[1 3 2; 1 2 3]')
+>>> M,N = A.shape
+>>> U,s,Vh = linalg.svd(A)
+>>> Sig = mat(diagsvd(s,M,N))
+>>> U, Vh = mat(U), mat(Vh)
+>>> print U
+Matrix([[-0.7071, -0.7071],
+       [-0.7071,  0.7071]])
+>>> print Sig
+Matrix([[ 5.1962,  0.    ,  0.    ],
+       [ 0.    ,  1.    ,  0.    ]])
+>>> print Vh
+Matrix([[-0.2722, -0.6804, -0.6804],
+       [-0.    , -0.7071,  0.7071],
+       [-0.9623,  0.1925,  0.1925]])
+
+>>> print A
+Matrix([[1, 3, 2],
+       [1, 2, 3]])
+>>> print U*Sig*Vh
+Matrix([[ 1.,  3.,  2.],
+       [ 1.,  2.,  3.]])

Copied: scipy-docs/trunk/source/tutorial/examples/10-3-6 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/10.3.6)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.3.6	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10-3-6	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,36 @@
+>>> A = mat('[1 3 2; 1 4 5; 2 3 6]')
+>>> T,Z = linalg.schur(A)
+>>> T1,Z1 = linalg.schur(A,'complex')
+>>> T2,Z2 = linalg.rsf2csf(T,Z)
+>>> print T
+Matrix([[ 9.9001,  1.7895, -0.655 ],
+       [ 0.    ,  0.5499, -1.5775],
+       [ 0.    ,  0.5126,  0.5499]])
+>>> print T2
+Matrix([[ 9.9001+0.j    , -0.3244+1.5546j, -0.8862+0.569j ],
+       [ 0.    +0.j    ,  0.5499+0.8993j,  1.0649-0.j    ],
+       [ 0.    +0.j    ,  0.    +0.j    ,  0.5499-0.8993j]])
+>>> print abs(T1-T2) # different
+[[ 0.      2.1184  0.1949]
+ [ 0.      0.      1.2676]
+ [ 0.      0.      0.    ]]
+>>> print abs(Z1-Z2) # different
+[[ 0.0683  1.1175  0.1973]
+ [ 0.1186  0.5644  0.247 ]
+ [ 0.1262  0.7645  0.1916]]
+>>> T,Z,T1,Z1,T2,Z2 = map(mat,(T,Z,T1,Z1,T2,Z2))
+>>> print abs(A-Z*T*Z.H)
+Matrix([[ 0.,  0.,  0.],
+       [ 0.,  0.,  0.],
+       [ 0.,  0.,  0.]])
+>>> print abs(A-Z1*T1*Z1.H)
+Matrix([[ 0.,  0.,  0.],
+       [ 0.,  0.,  0.],
+       [ 0.,  0.,  0.]])
+>>> print abs(A-Z2*T2*Z2.H)
+Matrix([[ 0.,  0.,  0.],
+       [ 0.,  0.,  0.],
+       [ 0.,  0.,  0.]])
+
+
+

Copied: scipy-docs/trunk/source/tutorial/examples/10-4-4 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/10.4.4)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.4.4	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10-4-4	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,10 @@
+>>> A = rand(3,3)
+>>> B = linalg.funm(A,lambda x: special.jv(0,real(x)))
+>>> print A
+[[ 0.0593  0.5612  0.4403]
+ [ 0.8797  0.2556  0.1452]
+ [ 0.964   0.9666  0.1243]]
+>>> print B
+[[ 0.8206 -0.1212 -0.0612]
+ [-0.1323  0.8256 -0.0627]
+ [-0.2073 -0.1946  0.8516]]

Deleted: scipy-docs/trunk/source/tutorial/examples/10.2.1
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.2.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10.2.1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,13 +0,0 @@
->>> A = mat('[1 3 5; 2 5 1; 2 3 8]')
->>> A
-Matrix([[1, 3, 5],
-       [2, 5, 1],
-       [2, 3, 8]])
->>> A.I
-Matrix([[-1.48,  0.36,  0.88],
-       [ 0.56,  0.08, -0.36],
-       [ 0.16, -0.12,  0.04]])
->>> linalg.inv(A)
-array([[-1.48,  0.36,  0.88],
-       [ 0.56,  0.08, -0.36],
-       [ 0.16, -0.12,  0.04]])

Deleted: scipy-docs/trunk/source/tutorial/examples/10.2.2
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.2.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10.2.2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,10 +0,0 @@
->>> A = mat('[1 3 5; 2 5 1; 2 3 8]')
->>> b = mat('[10;8;3]')
->>> A.I*b
-Matrix([[-9.28],
-       [ 5.16],
-       [ 0.76]])
->>> linalg.solve(A,b)
-array([[-9.28],
-       [ 5.16],
-       [ 0.76]])

Deleted: scipy-docs/trunk/source/tutorial/examples/10.2.3
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.2.3	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10.2.3	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,4 +0,0 @@
->>> A = mat('[1 3 5; 2 5 1; 2 3 8]')
->>> linalg.det(A)
--25.000000000000004
-        

Deleted: scipy-docs/trunk/source/tutorial/examples/10.2.5
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.2.5	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10.2.5	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,21 +0,0 @@
-from numpy import *
-from scipy import linalg
-import matplotlib.pyplot as plt
-
-c1,c2= 5.0,2.0
-i = r_[1:11]
-xi = 0.1*i
-yi = c1*exp(-xi)+c2*xi
-zi = yi + 0.05*max(yi)*random.randn(len(yi))
-
-A = c_[exp(-xi)[:,newaxis],xi[:,newaxis]]
-c,resid,rank,sigma = linalg.lstsq(A,zi)
-
-xi2 = r_[0.1:1.0:100j]
-yi2 = c[0]*exp(-xi2) + c[1]*xi2
-
-plt.plot(xi,zi,'x',xi2,yi2)
-plt.axis([0,1.1,3.0,5.5])
-plt.xlabel('$x_i$')
-plt.title('Data fitting with linalg.lstsq')
-plt.show()

Deleted: scipy-docs/trunk/source/tutorial/examples/10.3.1
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.3.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10.3.1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,18 +0,0 @@
->>> A = mat('[1 5 2; 2 4 1; 3 6 2]')
->>> la,v = linalg.eig(A)
->>> l1,l2,l3 = la
->>> print l1, l2, l3
-(7.95791620491+0j) (-1.25766470568+0j) (0.299748500767+0j)
-
->>> print v[:,0]
-array([-0.5297, -0.4494, -0.7193])
->>> print v[:,1]
-[-0.9073  0.2866  0.3076]
->>> print v[:,2]
-[ 0.2838 -0.3901  0.8759]
->>> print sum(abs(v**2),axis=0)
-[ 1.  1.  1.]
-
->>> v1 = mat(v[:,0]).T
->>> print max(ravel(abs(A*v1-l1*v1)))
-4.4408920985e-16

Deleted: scipy-docs/trunk/source/tutorial/examples/10.3.2
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.3.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10.3.2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,22 +0,0 @@
->>> A = mat('[1 3 2; 1 2 3]')
->>> M,N = A.shape
->>> U,s,Vh = linalg.svd(A)
->>> Sig = mat(diagsvd(s,M,N))
->>> U, Vh = mat(U), mat(Vh)
->>> print U
-Matrix([[-0.7071, -0.7071],
-       [-0.7071,  0.7071]])
->>> print Sig
-Matrix([[ 5.1962,  0.    ,  0.    ],
-       [ 0.    ,  1.    ,  0.    ]])
->>> print Vh
-Matrix([[-0.2722, -0.6804, -0.6804],
-       [-0.    , -0.7071,  0.7071],
-       [-0.9623,  0.1925,  0.1925]])
-
->>> print A
-Matrix([[1, 3, 2],
-       [1, 2, 3]])
->>> print U*Sig*Vh
-Matrix([[ 1.,  3.,  2.],
-       [ 1.,  2.,  3.]])

Deleted: scipy-docs/trunk/source/tutorial/examples/10.3.6
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.3.6	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10.3.6	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,36 +0,0 @@
->>> A = mat('[1 3 2; 1 4 5; 2 3 6]')
->>> T,Z = linalg.schur(A)
->>> T1,Z1 = linalg.schur(A,'complex')
->>> T2,Z2 = linalg.rsf2csf(T,Z)
->>> print T
-Matrix([[ 9.9001,  1.7895, -0.655 ],
-       [ 0.    ,  0.5499, -1.5775],
-       [ 0.    ,  0.5126,  0.5499]])
->>> print T2
-Matrix([[ 9.9001+0.j    , -0.3244+1.5546j, -0.8862+0.569j ],
-       [ 0.    +0.j    ,  0.5499+0.8993j,  1.0649-0.j    ],
-       [ 0.    +0.j    ,  0.    +0.j    ,  0.5499-0.8993j]])
->>> print abs(T1-T2) # different
-[[ 0.      2.1184  0.1949]
- [ 0.      0.      1.2676]
- [ 0.      0.      0.    ]]
->>> print abs(Z1-Z2) # different
-[[ 0.0683  1.1175  0.1973]
- [ 0.1186  0.5644  0.247 ]
- [ 0.1262  0.7645  0.1916]]
->>> T,Z,T1,Z1,T2,Z2 = map(mat,(T,Z,T1,Z1,T2,Z2))
->>> print abs(A-Z*T*Z.H)
-Matrix([[ 0.,  0.,  0.],
-       [ 0.,  0.,  0.],
-       [ 0.,  0.,  0.]])
->>> print abs(A-Z1*T1*Z1.H)
-Matrix([[ 0.,  0.,  0.],
-       [ 0.,  0.,  0.],
-       [ 0.,  0.,  0.]])
->>> print abs(A-Z2*T2*Z2.H)
-Matrix([[ 0.,  0.,  0.],
-       [ 0.,  0.,  0.],
-       [ 0.,  0.,  0.]])
-
-
-

Deleted: scipy-docs/trunk/source/tutorial/examples/10.4.4
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/10.4.4	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/10.4.4	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,10 +0,0 @@
->>> A = rand(3,3)
->>> B = linalg.funm(A,lambda x: special.jv(0,real(x)))
->>> print A
-[[ 0.0593  0.5612  0.4403]
- [ 0.8797  0.2556  0.1452]
- [ 0.964   0.9666  0.1243]]
->>> print B
-[[ 0.8206 -0.1212 -0.0612]
- [-0.1323  0.8256 -0.0627]
- [-0.2073 -0.1946  0.8516]]

Copied: scipy-docs/trunk/source/tutorial/examples/2-1 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/2.1)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/2.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/2-1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,20 @@
+>>> mgrid[0:5,0:5]
+array([[[0, 0, 0, 0, 0],
+        [1, 1, 1, 1, 1],
+        [2, 2, 2, 2, 2],
+        [3, 3, 3, 3, 3],
+        [4, 4, 4, 4, 4]],
+       [[0, 1, 2, 3, 4],
+        [0, 1, 2, 3, 4],
+        [0, 1, 2, 3, 4],
+        [0, 1, 2, 3, 4],
+        [0, 1, 2, 3, 4]]])  
+>>> mgrid[0:5:4j,0:5:4j]
+array([[[ 0.    ,  0.    ,  0.    ,  0.    ],
+        [ 1.6667,  1.6667,  1.6667,  1.6667],
+        [ 3.3333,  3.3333,  3.3333,  3.3333],
+        [ 5.    ,  5.    ,  5.    ,  5.    ]],
+       [[ 0.    ,  1.6667,  3.3333,  5.    ],
+        [ 0.    ,  1.6667,  3.3333,  5.    ],
+        [ 0.    ,  1.6667,  3.3333,  5.    ],
+        [ 0.    ,  1.6667,  3.3333,  5.    ]]])

Copied: scipy-docs/trunk/source/tutorial/examples/2-2 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/2.2)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/2.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/2-2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,14 @@
+>>> p = poly1d([3,4,5])
+>>> print p
+   2
+3 x + 4 x + 5
+>>> print p*p
+   4      3      2
+9 x + 24 x + 46 x + 40 x + 25
+>>> print p.integ(k=6)
+ 3     2
+x + 2 x + 5 x + 6
+>>> print p.deriv()
+6 x + 4
+>>> p([4,5])
+array([ 69, 100])
\ No newline at end of file

Copied: scipy-docs/trunk/source/tutorial/examples/2-3 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/2.3)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/2.3	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/2-3	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,6 @@
+>>> x = r_[-2:3]
+>>> x
+array([-2, -1,  0,  1,  2])
+>>> select([x > 3, x >= 0],[0,x+2])
+array([0, 0, 2, 3, 4])
+

Deleted: scipy-docs/trunk/source/tutorial/examples/2.1
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/2.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/2.1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,20 +0,0 @@
->>> mgrid[0:5,0:5]
-array([[[0, 0, 0, 0, 0],
-        [1, 1, 1, 1, 1],
-        [2, 2, 2, 2, 2],
-        [3, 3, 3, 3, 3],
-        [4, 4, 4, 4, 4]],
-       [[0, 1, 2, 3, 4],
-        [0, 1, 2, 3, 4],
-        [0, 1, 2, 3, 4],
-        [0, 1, 2, 3, 4],
-        [0, 1, 2, 3, 4]]])  
->>> mgrid[0:5:4j,0:5:4j]
-array([[[ 0.    ,  0.    ,  0.    ,  0.    ],
-        [ 1.6667,  1.6667,  1.6667,  1.6667],
-        [ 3.3333,  3.3333,  3.3333,  3.3333],
-        [ 5.    ,  5.    ,  5.    ,  5.    ]],
-       [[ 0.    ,  1.6667,  3.3333,  5.    ],
-        [ 0.    ,  1.6667,  3.3333,  5.    ],
-        [ 0.    ,  1.6667,  3.3333,  5.    ],
-        [ 0.    ,  1.6667,  3.3333,  5.    ]]])

Deleted: scipy-docs/trunk/source/tutorial/examples/2.2
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/2.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/2.2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,14 +0,0 @@
->>> p = poly1d([3,4,5])
->>> print p
-   2
-3 x + 4 x + 5
->>> print p*p
-   4      3      2
-9 x + 24 x + 46 x + 40 x + 25
->>> print p.integ(k=6)
- 3     2
-x + 2 x + 5 x + 6
->>> print p.deriv()
-6 x + 4
->>> p([4,5])
-array([ 69, 100])
\ No newline at end of file

Deleted: scipy-docs/trunk/source/tutorial/examples/2.3
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/2.3	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/2.3	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,6 +0,0 @@
->>> x = r_[-2:3]
->>> x
-array([-2, -1,  0,  1,  2])
->>> select([x > 3, x >= 0],[0,x+2])
-array([0, 0, 2, 3, 4])
-

Copied: scipy-docs/trunk/source/tutorial/examples/3-1 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/3.1)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/3.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/3-1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,5 @@
+>>> def addsubtract(a,b):
+    if a > b:
+        return a - b
+    else:
+        return a + b

Copied: scipy-docs/trunk/source/tutorial/examples/3-2 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/3.2)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/3.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/3-2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,2 @@
+>>> vec_addsubtract([0,3,6,9],[1,3,5,7])
+array([1, 6, 1, 2])

Deleted: scipy-docs/trunk/source/tutorial/examples/3.1
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/3.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/3.1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,5 +0,0 @@
->>> def addsubtract(a,b):
-    if a > b:
-        return a - b
-    else:
-        return a + b

Deleted: scipy-docs/trunk/source/tutorial/examples/3.2
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/3.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/3.2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,2 +0,0 @@
->>> vec_addsubtract([0,3,6,9],[1,3,5,7])
-array([1, 6, 1, 2])

Copied: scipy-docs/trunk/source/tutorial/examples/4-1 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/4.1)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4-1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,13 @@
+>>> help(integrate)
+Methods for Integrating Functions
+
+  odeint        -- Integrate ordinary differential equations.
+  quad          -- General purpose integration.
+  dblquad       -- General purpose double integration.
+  tplquad       -- General purpose triple integration.
+  gauss_quad    -- Integrate func(x) using Gaussian quadrature of order n.
+  gauss_quadtol -- Integrate with given tolerance using Gaussian quadrature.
+
+  See the orthogonal module (integrate.orthogonal) for Gaussian
+     quadrature roots and weights.
+

Copied: scipy-docs/trunk/source/tutorial/examples/4-2 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/4.2)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4-2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,11 @@
+>>> result = integrate.quad(lambda x: special.jv(2.5,x), 0, 4.5)
+>>> print result
+(1.1178179380783249, 7.8663172481899801e-09)
+
+>>> I = sqrt(2/pi)*(18.0/27*sqrt(2)*cos(4.5)-4.0/27*sqrt(2)*sin(4.5)+
+    sqrt(2*pi)*special.fresnl(3/sqrt(pi))[0])
+>>> print I
+1.117817938088701
+
+>>> print abs(result[0]-I)
+1.03761443881e-11 

Copied: scipy-docs/trunk/source/tutorial/examples/4-3 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/4.3)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.3	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4-3	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,13 @@
+>>> from integrate import quad, Inf
+>>> def integrand(t,n,x):
+        return exp(-x*t) / t**n
+
+>>> def expint(n,x): 
+        return quad(integrand, 1, Inf, args=(n, x))[0]
+
+>>> vec_expint = vectorize(expint)
+
+>>> vec_expint(3,arange(1.0,4.0,0.5))
+array([ 0.1097,  0.0567,  0.0301,  0.0163,  0.0089,  0.0049])
+>>> special.expn(3,arange(1.0,4.0,0.5))
+array([ 0.1097,  0.0567,  0.0301,  0.0163,  0.0089,  0.0049])

Copied: scipy-docs/trunk/source/tutorial/examples/4-4 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/4.4)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.4	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4-4	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,10 @@
+>>> result = quad(lambda x: expint(3, x), 0, Inf)
+>>> print result
+(0.33333333324560266, 2.8548934485373678e-09)  
+
+>>> I3 = 1.0/3.0
+>>> print I3
+0.333333333333   
+
+>>> print I3 - result[0]
+8.77306560731e-11     

Copied: scipy-docs/trunk/source/tutorial/examples/4-5 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/4.5)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.5	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4-5	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,11 @@
+>>> from __future__ import nested_scopes
+>>> from integrate import quad, dblquad, Inf
+>>> def I(n):
+    return dblquad(lambda t, x: exp(-x*t)/t**n, 0, Inf, lambda x: 1, lambda x: Inf) 
+
+>>> print I(4)
+(0.25000000000435768, 1.0518245707751597e-09)
+>>> print I(3)
+(0.33333333325010883, 2.8604069919261191e-09) 
+>>> print I(2)
+(0.49999999999857514, 1.8855523253868967e-09)

Copied: scipy-docs/trunk/source/tutorial/examples/4-6 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/4.6)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.6	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4-6	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,27 @@
+>>> from integrate import odeint
+>>> from special import gamma, airy
+>>> y1_0 = 1.0/3**(2.0/3.0)/gamma(2.0/3.0)
+>>> y0_0 = -1.0/3**(1.0/3.0)/gamma(1.0/3.0)
+>>> y0 = [y0_0, y1_0]
+>>> def func(y, t):
+        return [t*y[1],y[0]]
+
+>>> def gradient(y,t):
+        return [[0,t],[1,0]]
+
+>>> x = arange(0,4.0, 0.01)
+>>> t = x
+>>> ychk = airy(x)[0]
+>>> y = odeint(func, y0, t)
+>>> y2 = odeint(func, y0, t, Dfun=gradient)
+
+>>> import sys
+>>> sys.float_output_precision = 6
+>>> print ychk[:36:6]
+[ 0.355028  0.339511  0.324068  0.308763  0.293658  0.278806]
+
+>>> print y[:36:6,1]
+[ 0.355028  0.339511  0.324067  0.308763  0.293658  0.278806]
+
+>>> print y2[:36:6,1]
+[ 0.355028  0.339511  0.324067  0.308763  0.293658  0.278806]

Deleted: scipy-docs/trunk/source/tutorial/examples/4.1
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4.1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,13 +0,0 @@
->>> help(integrate)
-Methods for Integrating Functions
-
-  odeint        -- Integrate ordinary differential equations.
-  quad          -- General purpose integration.
-  dblquad       -- General purpose double integration.
-  tplquad       -- General purpose triple integration.
-  gauss_quad    -- Integrate func(x) using Gaussian quadrature of order n.
-  gauss_quadtol -- Integrate with given tolerance using Gaussian quadrature.
-
-  See the orthogonal module (integrate.orthogonal) for Gaussian
-     quadrature roots and weights.
-

Deleted: scipy-docs/trunk/source/tutorial/examples/4.2
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4.2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,11 +0,0 @@
->>> result = integrate.quad(lambda x: special.jv(2.5,x), 0, 4.5)
->>> print result
-(1.1178179380783249, 7.8663172481899801e-09)
-
->>> I = sqrt(2/pi)*(18.0/27*sqrt(2)*cos(4.5)-4.0/27*sqrt(2)*sin(4.5)+
-    sqrt(2*pi)*special.fresnl(3/sqrt(pi))[0])
->>> print I
-1.117817938088701
-
->>> print abs(result[0]-I)
-1.03761443881e-11 

Deleted: scipy-docs/trunk/source/tutorial/examples/4.3
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.3	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4.3	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,13 +0,0 @@
->>> from integrate import quad, Inf
->>> def integrand(t,n,x):
-        return exp(-x*t) / t**n
-
->>> def expint(n,x): 
-        return quad(integrand, 1, Inf, args=(n, x))[0]
-
->>> vec_expint = vectorize(expint)
-
->>> vec_expint(3,arange(1.0,4.0,0.5))
-array([ 0.1097,  0.0567,  0.0301,  0.0163,  0.0089,  0.0049])
->>> special.expn(3,arange(1.0,4.0,0.5))
-array([ 0.1097,  0.0567,  0.0301,  0.0163,  0.0089,  0.0049])

Deleted: scipy-docs/trunk/source/tutorial/examples/4.4
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.4	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4.4	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,10 +0,0 @@
->>> result = quad(lambda x: expint(3, x), 0, Inf)
->>> print result
-(0.33333333324560266, 2.8548934485373678e-09)  
-
->>> I3 = 1.0/3.0
->>> print I3
-0.333333333333   
-
->>> print I3 - result[0]
-8.77306560731e-11     

Deleted: scipy-docs/trunk/source/tutorial/examples/4.5
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.5	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4.5	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,11 +0,0 @@
->>> from __future__ import nested_scopes
->>> from integrate import quad, dblquad, Inf
->>> def I(n):
-    return dblquad(lambda t, x: exp(-x*t)/t**n, 0, Inf, lambda x: 1, lambda x: Inf) 
-
->>> print I(4)
-(0.25000000000435768, 1.0518245707751597e-09)
->>> print I(3)
-(0.33333333325010883, 2.8604069919261191e-09) 
->>> print I(2)
-(0.49999999999857514, 1.8855523253868967e-09)

Deleted: scipy-docs/trunk/source/tutorial/examples/4.6
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/4.6	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/4.6	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,27 +0,0 @@
->>> from integrate import odeint
->>> from special import gamma, airy
->>> y1_0 = 1.0/3**(2.0/3.0)/gamma(2.0/3.0)
->>> y0_0 = -1.0/3**(1.0/3.0)/gamma(1.0/3.0)
->>> y0 = [y0_0, y1_0]
->>> def func(y, t):
-        return [t*y[1],y[0]]
-
->>> def gradient(y,t):
-        return [[0,t],[1,0]]
-
->>> x = arange(0,4.0, 0.01)
->>> t = x
->>> ychk = airy(x)[0]
->>> y = odeint(func, y0, t)
->>> y2 = odeint(func, y0, t, Dfun=gradient)
-
->>> import sys
->>> sys.float_output_precision = 6
->>> print ychk[:36:6]
-[ 0.355028  0.339511  0.324068  0.308763  0.293658  0.278806]
-
->>> print y[:36:6,1]
-[ 0.355028  0.339511  0.324067  0.308763  0.293658  0.278806]
-
->>> print y2[:36:6,1]
-[ 0.355028  0.339511  0.324067  0.308763  0.293658  0.278806]

Copied: scipy-docs/trunk/source/tutorial/examples/5-1 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/5.1)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5-1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,37 @@
+>>> info(optimize)
+ Optimization Tools
+
+A collection of general-purpose optimization routines.
+
+  fmin        --  Nelder-Mead Simplex algorithm
+                    (uses only function calls)
+  fmin_powell --  Powell's (modified) level set method (uses only 
+                    function calls)
+  fmin_bfgs   --  Quasi-Newton method (can use function and gradient)
+  fmin_ncg    --  Line-search Newton Conjugate Gradient (can use
+                    function, gradient and hessian).
+  leastsq     --  Minimize the sum of squares of M equations in
+                    N unknowns given a starting estimate.
+
+ Scalar function minimizers
+
+  fminbound   --  Bounded minimization of a scalar function.
+  brent       --  1-D function minimization using Brent method.
+  golden      --  1-D function minimization using Golden Section method
+  bracket     --  Bracket a minimum (given two starting points)
+ 
+Also a collection of general_purpose root-finding routines.
+
+  fsolve      --  Non-linear multi-variable equation solver.
+
+ Scalar function solvers
+
+  brentq      --  quadratic interpolation Brent method
+  brenth      --  Brent method (modified by Harris with
+                    hyperbolic extrapolation)
+  ridder      --  Ridder's method
+  bisect      --  Bisection method
+  newton      --  Secant method or Newton's method
+
+  fixed_point -- Single-variable fixed-point solver.
+

Copied: scipy-docs/trunk/source/tutorial/examples/5-2 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/5.2)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5-2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,13 @@
+>>> from scipy.optimize import fmin
+>>> def rosen(x):  # The Rosenbrock function
+        return sum(100.0*(x[1:]-x[:-1]**2.0)**2.0 + (1-x[:-1])**2.0)
+
+>>> x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
+>>> xopt = fmin(rosen, x0)
+Optimization terminated successfully.
+         Current function value: 0.000000
+         Iterations: 516
+         Function evaluations: 825
+
+>>> print xopt
+[ 1.  1.  1.  1.  1.]

Copied: scipy-docs/trunk/source/tutorial/examples/5-3 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/5.3)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.3	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5-3	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,10 @@
+>>> def rosen_der(x):
+        xm = x[1:-1]
+        xm_m1 = x[:-2]
+        xm_p1 = x[2:]
+        der = zeros(x.shape,x.typecode())
+        der[1:-1] = 200*(xm-xm_m1**2) - 400*(xm_p1 - xm**2)*xm - 2*(1-xm)
+        der[0] = -400*x[0]*(x[1]-x[0]**2) - 2*(1-x[0])
+        der[-1] = 200*(x[-1]-x[-2]**2)
+        return der
+

Copied: scipy-docs/trunk/source/tutorial/examples/5-4 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/5.4)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.4	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5-4	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,11 @@
+>>> from scipy.optimize import fmin_bfgs
+
+>>> x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
+>>> xopt = fmin_bfgs(rosen, x0, fprime=rosen_der)
+Optimization terminated successfully.
+         Current function value: 0.000000
+         Iterations: 109
+         Function evaluations: 262
+         Gradient evaluations: 110
+>>> print xopt
+[ 1.  1.  1.  1.  1.]                                                                       

Copied: scipy-docs/trunk/source/tutorial/examples/5-5 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/5.5)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.5	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5-5	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,21 @@
+>>> from scipy.optimize import fmin_ncg
+>>> def rosen_hess(x):
+        x = asarray(x)
+        H = diag(-400*x[:-1],1) - diag(400*x[:-1],-1)
+        diagonal = zeros(len(x),x.typecode())
+        diagonal[0] = 1200*x[0]-400*x[1]+2
+        diagonal[-1] = 200
+        diagonal[1:-1] = 202 + 1200*x[1:-1]**2 - 400*x[2:]
+        H = H + diag(diagonal)
+        return H
+
+>>> x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
+>>> xopt = fmin_ncg(rosen, x0, rosen_der, fhess=rosen_hess)
+Optimization terminated successfully.
+         Current function value: 0.000000
+         Iterations: 19
+         Function evaluations: 40
+         Gradient evaluations: 19
+         Hessian evaluations: 19
+>>> print xopt
+[ 0.9999  0.9999  0.9998  0.9996  0.9991]

Copied: scipy-docs/trunk/source/tutorial/examples/5-6 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/5.6)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.6	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5-6	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,20 @@
+>>> from scipy.optimize import fmin_ncg
+>>> def rosen_hess_p(x,p):
+        x = asarray(x)
+        Hp = zeros(len(x),x.typecode())
+        Hp[0] = (1200*x[0]**2 - 400*x[1] + 2)*p[0] - 400*x[0]*p[1]
+        Hp[1:-1] = -400*x[:-2]*p[:-2]+(202+1200*x[1:-1]**2-400*x[2:])*p[1:-1] \
+                   -400*x[1:-1]*p[2:]
+        Hp[-1] = -400*x[-2]*p[-2] + 200*p[-1]
+        return Hp
+
+>>> x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
+>>> xopt = fmin_ncg(rosen, x0, rosen_der, fhess_p=rosen_hess_p)
+Optimization terminated successfully.
+         Current function value: 0.000000
+         Iterations: 20
+         Function evaluations: 42
+         Gradient evaluations: 20
+         Hessian evaluations: 44
+>>> print xopt
+[ 1.      1.      1.      0.9999  0.9999]

Copied: scipy-docs/trunk/source/tutorial/examples/5-7 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/5.7)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.7	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5-7	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,31 @@
+>>> from numpy import *
+>>> x = arange(0,6e-2,6e-2/30)
+>>> A,k,theta = 10, 1.0/3e-2, pi/6
+>>> y_true = A*sin(2*pi*k*x+theta)
+>>> y_meas = y_true + 2*random.randn(len(x))
+
+>>> def residuals(p, y, x):
+...     A,k,theta = p
+...     err = y-A*sin(2*pi*k*x+theta)
+...     return err
+
+>>> def peval(x, p):
+...     return p[0]*sin(2*pi*p[1]*x+p[2])
+
+>>> p0 = [8, 1/2.3e-2, pi/3]
+>>> print array(p0)
+[  8.      43.4783   1.0472]
+
+>>> from scipy.optimize import leastsq
+>>> plsq = leastsq(residuals, p0, args=(y_meas, x))
+>>> print plsq[0]
+[ 10.9437  33.3605   0.5834]
+
+>>> print array([A, k, theta])
+[ 10.      33.3333   0.5236]
+
+>>> import matplotlib.pyplot as plt
+>>> plt.plot(x,peval(x,plsq[0]),x,y_meas,'o',x,y_true)
+>>> plt.title('Least-squares fit to noisy data')
+>>> plt.legend(['Fit', 'Noisy', 'True'])
+>>> plt.show()

Copied: scipy-docs/trunk/source/tutorial/examples/5-8 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/5.8)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.8	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5-8	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,7 @@
+>>> from scipy.special import j1
+
+>>> from scipy.optimize import fminbound
+>>> xmin = fminbound(j1, 4, 7)
+>>> print xmin
+5.33144184241
+

Copied: scipy-docs/trunk/source/tutorial/examples/5-9 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/5.9)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.9	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5-9	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,16 @@
+>>> def func(x):
+        return x + 2*cos(x)
+
+>>> def func2(x):
+        out = [x[0]*cos(x[1]) - 4]
+        out.append(x[1]*x[0] - x[1] - 5)
+        return out
+
+>>> from optimize import fsolve
+>>> x0 = fsolve(func, 0.3)
+>>> print x0
+-1.02986652932
+
+>>> x02 = fsolve(func2, [1, 1])
+>>> print x02
+[ 6.5041  0.9084]

Deleted: scipy-docs/trunk/source/tutorial/examples/5.1
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5.1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,37 +0,0 @@
->>> info(optimize)
- Optimization Tools
-
-A collection of general-purpose optimization routines.
-
-  fmin        --  Nelder-Mead Simplex algorithm
-                    (uses only function calls)
-  fmin_powell --  Powell's (modified) level set method (uses only 
-                    function calls)
-  fmin_bfgs   --  Quasi-Newton method (can use function and gradient)
-  fmin_ncg    --  Line-search Newton Conjugate Gradient (can use
-                    function, gradient and hessian).
-  leastsq     --  Minimize the sum of squares of M equations in
-                    N unknowns given a starting estimate.
-
- Scalar function minimizers
-
-  fminbound   --  Bounded minimization of a scalar function.
-  brent       --  1-D function minimization using Brent method.
-  golden      --  1-D function minimization using Golden Section method
-  bracket     --  Bracket a minimum (given two starting points)
- 
-Also a collection of general_purpose root-finding routines.
-
-  fsolve      --  Non-linear multi-variable equation solver.
-
- Scalar function solvers
-
-  brentq      --  quadratic interpolation Brent method
-  brenth      --  Brent method (modified by Harris with
-                    hyperbolic extrapolation)
-  ridder      --  Ridder's method
-  bisect      --  Bisection method
-  newton      --  Secant method or Newton's method
-
-  fixed_point -- Single-variable fixed-point solver.
-

Deleted: scipy-docs/trunk/source/tutorial/examples/5.2
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5.2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,13 +0,0 @@
->>> from scipy.optimize import fmin
->>> def rosen(x):  # The Rosenbrock function
-        return sum(100.0*(x[1:]-x[:-1]**2.0)**2.0 + (1-x[:-1])**2.0)
-
->>> x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
->>> xopt = fmin(rosen, x0)
-Optimization terminated successfully.
-         Current function value: 0.000000
-         Iterations: 516
-         Function evaluations: 825
-
->>> print xopt
-[ 1.  1.  1.  1.  1.]

Deleted: scipy-docs/trunk/source/tutorial/examples/5.3
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.3	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5.3	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,10 +0,0 @@
->>> def rosen_der(x):
-        xm = x[1:-1]
-        xm_m1 = x[:-2]
-        xm_p1 = x[2:]
-        der = zeros(x.shape,x.typecode())
-        der[1:-1] = 200*(xm-xm_m1**2) - 400*(xm_p1 - xm**2)*xm - 2*(1-xm)
-        der[0] = -400*x[0]*(x[1]-x[0]**2) - 2*(1-x[0])
-        der[-1] = 200*(x[-1]-x[-2]**2)
-        return der
-

Deleted: scipy-docs/trunk/source/tutorial/examples/5.4
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.4	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5.4	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,11 +0,0 @@
->>> from scipy.optimize import fmin_bfgs
-
->>> x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
->>> xopt = fmin_bfgs(rosen, x0, fprime=rosen_der)
-Optimization terminated successfully.
-         Current function value: 0.000000
-         Iterations: 109
-         Function evaluations: 262
-         Gradient evaluations: 110
->>> print xopt
-[ 1.  1.  1.  1.  1.]                                                                       

Deleted: scipy-docs/trunk/source/tutorial/examples/5.5
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.5	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5.5	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,21 +0,0 @@
->>> from scipy.optimize import fmin_ncg
->>> def rosen_hess(x):
-        x = asarray(x)
-        H = diag(-400*x[:-1],1) - diag(400*x[:-1],-1)
-        diagonal = zeros(len(x),x.typecode())
-        diagonal[0] = 1200*x[0]-400*x[1]+2
-        diagonal[-1] = 200
-        diagonal[1:-1] = 202 + 1200*x[1:-1]**2 - 400*x[2:]
-        H = H + diag(diagonal)
-        return H
-
->>> x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
->>> xopt = fmin_ncg(rosen, x0, rosen_der, fhess=rosen_hess)
-Optimization terminated successfully.
-         Current function value: 0.000000
-         Iterations: 19
-         Function evaluations: 40
-         Gradient evaluations: 19
-         Hessian evaluations: 19
->>> print xopt
-[ 0.9999  0.9999  0.9998  0.9996  0.9991]

Deleted: scipy-docs/trunk/source/tutorial/examples/5.6
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.6	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5.6	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,20 +0,0 @@
->>> from scipy.optimize import fmin_ncg
->>> def rosen_hess_p(x,p):
-        x = asarray(x)
-        Hp = zeros(len(x),x.typecode())
-        Hp[0] = (1200*x[0]**2 - 400*x[1] + 2)*p[0] - 400*x[0]*p[1]
-        Hp[1:-1] = -400*x[:-2]*p[:-2]+(202+1200*x[1:-1]**2-400*x[2:])*p[1:-1] \
-                   -400*x[1:-1]*p[2:]
-        Hp[-1] = -400*x[-2]*p[-2] + 200*p[-1]
-        return Hp
-
->>> x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
->>> xopt = fmin_ncg(rosen, x0, rosen_der, fhess_p=rosen_hess_p)
-Optimization terminated successfully.
-         Current function value: 0.000000
-         Iterations: 20
-         Function evaluations: 42
-         Gradient evaluations: 20
-         Hessian evaluations: 44
->>> print xopt
-[ 1.      1.      1.      0.9999  0.9999]

Deleted: scipy-docs/trunk/source/tutorial/examples/5.7
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.7	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5.7	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,31 +0,0 @@
->>> from numpy import *
->>> x = arange(0,6e-2,6e-2/30)
->>> A,k,theta = 10, 1.0/3e-2, pi/6
->>> y_true = A*sin(2*pi*k*x+theta)
->>> y_meas = y_true + 2*random.randn(len(x))
-
->>> def residuals(p, y, x):
-...     A,k,theta = p
-...     err = y-A*sin(2*pi*k*x+theta)
-...     return err
-
->>> def peval(x, p):
-...     return p[0]*sin(2*pi*p[1]*x+p[2])
-
->>> p0 = [8, 1/2.3e-2, pi/3]
->>> print array(p0)
-[  8.      43.4783   1.0472]
-
->>> from scipy.optimize import leastsq
->>> plsq = leastsq(residuals, p0, args=(y_meas, x))
->>> print plsq[0]
-[ 10.9437  33.3605   0.5834]
-
->>> print array([A, k, theta])
-[ 10.      33.3333   0.5236]
-
->>> import matplotlib.pyplot as plt
->>> plt.plot(x,peval(x,plsq[0]),x,y_meas,'o',x,y_true)
->>> plt.title('Least-squares fit to noisy data')
->>> plt.legend(['Fit', 'Noisy', 'True'])
->>> plt.show()

Deleted: scipy-docs/trunk/source/tutorial/examples/5.8
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.8	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5.8	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,7 +0,0 @@
->>> from scipy.special import j1
-
->>> from scipy.optimize import fminbound
->>> xmin = fminbound(j1, 4, 7)
->>> print xmin
-5.33144184241
-

Deleted: scipy-docs/trunk/source/tutorial/examples/5.9
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/5.9	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/5.9	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,16 +0,0 @@
->>> def func(x):
-        return x + 2*cos(x)
-
->>> def func2(x):
-        out = [x[0]*cos(x[1]) - 4]
-        out.append(x[1]*x[0] - x[1] - 5)
-        return out
-
->>> from optimize import fsolve
->>> x0 = fsolve(func, 0.3)
->>> print x0
--1.02986652932
-
->>> x02 = fsolve(func2, [1, 1])
->>> print x02
-[ 6.5041  0.9084]

Copied: scipy-docs/trunk/source/tutorial/examples/6-1 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/6.1)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/6.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/6-1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,10 @@
+>>> from numpy import *
+>>> from scipy import interpolate
+
+>>> x = arange(0,10)
+>>> y = exp(-x/3.0)
+>>> f = interpolate.interp1d(x, y)
+
+>>> xnew = arange(0,9,0.1)
+>>> import matplotlib.pyplot as plt
+>>> plt.plot(x,y,'o',xnew,f(xnew),'-')

Copied: scipy-docs/trunk/source/tutorial/examples/6-2 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/6.2)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/6.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/6-2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,61 @@
+>>> from numpy import *
+>>> import matplotlib.pyplot as plt
+>>> from scipy import interpolate
+
+>>> # Cubic-spline
+>>> x = arange(0,2*pi+pi/4,2*pi/8)
+>>> y = sin(x)
+>>> tck = interpolate.splrep(x,y,s=0)
+>>> xnew = arange(0,2*pi,pi/50)
+>>> ynew = interpolate.splev(xnew,tck,der=0)
+
+>>> plt.figure()
+>>> plt.plot(x,y,'x',xnew,ynew,xnew,sin(xnew),x,y,'b')
+>>> plt.legend(['Linear','Cubic Spline', 'True'])
+>>> plt.axis([-0.05,6.33,-1.05,1.05])
+>>> plt.title('Cubic-spline interpolation')
+>>> plt.show()
+
+>>> # Derivative of spline
+>>> yder = interpolate.splev(xnew,tck,der=1)
+>>> plt.figure()
+>>> plt.plot(xnew,yder,xnew,cos(xnew),'--')
+>>> plt.legend(['Cubic Spline', 'True'])
+>>> plt.axis([-0.05,6.33,-1.05,1.05])
+>>> plt.title('Derivative estimation from spline')
+>>> plt.show()
+
+>>> # Integral of spline
+>>> def integ(x,tck,constant=-1):
+>>>     x = atleast_1d(x)
+>>>     out = zeros(x.shape, dtype=x.dtype)
+>>>     for n in xrange(len(out)):
+>>>         out[n] = interpolate.splint(0,x[n],tck)
+>>>     out += constant
+>>>     return out
+>>>
+>>> yint = integ(xnew,tck)
+>>> plt.figure()
+>>> plt.plot(xnew,yint,xnew,-cos(xnew),'--')
+>>> plt.legend(['Cubic Spline', 'True'])
+>>> plt.axis([-0.05,6.33,-1.05,1.05])
+>>> plt.title('Integral estimation from spline')
+>>> plt.show()
+
+>>> # Roots of spline
+>>> print interpolate.sproot(tck)
+[ 0.      3.1416]
+
+>>> # Parametric spline
+>>> t = arange(0,1.1,.1)
+>>> x = sin(2*pi*t)
+>>> y = cos(2*pi*t)
+>>> tck,u = interpolate.splprep([x,y],s=0)
+>>> unew = arange(0,1.01,0.01)
+>>> out = interpolate.splev(unew,tck)
+>>> plt.figure()
+>>> plt.plot(x,y,'x',out[0],out[1],sin(2*pi*unew),cos(2*pi*unew),x,y,'b')
+>>> plt.legend(['Linear','Cubic Spline', 'True'])
+>>> plt.axis([-1.05,1.05,-1.05,1.05])
+>>> plt.title('Spline of parametrically-defined curve')
+>>> plt.show()

Copied: scipy-docs/trunk/source/tutorial/examples/6-3 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/6.3)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/6.3	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/6-3	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,24 @@
+>>> from numpy import *
+>>> from scipy import interpolate
+>>> import matplotlib.pyplot as plt
+
+>>> # Define function over sparse 20x20 grid
+>>> x,y = mgrid[-1:1:20j,-1:1:20j]
+>>> z = (x+y)*exp(-6.0*(x*x+y*y))
+
+>>> plt.figure()
+>>> plt.pcolor(x,y,z)
+>>> plt.colorbar()
+>>> plt.title("Sparsely sampled function.")
+>>> plt.show()
+
+>>> # Interpolate function over new 70x70 grid
+>>> xnew,ynew = mgrid[-1:1:70j,-1:1:70j]
+>>> tck = interpolate.bisplrep(x,y,z,s=0)
+>>> znew = interpolate.bisplev(xnew[:,0],ynew[0,:],tck)
+
+>>> plt.figure()
+>>> plt.pcolor(xnew,ynew,znew)
+>>> plt.colorbar()
+>>> plt.title("Interpolated function.")
+>>> plt.show()

Copied: scipy-docs/trunk/source/tutorial/examples/6-4 (from rev 5102, scipy-docs/trunk/source/tutorial/examples/6.4)
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/6.4	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/6-4	2008-11-14 00:56:39 UTC (rev 5103)
@@ -0,0 +1,25 @@
+>>> from numpy import *
+>>> from scipy import signal, misc
+>>> import matplotlib.pyplot as plt
+
+>>> image = misc.lena().astype(float32)
+>>> derfilt = array([1.0,-2,1.0],float32)
+>>> ck = signal.cspline2d(image,8.0)
+>>> deriv = signal.sepfir2d(ck, derfilt, [1]) + \
+>>>         signal.sepfir2d(ck, [1], derfilt)
+>>> 
+>>> ## Alternatively we could have done:
+>>> ## laplacian = array([[0,1,0],[1,-4,1],[0,1,0]],float32)
+>>> ## deriv2 = signal.convolve2d(ck,laplacian,mode='same',boundary='symm')
+
+>>> plt.figure()
+>>> plt.imshow(image)
+>>> plt.gray()
+>>> plt.title('Original image')
+>>> plt.show()
+
+>>> plt.figure()
+>>> plt.imshow(deriv)
+>>> plt.gray()
+>>> plt.title('Output of spline edge filter')
+>>> plt.show()

Deleted: scipy-docs/trunk/source/tutorial/examples/6.1
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/6.1	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/6.1	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,10 +0,0 @@
->>> from numpy import *
->>> from scipy import interpolate
-
->>> x = arange(0,10)
->>> y = exp(-x/3.0)
->>> f = interpolate.interp1d(x, y)
-
->>> xnew = arange(0,9,0.1)
->>> import matplotlib.pyplot as plt
->>> plt.plot(x,y,'o',xnew,f(xnew),'-')

Deleted: scipy-docs/trunk/source/tutorial/examples/6.2
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/6.2	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/6.2	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,61 +0,0 @@
->>> from numpy import *
->>> import matplotlib.pyplot as plt
->>> from scipy import interpolate
-
->>> # Cubic-spline
->>> x = arange(0,2*pi+pi/4,2*pi/8)
->>> y = sin(x)
->>> tck = interpolate.splrep(x,y,s=0)
->>> xnew = arange(0,2*pi,pi/50)
->>> ynew = interpolate.splev(xnew,tck,der=0)
-
->>> plt.figure()
->>> plt.plot(x,y,'x',xnew,ynew,xnew,sin(xnew),x,y,'b')
->>> plt.legend(['Linear','Cubic Spline', 'True'])
->>> plt.axis([-0.05,6.33,-1.05,1.05])
->>> plt.title('Cubic-spline interpolation')
->>> plt.show()
-
->>> # Derivative of spline
->>> yder = interpolate.splev(xnew,tck,der=1)
->>> plt.figure()
->>> plt.plot(xnew,yder,xnew,cos(xnew),'--')
->>> plt.legend(['Cubic Spline', 'True'])
->>> plt.axis([-0.05,6.33,-1.05,1.05])
->>> plt.title('Derivative estimation from spline')
->>> plt.show()
-
->>> # Integral of spline
->>> def integ(x,tck,constant=-1):
->>>     x = atleast_1d(x)
->>>     out = zeros(x.shape, dtype=x.dtype)
->>>     for n in xrange(len(out)):
->>>         out[n] = interpolate.splint(0,x[n],tck)
->>>     out += constant
->>>     return out
->>>
->>> yint = integ(xnew,tck)
->>> plt.figure()
->>> plt.plot(xnew,yint,xnew,-cos(xnew),'--')
->>> plt.legend(['Cubic Spline', 'True'])
->>> plt.axis([-0.05,6.33,-1.05,1.05])
->>> plt.title('Integral estimation from spline')
->>> plt.show()
-
->>> # Roots of spline
->>> print interpolate.sproot(tck)
-[ 0.      3.1416]
-
->>> # Parametric spline
->>> t = arange(0,1.1,.1)
->>> x = sin(2*pi*t)
->>> y = cos(2*pi*t)
->>> tck,u = interpolate.splprep([x,y],s=0)
->>> unew = arange(0,1.01,0.01)
->>> out = interpolate.splev(unew,tck)
->>> plt.figure()
->>> plt.plot(x,y,'x',out[0],out[1],sin(2*pi*unew),cos(2*pi*unew),x,y,'b')
->>> plt.legend(['Linear','Cubic Spline', 'True'])
->>> plt.axis([-1.05,1.05,-1.05,1.05])
->>> plt.title('Spline of parametrically-defined curve')
->>> plt.show()

Deleted: scipy-docs/trunk/source/tutorial/examples/6.3
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/6.3	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/6.3	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,24 +0,0 @@
->>> from numpy import *
->>> from scipy import interpolate
->>> import matplotlib.pyplot as plt
-
->>> # Define function over sparse 20x20 grid
->>> x,y = mgrid[-1:1:20j,-1:1:20j]
->>> z = (x+y)*exp(-6.0*(x*x+y*y))
-
->>> plt.figure()
->>> plt.pcolor(x,y,z)
->>> plt.colorbar()
->>> plt.title("Sparsely sampled function.")
->>> plt.show()
-
->>> # Interpolate function over new 70x70 grid
->>> xnew,ynew = mgrid[-1:1:70j,-1:1:70j]
->>> tck = interpolate.bisplrep(x,y,z,s=0)
->>> znew = interpolate.bisplev(xnew[:,0],ynew[0,:],tck)
-
->>> plt.figure()
->>> plt.pcolor(xnew,ynew,znew)
->>> plt.colorbar()
->>> plt.title("Interpolated function.")
->>> plt.show()

Deleted: scipy-docs/trunk/source/tutorial/examples/6.4
===================================================================
--- scipy-docs/trunk/source/tutorial/examples/6.4	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/examples/6.4	2008-11-14 00:56:39 UTC (rev 5103)
@@ -1,25 +0,0 @@
->>> from numpy import *
->>> from scipy import signal, misc
->>> import matplotlib.pyplot as plt
-
->>> image = misc.lena().astype(float32)
->>> derfilt = array([1.0,-2,1.0],float32)
->>> ck = signal.cspline2d(image,8.0)
->>> deriv = signal.sepfir2d(ck, derfilt, [1]) + \
->>>         signal.sepfir2d(ck, [1], derfilt)
->>> 
->>> ## Alternatively we could have done:
->>> ## laplacian = array([[0,1,0],[1,-4,1],[0,1,0]],float32)
->>> ## deriv2 = signal.convolve2d(ck,laplacian,mode='same',boundary='symm')
-
->>> plt.figure()
->>> plt.imshow(image)
->>> plt.gray()
->>> plt.title('Original image')
->>> plt.show()
-
->>> plt.figure()
->>> plt.imshow(deriv)
->>> plt.gray()
->>> plt.title('Output of spline edge filter')
->>> plt.show()

Modified: scipy-docs/trunk/source/tutorial/index.rst
===================================================================
--- scipy-docs/trunk/source/tutorial/index.rst	2008-11-14 00:37:38 UTC (rev 5102)
+++ scipy-docs/trunk/source/tutorial/index.rst	2008-11-14 00:56:39 UTC (rev 5103)
@@ -68,7 +68,7 @@
 passed as the argument to help than a list of the functions and
 classes defined in that module is printed. For example: 
 
-.. literalinclude:: examples/1.1
+.. literalinclude:: examples/1-1
 
 Another useful command is :func:`source`. When given a function
 written in Python as an argument, it prints out a listing of the
@@ -252,7 +252,7 @@
 arrays for an N-dimensional volume. The easiest way to understand this
 is with an example of its usage: 
 
-.. literalinclude:: examples/2.1
+.. literalinclude:: examples/2-1
 
 Having meshed arrays like this is sometimes very useful. However, it
 is not always needed just to evaluate some N-dimensional function over
@@ -292,7 +292,7 @@
 expressions, integrated, differentiated, and evaluated. It even prints
 like a polynomial:
 
-.. literalinclude:: examples/2.2
+.. literalinclude:: examples/2-2
 
 The other way to handle polynomials is as an array of coefficients
 with the first element of the array giving the coefficient of the
@@ -311,7 +311,7 @@
 ufuncs). For example, suppose you have a Python function named
 :obj:`addsubtract` defined as:
 
-.. literalinclude:: examples/3.1
+.. literalinclude:: examples/3-1
 
 which defines a function of two scalar variables and returns a scalar
 result. The class vectorize can be used to "vectorize "this function so that ::
@@ -321,7 +321,7 @@
 returns a function which takes array arguments and returns an array
 result: 
 
-.. literalinclude:: examples/3.2
+.. literalinclude:: examples/3-2
 
 This particular function could have been written in vector form
 without the use of :obj:`vectorize` . But, what if the function you have written is the result of some
@@ -355,7 +355,7 @@
 the array in a ``choicelist`` corresponding to the first condition in
 ``condlist`` that is true. For example 
 
-.. literalinclude:: examples/2.3
+.. literalinclude:: examples/2-3
 
 
 Common functions
@@ -416,7 +416,7 @@
 techniques including an ordinary differential equation integrator. An
 overview of the module is provided by the help command:
 
-.. literalinclude:: examples/4.1
+.. literalinclude:: examples/4-1
 
 
 General integration (integrate.quad)
@@ -435,7 +435,7 @@
 
 This could be computed using :obj:`quad`:
 
-.. literalinclude:: examples/4.2
+.. literalinclude:: examples/4-2
 
 The first argument to quad is a "callable "Python object ( *i.e* a function, method, or class instance). Notice the use of a lambda-
 function in this case as the argument. The next two arguments are the
@@ -473,7 +473,7 @@
 :obj:`special.expn` can be replicated by defining a new function
 :obj:`vec_expint` based on the routine :obj:`quad`:
 
-.. literalinclude:: examples/4.3
+.. literalinclude:: examples/4-3
 
 The function which is integrated can even use the quad argument
 (though the error bound may underestimate the error due to possible
@@ -484,7 +484,7 @@
 
     \[ I_{n}=\int_{0}^{\infty}\int_{1}^{\infty}\frac{e^{-xt}}{t^{n}}\, dt\, dx=\frac{1}{n}.\]
 
-.. literalinclude:: examples/4.4
+.. literalinclude:: examples/4-4
 
 This last example shows that multiple integration can be handled using
 repeated calls to :func:`quad`. The mechanics of this for double and
@@ -496,7 +496,7 @@
 functions. An example of using double integration to compute several
 values of :math:`I_{n}` is shown below:
 
-.. literalinclude:: examples/4.5
+.. literalinclude:: examples/4-5
 
 
 Gaussian quadrature (integrate.gauss_quadtol)
@@ -610,7 +610,7 @@
 (with respect to :math:`\mathbf{y}` ) of the function,
 :math:`\mathbf{f}\left(\mathbf{y},t\right)`.
 
-.. literalinclude:: examples/4.6
+.. literalinclude:: examples/4-6
 
 
 Optimization (optimize)
@@ -620,7 +620,7 @@
 in the :mod:`scipy.optimize` package. An overview of the module is
 available using :func:`help` (or :func:`pydoc.help`):
 
-.. literalinclude:: examples/5.1
+.. literalinclude:: examples/5-1
 
 The first four algorithms are unconstrained minimization algorithms
 (fmin: Nelder-Mead simplex, fmin_bfgs: BFGS, fmin_ncg: Newton
@@ -650,7 +650,7 @@
 
 The minimum value of this function is 0 which is achieved when :math:`x_{i}=1.` This minimum can be found using the :obj:`fmin` routine as shown in the example below: 
 
-.. literalinclude:: examples/5.2
+.. literalinclude:: examples/5-2
 
 Another optimization algorithm that needs only function calls to find
 the minimum is Powell's method available as :func:`optimize.fmin_powell`. 
@@ -685,14 +685,14 @@
 A Python function which computes this gradient is constructed by the
 code-segment: 
 
-.. literalinclude:: examples/5.3
+.. literalinclude:: examples/5-3
 
 The calling signature for the BFGS minimization algorithm is similar
 to :obj:`fmin` with the addition of the *fprime* argument. An example
 usage of :obj:`fmin_bfgs` is shown in the following example which
 minimizes the Rosenbrock function.
 
-.. literalinclude:: examples/5.4
+.. literalinclude:: examples/5-4
 
 
 Newton-Conjugate-Gradient (optimize.fmin_ncg)
@@ -758,7 +758,7 @@
 The code which computes this Hessian along with the code to minimize
 the function using :obj:`fmin_ncg` is shown in the following example: 
 
-.. literalinclude:: examples/5.5
+.. literalinclude:: examples/5-5
 
 
 
@@ -787,7 +787,7 @@
 
 Code which makes use of the *fhess_p* keyword to minimize the Rosenbrock function using :obj:`fmin_ncg` follows: 
 
-.. literalinclude:: examples/5.6
+.. literalinclude:: examples/5-6
 
 
 Least-square fitting (minimize.leastsq)
@@ -843,7 +843,7 @@
 
 .. _`fig:least_squares_fit`:
 
-.. plot:: source/tutorial/examples/5.7
+.. plot:: source/tutorial/examples/5-7
    :include-source:
    :doctest-format:
    :align: center
@@ -892,7 +892,7 @@
 For example, to find the minimum of :math:`J_{1}\left(x\right)` near :math:`x=5` , :obj:`fminbound` can be called using the interval :math:`\left[4,7\right]` as a constraint. The result is :math:`x_{\textrm{min}}=5.3314` : 
 
 
-.. literalinclude:: examples/5.8
+.. literalinclude:: examples/5-8
 
 
 
@@ -922,7 +922,7 @@
 The results are :math:`x=-1.0299` and :math:`x_{0}=6.5041,\, x_{1}=0.9084` . 
 
 
-.. literalinclude:: examples/5.9
+.. literalinclude:: examples/5-9
 
 
 
@@ -972,7 +972,7 @@
 
 .. _`fig:inter_1d`:
 
-.. plot:: source/tutorial/examples/6.1
+.. plot:: source/tutorial/examples/6-1
    :doctest-format:
    :include-source:
    :align: center
@@ -1012,7 +1012,7 @@
 :func:`interpolate.sproot`). These functions are demonstrated in the
 example that follows (see also Figure `3 <#fig-spline-1d>`__ ).
 
-.. plot:: source/tutorial/examples/6.2
+.. plot:: source/tutorial/examples/6-2
    :include-source:
    :doctest-format:
    :align: center
@@ -1059,7 +1059,7 @@
 
 .. _`fig:2d_interp`:
 
-.. plot:: source/tutorial/examples/6.3
+.. plot:: source/tutorial/examples/6-3
    :doctest-format:
    :include-source:
    :align: center
@@ -1186,7 +1186,7 @@
 
 .. _`fig:lena_edge_spline`:
 
-.. plot:: source/tutorial/examples/6.4
+.. plot:: source/tutorial/examples/6-4
    :doctest-format:
    :include-source:
    :align: center
@@ -1589,7 +1589,7 @@
 
 The following example demonstrates this computation in SciPy 
 
-.. literalinclude:: examples/10.2.1
+.. literalinclude:: examples/10-2-1
 
 Solving linear system
 ^^^^^^^^^^^^^^^^^^^^^
@@ -1617,7 +1617,7 @@
 faster and more numerically stable. In this case it gives the same
 answer as shown in the following example: 
 
-.. literalinclude:: examples/10.2.2
+.. literalinclude:: examples/10-2-2
 
 Finding Determinant
 ^^^^^^^^^^^^^^^^^^^
@@ -1647,7 +1647,7 @@
 
 In SciPy this is computed as shown in this example: 
 
-.. literalinclude:: examples/10.2.3
+.. literalinclude:: examples/10-2-3
 
 Computing norms
 ^^^^^^^^^^^^^^^
@@ -1749,7 +1749,7 @@
 
 where :math:`x_{i}=0.1i` for :math:`i=1\ldots10` , :math:`c_{1}=5` , and :math:`c_{2}=4.` Noise is added to :math:`y_{i}` and the coefficients :math:`c_{1}` and :math:`c_{2}` are estimated using linear least squares. 
 
-.. plot:: source/tutorial/examples/10.2.5
+.. plot:: source/tutorial/examples/10-2-5
    :include-source:
    :align: center
 
@@ -1877,7 +1877,7 @@
 the original equation. The eigenvectors associated with these
 eigenvalues can then be found. 
 
-.. literalinclude:: examples/10.3.1
+.. literalinclude:: examples/10-3-1
 
 Singular value decomposition
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1894,7 +1894,7 @@
 is the singular-value decomposition of :math:`\mathbf{A}.` Every matrix has a singular value decomposition. Sometimes, the
 singular values are called the spectrum of :math:`\mathbf{A}.` The command :obj:`linalg.svd` will return :math:`\mathbf{U}` , :math:`\mathbf{V}^{H}` , and :math:`\sigma_{i}` as an array of the singular values. To obtain the matrix :math:`\mathbf{\Sigma}` use :obj:`linalg.diagsvd`. The following example illustrates the use of :obj:`linalg.svd` . 
 
-.. literalinclude:: examples/10.3.2
+.. literalinclude:: examples/10-3-2
 
 .. [#] A hermition matrix :math:`\mathbf{D}` satisfies :math:`\mathbf{D}^{H}=\mathbf{D}.` 
 
@@ -1992,7 +1992,7 @@
 
 The following example illustrates the schur decomposition: 
 
-.. literalinclude:: examples/10.3.6
+.. literalinclude:: examples/10-3-6
 
 Matrix Functions
 ----------------
@@ -2117,7 +2117,7 @@
 algorithm. For example the following code computes the zeroth-order
 Bessel function applied to a matrix.
 
-.. literalinclude:: examples/10.4.4
+.. literalinclude:: examples/10-4-4
 
 Statistics
 ==========



More information about the Scipy-svn mailing list