bigmultigrid
index
/.automount/ioasun3/root/disk/users/kybic/work/python_volumes/bigmultigrid.py

 Module bigmultigrid implements multidimensional nonlinear
variational optimization algorithms
 
Jan Kybic, November 2000
$Id: bigmultigrid.html,v 1.1 2002/08/26 14:11:15 jkybic Exp $

 
Modules
                      
Gnuplot
Image
bigoptimize
bigpyramid
bigregister
bigsplines
bigtools
copy
copy_reg
math
multiarray
pickle
string
types

 
Classes
                      
MultigridOptimizerState

 
class MultigridOptimizerState
            A class representing a multigrid optimizer and its state
 
  
__init__(self, problem, optimizer=<class bigoptimize.OptimizerGdes>, verbose=0, maxiter=100, abstol=1e-50, reltol=1.0000000000000001e-05, xtol=0.001, smoothcount=1, callbackE=None, level=0, maxlevel=1000, itercounts=None)
addToIterCount(self, x)
 adds x to an iteration count at given level
canReduce(self)
getReducedOptimizer(self, correct=0)
 If possible, get a reduced version of the problem
and return an MultigridOptimizerState ready to solve it
hasConvergedE(self)
 This function decides if we have converged or not, based on E
makeTcycle(self)
 Makes one iteration of the T cycle. This consists of
trying to improve the criterion by solving a reduced
problem (we skip this now), then a corrected reduced
problem, or finally, if all else fails, to smooth at the
current level.
 
Returns a reference to the resulting x.
makeTcyclesToConvergence(self)
 Keep executing T cycles until we converge
 
Returns a reference to a resulting x.
setX(self, x)
smooth(self)
 Apply the smoothing operation (optimizer) smoothcount times
smoothToConvergence(self)
 Apply the smoothing operation until convergence
solveFullT(self)
 Return a solution using a full multigrid algorithm using T
cycles
solveMR(self)
 Return a solution using a multiresolution approach
tCycleCGC(self, correct=0)

 
Functions
                      
alltrue = reduce(...)
array(...)
array(sequence, typecode=None, copy=1, savespace=0) will return a new array formed from the given (potentially nested) sequence with type given by typecode.  If no typecode is given, then the type will be determined as the minimum type required to hold the objects in sequence.  If copy is zero and sequence is already an array, a reference will be returned.  If savespace is nonzero, the new array will maintain its precision in operations.
choose(...)
choose(a, (b1,b2,...))
cross_correlate(...)
cross_correlate(a,v)
cumproduct = accumulate(...)
cumsum = accumulate(...)
fromstring(...)
fromstring(string, count=None, typecode='l') returns a new 1d array initialized from the raw binary data in string.  If count is not equal to None, the new array will have count elements, otherwise it's size is determined by the size of string.
getWarpedLena(degf=3, degc=3, size=(64, 64))
product = reduce(...)
repeat(...)
repeat(a, n, axis=0)
reshape(...)
reshape(a, (d1, d2, ..., dn)).  Change the shape of a to be an n-dimensional array with dimensions given by d1...dn.  One dimension is allowed to be None.  This dimension will be set to whatever value will make the size of the new array equal the size of the old one.  Note: the size specified for the new array must be exactly equal to the size of the  old one or an error will occur.  This returns a completely new array with the data of the old one copied.  Use a.shape=(...) for no data copying.
searchsorted = binarysearch(...)
binarysearch(a,v)
showEevol(listE)
sometrue = reduce(...)
sum = reduce(...)
take(...)
take(a, indices, axis=0).  Selects the elements in indices from array a along the given axis.
testFullT(p=None)
testMOS(p=None)
testTcycle()
test_lena()
zeros(...)
zeros((d1,...,dn),typecode,savespace) will return a new array of shape (d1,...,dn) and type typecode (default 'l') with all it's entries initialized to zero.  If savespace (default 0) is nonzero the array will be a spacesaver array.

 
Constants
                      ArrayType = <type 'array'>
Complex = 'D'
Complex0 = 'F'
Complex16 = 'F'
Complex32 = 'F'
Complex64 = 'D'
Complex8 = 'F'
Float = 'd'
Float0 = 'f'
Float16 = 'f'
Float32 = 'f'
Float64 = 'd'
Float8 = 'f'
Int = 'l'
Int0 = '1'
Int16 = 's'
Int32 = 'i'
Int8 = '1'
LittleEndian = 1
PrecisionError = 'PrecisionError'
PyObject = 'O'
UnsignedInt8 = 'b'
arraytype = <type 'array'>
e = 2.7182818284590451
pi = 3.1415926535897931