Module Expr Str Import alias identifier Import alias identifier Import alias identifier ImportFrom alias FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Return Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Return Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str If BoolOpAnd CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Assign NameStore Num Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Assign NameStore NameStore NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore CompareGtE NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore CompareLt NameLoad NameLoad Return BoolOpOr NameLoad NameLoad decorator_list Assign NameStore Num Assign NameStore Call NameLoad NameLoad NameLoad While UnaryOpNot NameLoad body If Call AttributeLoad NameLoad attr NameLoad body For NameStore Call NameLoad NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad NameLoad SubscriptLoad NameLoad Index SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad BinOpDiv BinOpSub SubscriptLoad NameLoad Index NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad orelse For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad BinOpDiv BinOpSub SubscriptLoad Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Call AttributeLoad NameLoad attr TupleLoad NameLoad Num SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad AugAssignAdd NameStore Num Assign NameStore Call NameLoad NameLoad NameLoad Return NameLoad decorator_list If CompareEq NameLoad Str body Import alias Expr Call AttributeLoad NameLoad attr
N/A N/A 
Direct solvers and relaxation methods.

Currently, the direct solver (coarseSolve) uses either np.linalg.solve() or
scipy.sparse.linalg.spsolve(), and the relaxation method is a pure-Python
Gauss-Seidel implementation.

@author: bertalan@princeton.edu
 N/A numpy np N/A scipy.sparse sparse N/A scipy.sparse.linalg splinalg tools getresidual coarseSolve N/A N/A A b N/A N/A N/A Uses scipy.sparse.numpy.linalg.solve or np.linalg.solve, depending on
    the sparsity of A.
     N/A N/A N/A sparse issparse A N/A N/A toreturn N/A N/A splinalg spsolve A b N/A N/A toreturn N/A N/A N/A np linalg solve A b N/A N/A N/A np ravel toreturn N/A smooth N/A N/A A b x iterations verbose N/A False N/A N/A N/A gaussSeidel A b x iterations iterations verbose verbose N/A smoothToThreshold N/A N/A A b x threshold verbose N/A False N/A N/A N/A gaussSeidel A b x threshold threshold verbose verbose N/A gaussSeidel N/A N/A A b x iterations threshold verbose N/A None None False N/A N/A An implementation of Gauss-Seidel iterative solution.
    Will stop when the given number of iterations are exausted OR an absolute
    error norm is achieved.
     N/A N/A N/A iterations None N/A threshold None N/A N/A iterations 1 N/A N N/A x size stop N/A N/A iteration x N/A N/A N/A iterStatus threshStatus False N/A N/A iterations None N/A N/A iterStatus N/A iteration iterations N/A N/A threshold None N/A N/A norm N/A N/A N/A np linalg norm N/A getresidual b A x N N/A threshStatus N/A norm threshold N/A N/A iterStatus threshStatus N/A N/A iteration 0 N/A stopping N/A stop iteration x N/A N/A stopping N/A N/A N/A N/A sparse issparse A N/A N/A i N/A range N N/A N/A rowstart N/A N/A A indptr N/A i N/A rowend N/A N/A A indptr N/A N/A i 1 N/A Aix N/A N/A np dot N/A N/A A data N/A rowstart rowend N/A x N/A N/A N/A A indices N/A rowstart rowend N/A N/A x N/A i N/A N/A x N/A i N/A N/A N/A b N/A i Aix N/A A N/A N/A i i N/A N/A i N/A range N N/A N/A N/A x N/A i N/A N/A x N/A i N/A N/A N/A N/A N/A N/A N/A np array b ravel N/A i N/A N/A np dot N/A A N/A N/A i N/A N/A N/A x reshape N/A N 1 N/A A N/A N/A i i N/A iteration 1 N/A stopping N/A stop iteration x N/A x N/A N/A N/A __name__ __main__ N/A N/A doctest N/A N/A N/A doctest testmod