Changeset 7848
- Timestamp:
- Jun 16, 2010, 2:50:06 PM (14 years ago)
- Location:
- trunk/anuga_core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/documentation/user_manual/anuga_user_manual.tex
r7828 r7848 1 % Complete documentation on the extended LaTeX markup used for Python1 % Complete documentation on the extended LaTeX markup used for Python 2 2 % documentation is available in ''Documenting Python'', which is part 3 3 % of the standard documentation for Python. It may be found online … … 26 26 \documentclass{manual} 27 27 28 28 29 \usepackage{graphicx} 29 30 \usepackage[english]{babel} 30 31 \usepackage{datetime} 31 32 \usepackage[hang,small,bf]{caption} 33 32 34 33 35 \input{definitions} … … 4629 4631 4630 4632 \begin{verbatim} 4631 convariance_value, alpha = $\backslash$4633 convariance_value, alpha = \ 4632 4634 find_optimal_smoothing_parameter(data_file=fileName, 4633 4635 alpha_list=[0.0001, 0.01, 1], -
trunk/anuga_core/source/anuga/utilities/cg_solve.py
r7845 r7848 8 8 9 9 10 def conjugate_gradient(A,b,x0=None,imax=10000,tol=1.0e-8,iprint= 0):10 def conjugate_gradient(A,b,x0=None,imax=10000,tol=1.0e-8,iprint=None): 11 11 """ 12 12 Try to solve linear equation Ax = b using … … 33 33 return x0 34 34 35 def _conjugate_gradient(A,b,x0=None,imax=10000,tol=1.0e-8,iprint= 0):35 def _conjugate_gradient(A,b,x0=None,imax=10000,tol=1.0e-8,iprint=None): 36 36 """ 37 37 Try to solve linear equation Ax = b using … … 62 62 63 63 #FIXME: Should test using None 64 if iprint == 0:64 if iprint == None or iprint == 0: 65 65 iprint = imax 66 66 … … 72 72 rTr0 = rTr 73 73 74 #FIXME Let the iterations stop if starting with a small residual 74 75 while (i<imax and rTr>tol**2*rTr0): 75 76 q = A*d -
trunk/anuga_core/source/anuga/utilities/log.py
r7810 r7848 126 126 logging.getLevelName(console_logging_level))) 127 127 if _new_python: 128 logging.log(logging. CRITICAL, start_msg,128 logging.log(logging.INFO, start_msg, 129 129 extra={'mname': __name__, 'lnum': 0}) 130 130 else: 131 logging.log(logging. CRITICAL, start_msg)131 logging.log(logging.INFO, start_msg) 132 132 133 133 # mark module as *setup* -
trunk/anuga_core/source/anuga/utilities/test_cg_solve.py
r7276 r7848 4 4 class TestError(exceptions.Exception): pass 5 5 import unittest 6 7 6 8 7 import numpy as num … … 12 11 13 12 13 14 14 15 class Test_CG_Solve(unittest.TestCase): 15 16 … … 28 29 x = [0.0, 0.0, 0.0, 0.0] 29 30 30 x = conjugate_gradient(A,b,x ,iprint=0)31 x = conjugate_gradient(A,b,x) 31 32 32 33 assert num.allclose(x,xe) … … 47 48 48 49 try: 49 x = conjugate_gradient(A,b,x,i print=0,imax=2)50 x = conjugate_gradient(A,b,x,imax=2) 50 51 except ConvergenceError: 51 52 pass … … 71 72 72 73 b = A*xe 73 x = conjugate_gradient(A,b,b,tol=1.0e-5 ,iprint=1)74 x = conjugate_gradient(A,b,b,tol=1.0e-5) 74 75 75 76 assert num.allclose(x,xe) … … 99 100 100 101 b = A*xe 101 x = conjugate_gradient(A,b,b,iprint= 0)102 x = conjugate_gradient(A,b,b,iprint=1) 102 103 103 104 assert num.allclose(x,xe)
Note: See TracChangeset
for help on using the changeset viewer.