rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
return threeAddrProgram, signature, tempsig, constants
return threeAddrProgram, signature, tempsig, constants, input_names
def registerMaker(node, temporary=False): reg = Register(node, temporary=temporary) reg.n = reg_num[0] reg_num[0] -= 1 return reg
ec602a115f87007a485e1c481086007213ceb93d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ec602a115f87007a485e1c481086007213ceb93d/compiler.py
threeAddrProgram, inputsig, tempsig, constants = \
threeAddrProgram, inputsig, tempsig, constants, input_names = \
def numexpr(ex, signature=(), copy_args=(), **kwargs): """Compile an expression built using E.<variable> variables to a function. ex can also be specified as a string "2*a+3*b". The order of the input variables and their types can be specified using the signature parameter, which is a list of (name, type) pairs. """...
ec602a115f87007a485e1c481086007213ceb93d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ec602a115f87007a485e1c481086007213ceb93d/compiler.py
return interpreter.NumExpr(inputsig, tempsig, program, constants)
return interpreter.NumExpr(inputsig, tempsig, program, constants, input_names)
def numexpr(ex, signature=(), copy_args=(), **kwargs): """Compile an expression built using E.<variable> variables to a function. ex can also be specified as a string "2*a+3*b". The order of the input variables and their types can be specified using the signature parameter, which is a list of (name, type) pairs. """...
ec602a115f87007a485e1c481086007213ceb93d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ec602a115f87007a485e1c481086007213ceb93d/compiler.py
r_constants = 1 + nex.n_inputs
r_constants = 1 + len(nex.signature)
def disassemble(nex): rev_opcodes = {} for op in interpreter.opcodes: rev_opcodes[interpreter.opcodes[op]] = op r_constants = 1 + nex.n_inputs r_temps = r_constants + len(nex.constants) def getArg(pc): arg = ord(nex.program[pc]) if arg == 0: return 'r0' elif arg == 255: return None elif arg < r_constants: return 'r%d[%...
ec602a115f87007a485e1c481086007213ceb93d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ec602a115f87007a485e1c481086007213ceb93d/compiler.py
b = time.clock()
b = timer()
def initialize(self,reseed = 1): b = time.clock() self.test_settings(self.settings) self.gen = 0 sd = self.settings['rand_seed']; alg = self.settings['rand_alg'] if reseed: rv.initialize(seed = sd, algorithm = alg) self.settings['seed_used'] = rv.initial_seed() self._print('initializing... seed = %d' % self.settings['s...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
self.step_time = time.clock() - b
self.step_time = timer() - b
def initialize(self,reseed = 1): b = time.clock() self.test_settings(self.settings) self.gen = 0 sd = self.settings['rand_seed']; alg = self.settings['rand_alg'] if reseed: rv.initialize(seed = sd, algorithm = alg) self.settings['seed_used'] = rv.initial_seed() self._print('initializing... seed = %d' % self.settings['s...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
b = time.clock()
b = timer()
def step(self,steps=1): sz = len(self.pop) replace = int(self.settings['p_replace'] * len(self.pop)) p_crossover = self.settings['p_cross'] for st in range(steps): b = time.clock() for i in range(0,replace,2): mom,dad= self.pop.select(2) self.stats['selections'] = self.stats['selections'] + 2 if flip_coin(p_crossover):...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
e1 = time.clock();
e1 = timer();
def step(self,steps=1): sz = len(self.pop) replace = int(self.settings['p_replace'] * len(self.pop)) p_crossover = self.settings['p_cross'] for st in range(steps): b = time.clock() for i in range(0,replace,2): mom,dad= self.pop.select(2) self.stats['selections'] = self.stats['selections'] + 2 if flip_coin(p_crossover):...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
e2 = time.clock();
e2 = timer();
def step(self,steps=1): sz = len(self.pop) replace = int(self.settings['p_replace'] * len(self.pop)) p_crossover = self.settings['p_cross'] for st in range(steps): b = time.clock() for i in range(0,replace,2): mom,dad= self.pop.select(2) self.stats['selections'] = self.stats['selections'] + 2 if flip_coin(p_crossover):...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
e3 = time.clock();
e3 = timer();
def step(self,steps=1): sz = len(self.pop) replace = int(self.settings['p_replace'] * len(self.pop)) p_crossover = self.settings['p_cross'] for st in range(steps): b = time.clock() for i in range(0,replace,2): mom,dad= self.pop.select(2) self.stats['selections'] = self.stats['selections'] + 2 if flip_coin(p_crossover):...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
e = time.clock(); self.step_time = e - b
e = timer(); self.step_time = e - b
def step(self,steps=1): sz = len(self.pop) replace = int(self.settings['p_replace'] * len(self.pop)) p_crossover = self.settings['p_cross'] for st in range(steps): b = time.clock() for i in range(0,replace,2): mom,dad= self.pop.select(2) self.stats['selections'] = self.stats['selections'] + 2 if flip_coin(p_crossover):...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
b = time.clock()
b = timer()
def evolve(self): b = time.clock() self.initialize() self.pre_evolve() self.p_dev = self.pop_deviation() self.iteration_output() while ( self.gen < self.settings['gens'] and self.settings['p_deviation'] < self.p_dev ): self.step() self.p_dev = self.pop_deviation() self.iteration_output() if(self.gen % self.settings['u...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
self.db_entry['run_time'] = time.clock() - b
self.db_entry['run_time'] = timer() - b
def evolve(self): b = time.clock() self.initialize() self.pre_evolve() self.p_dev = self.pop_deviation() self.iteration_output() while ( self.gen < self.settings['gens'] and self.settings['p_deviation'] < self.p_dev ): self.step() self.p_dev = self.pop_deviation() self.iteration_output() if(self.gen % self.settings['u...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
b = time.clock()
b = timer()
def initialize(self, mode = 'serial'): b = time.clock() #same as galg self.test_settings(self.settings) self.gen = 0 sd = self.settings['rand_seed']; alg = self.settings['rand_alg'] rv.initialize(seed = sd, algorithm = alg) self.settings['seed_used'] = rv.initial_seed() self._print('initializing... seed = %d' % self.se...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
self.step_time = time.clock() - b
self.step_time = timer() - b
def initialize(self, mode = 'serial'): b = time.clock() #same as galg self.test_settings(self.settings) self.gen = 0 sd = self.settings['rand_seed']; alg = self.settings['rand_alg'] rv.initialize(seed = sd, algorithm = alg) self.settings['seed_used'] = rv.initial_seed() self._print('initializing... seed = %d' % self.se...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
b = time.clock()
b = timer()
def step(self,steps=1,mode = 'serial'): for st in range(steps): b = time.clock() cnt = 0 #self.pop._size(0) # used if we keep a single pop if mode[0] == 'p' or mode[0] == 'P': """ sys.setcheckinterval(100) finished = sync.event() bar = sync.barrier(len(self.GAs)) for ga in self.GAs: thread.start_new_thread(GA_stepper,(...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
e = time.clock(); self.step_time = e - b
e = timer(); self.step_time = e - b
def step(self,steps=1,mode = 'serial'): for st in range(steps): b = time.clock() cnt = 0 #self.pop._size(0) # used if we keep a single pop if mode[0] == 'p' or mode[0] == 'P': """ sys.setcheckinterval(100) finished = sync.event() bar = sync.barrier(len(self.GAs)) for ga in self.GAs: thread.start_new_thread(GA_stepper,(...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
b = time.clock()
b = timer()
def evolve(self, mode = 'serial'): b = time.clock() self.initialize(mode) self.pre_evolve() self.p_dev = self.pop_deviation() self.iteration_output() while ( self.gen < self.settings['gens'] and self.settings['p_deviation'] < self.p_dev ): self.step(1,mode) self.p_dev = self.pop_deviation() self.iteration_output() sel...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
self.db_entry['run_time'] = time.clock() - b
self.db_entry['run_time'] = timer() - b
def evolve(self, mode = 'serial'): b = time.clock() self.initialize(mode) self.pre_evolve() self.p_dev = self.pop_deviation() self.iteration_output() while ( self.gen < self.settings['gens'] and self.settings['p_deviation'] < self.p_dev ): self.step(1,mode) self.p_dev = self.pop_deviation() self.iteration_output() sel...
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
t1 = time.time()
t1 = timer()
def GA_stepper(bar,finished,GA): t1 = time.time() GA.step() t2 = time.time() print 'thread ' + `thread.get_ident()` + 'time ' + `t2-t1` + ' sec.' bar.enter() finished.post()
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
t2 = time.time()
t2 = timer()
def GA_stepper(bar,finished,GA): t1 = time.time() GA.step() t2 = time.time() print 'thread ' + `thread.get_ident()` + 'time ' + `t2-t1` + ' sec.' bar.enter() finished.post()
8418b2938a491bb6a337b1fba872055375ef3547 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8418b2938a491bb6a337b1fba872055375ef3547/algorithm.py
def __init__(self, format, maxprint=MAXPRINT, allocsize=ALLOCSIZE): self.format = format
def __init__(self, maxprint=MAXPRINT, allocsize=ALLOCSIZE): self.format = self.__class__.__name__[:3] if self.format == 'spm': raise ValueError, "This class is not intended" \ " to be instantiated directly."
def __init__(self, format, maxprint=MAXPRINT, allocsize=ALLOCSIZE): self.format = format self.maxprint = maxprint self.allocsize = allocsize
2df51902e42db8054709637688b60399fcc84eff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2df51902e42db8054709637688b60399fcc84eff/Sparse.py
csc = self.tocsc()
csc = self.tocsc()
def rmatvec(self, vec, conj=1):
2df51902e42db8054709637688b60399fcc84eff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2df51902e42db8054709637688b60399fcc84eff/Sparse.py
spmatrix.__init__(self, 'csc')
spmatrix.__init__(self)
def __init__(self,s,ij=None,M=None,N=None,nzmax=100,typecode=Float,copy=0): spmatrix.__init__(self, 'csc') if isinstance(s,spmatrix): if isinstance(s, csc_matrix): # do nothing but copy information self.shape = s.shape if copy: self.data = s.data.copy() self.rowind = s.rowind.copy() self.indptr = s.indptr.copy() else: ...
2df51902e42db8054709637688b60399fcc84eff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2df51902e42db8054709637688b60399fcc84eff/Sparse.py
spmatrix.__init__(self, 'csr')
spmatrix.__init__(self)
def __init__(self,s,ij=None,M=None,N=None,nzmax=100,typecode=Float,copy=0): spmatrix.__init__(self, 'csr') if isinstance(s,spmatrix): if isinstance(s, csr_matrix): # do nothing but copy information self.shape = s.shape if copy: self.data = s.data.copy() self.colind = s.colind.copy() self.indptr = s.indptr.copy() else: ...
2df51902e42db8054709637688b60399fcc84eff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2df51902e42db8054709637688b60399fcc84eff/Sparse.py
spmatrix.__init__(self,'dok')
spmatrix.__init__(self)
def __init__(self,A=None): dict.__init__(self) spmatrix.__init__(self,'dok') self.shape = (0,0) self.nnz = 0 if A is not None: A = asarray(A) N,M = A.shape for n in range(N): for m in range(M): if A[n,m] != 0: self[n,m] = A[n,m]
2df51902e42db8054709637688b60399fcc84eff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2df51902e42db8054709637688b60399fcc84eff/Sparse.py
spmatrix.__init__(self, 'coo')
spmatrix.__init__(self)
def __init__(self, obj, ij, M=None, N=None, nzmax=None, typecode=None): spmatrix.__init__(self, 'coo') if type(ij) is type(()) and len(ij)==2: if M is None: M = amax(ij[0]) if N is None: N = amax(ij[1]) self.row = asarray(ij[0],'i') self.col = asarray(ij[1],'i') else: aij = asarray(ij,'i') if M is None: M = amax(aij[:,...
2df51902e42db8054709637688b60399fcc84eff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2df51902e42db8054709637688b60399fcc84eff/Sparse.py
if N == self.numargs + 1 and loc is None:
if N == self.numargs + 1 and loc is None:
def __fix_loc_scale(self, args, loc, scale): N = len(args) if N > self.numargs: if N == self.numargs + 1 and loc is None: # loc is given without keyword loc = args[-1] if N == self.numargs + 2 and scale is None: # loc and scale given without keyword loc, scale = args[-2:] args = args[:self.numargs] if scale is None: s...
85d80ea629ce911f4461c01412686e9d330724db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/85d80ea629ce911f4461c01412686e9d330724db/distributions.py
if N == self.numargs + 2 and scale is None:
if N == self.numargs + 2 and scale is None:
def __fix_loc_scale(self, args, loc, scale): N = len(args) if N > self.numargs: if N == self.numargs + 1 and loc is None: # loc is given without keyword loc = args[-1] if N == self.numargs + 2 and scale is None: # loc and scale given without keyword loc, scale = args[-2:] args = args[:self.numargs] if scale is None: s...
85d80ea629ce911f4461c01412686e9d330724db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/85d80ea629ce911f4461c01412686e9d330724db/distributions.py
if N == self.numargs + 1 and loc is None:
if N == self.numargs + 1 and loc is None:
def stats(self,*args,**kwds): """Some statistics of the given RV
85d80ea629ce911f4461c01412686e9d330724db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/85d80ea629ce911f4461c01412686e9d330724db/distributions.py
if N == self.numargs + 2 and scale is None:
if N == self.numargs + 2 and scale is None:
def stats(self,*args,**kwds): """Some statistics of the given RV
85d80ea629ce911f4461c01412686e9d330724db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/85d80ea629ce911f4461c01412686e9d330724db/distributions.py
if N == self.numargs + 3 and moments is None:
if N == self.numargs + 3 and moments is None:
def stats(self,*args,**kwds): """Some statistics of the given RV
85d80ea629ce911f4461c01412686e9d330724db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/85d80ea629ce911f4461c01412686e9d330724db/distributions.py
Pk = mu**k * exp(-mu) / arr(special.gamma(k+1)) return Pk
Pk = k*log(mu)-special.gammaln(k+1) - mu return exp(Pk)
def _pmf(self, k, mu): Pk = mu**k * exp(-mu) / arr(special.gamma(k+1)) return Pk
85d80ea629ce911f4461c01412686e9d330724db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/85d80ea629ce911f4461c01412686e9d330724db/distributions.py
ret_val = apply(obj, args, kw)
ret_val = apply(obj, d_args, d_kw)
def __call__(self, *args, **kw): """Performs the call to the proxied callable object by dispatching the method to the secondary thread.""" obj = self.__dont_mess_with_me_unless_you_know_what_youre_doing ret_val = None if main.in_proxy_call: ret_val = apply(obj, args, kw) else: finished = threading.Event() evt = proxy_e...
e1691937fc8ea21e4aaa1dbae08595df610fdfb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/e1691937fc8ea21e4aaa1dbae08595df610fdfb9/gui_thread_guts.py
evt = proxy_event(obj, args, kw, finished)
evt = proxy_event(obj, d_args, d_kw, finished)
def __call__(self, *args, **kw): """Performs the call to the proxied callable object by dispatching the method to the secondary thread.""" obj = self.__dont_mess_with_me_unless_you_know_what_youre_doing ret_val = None if main.in_proxy_call: ret_val = apply(obj, args, kw) else: finished = threading.Event() evt = proxy_e...
e1691937fc8ea21e4aaa1dbae08595df610fdfb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/e1691937fc8ea21e4aaa1dbae08595df610fdfb9/gui_thread_guts.py
exec(function)
exec function in globals(), locals()
def remap (listoflists,criterion): function = 'lines = map(lambda x: '+criterion+',listoflists)' exec(function) return lines
8038c03fb9544c1182b5e733a069f75219acccfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8038c03fb9544c1182b5e733a069f75219acccfd/pstat.py
p = [-.9077932138396487614720659-82196399419401501888968130.0E-27*1j, -.9077932138396487614720659+82196399419401501888968130.0E-27*1j,
p = [-.9077932138396487614720659-82196399419401501888968130.0e-27*1j, -.9077932138396487614720659+82196399419401501888968130.0e-27*1j,
def besselap(N): """Return (z,p,k) zero, pole, gain for analog prototype of an Nth order Bessel filter.""" z = [] k = 1 if N == 0: p = []; elif N == 1: p = [-1] elif N == 2: p = [-.8660254037844386467637229+.4999999999999999999999996*1j, -.8660254037844386467637229-.4999999999999999999999996*1j] elif N == 3: p = [-.941...
ee6961d5910f2418dc834f4b5da829ba2be9b7d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ee6961d5910f2418dc834f4b5da829ba2be9b7d9/filter_design.py
p = [-.9072099595087001356491337-72142113041117326028823950.0E-27*1j, -.9072099595087001356491337+72142113041117326028823950.0E-27*1j,
p = [-.9072099595087001356491337-72142113041117326028823950.0e-27*1j, -.9072099595087001356491337+72142113041117326028823950.0e-27*1j,
def besselap(N): """Return (z,p,k) zero, pole, gain for analog prototype of an Nth order Bessel filter.""" z = [] k = 1 if N == 0: p = []; elif N == 1: p = [-1] elif N == 2: p = [-.8660254037844386467637229+.4999999999999999999999996*1j, -.8660254037844386467637229-.4999999999999999999999996*1j] elif N == 3: p = [-.941...
ee6961d5910f2418dc834f4b5da829ba2be9b7d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ee6961d5910f2418dc834f4b5da829ba2be9b7d9/filter_design.py
p = [-.9067004324162775554189031-64279241063930693839360680.0E-27*1j, -.9067004324162775554189031+64279241063930693839360680.0E-27*1j,
p = [-.9067004324162775554189031-64279241063930693839360680.0e-27*1j, -.9067004324162775554189031+64279241063930693839360680.0e-27*1j,
def besselap(N): """Return (z,p,k) zero, pole, gain for analog prototype of an Nth order Bessel filter.""" z = [] k = 1 if N == 0: p = []; elif N == 1: p = [-1] elif N == 2: p = [-.8660254037844386467637229+.4999999999999999999999996*1j, -.8660254037844386467637229-.4999999999999999999999996*1j] elif N == 3: p = [-.941...
ee6961d5910f2418dc834f4b5da829ba2be9b7d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ee6961d5910f2418dc834f4b5da829ba2be9b7d9/filter_design.py
p = [-.9062570115576771146523497-57961780277849516990208850.0E-27*1j, -.9062570115576771146523497+57961780277849516990208850.0E-27*1j,
p = [-.9062570115576771146523497-57961780277849516990208850.0e-27*1j, -.9062570115576771146523497+57961780277849516990208850.0e-27*1j,
def besselap(N): """Return (z,p,k) zero, pole, gain for analog prototype of an Nth order Bessel filter.""" z = [] k = 1 if N == 0: p = []; elif N == 1: p = [-1] elif N == 2: p = [-.8660254037844386467637229+.4999999999999999999999996*1j, -.8660254037844386467637229-.4999999999999999999999996*1j] elif N == 3: p = [-.941...
ee6961d5910f2418dc834f4b5da829ba2be9b7d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ee6961d5910f2418dc834f4b5da829ba2be9b7d9/filter_design.py
p = [-.9058702269930872551848625-52774908289999045189007100.0E-27*1j, -.9058702269930872551848625+52774908289999045189007100.0E-27*1j,
p = [-.9058702269930872551848625-52774908289999045189007100.0e-27*1j, -.9058702269930872551848625+52774908289999045189007100.0e-27*1j,
def besselap(N): """Return (z,p,k) zero, pole, gain for analog prototype of an Nth order Bessel filter.""" z = [] k = 1 if N == 0: p = []; elif N == 1: p = [-1] elif N == 2: p = [-.8660254037844386467637229+.4999999999999999999999996*1j, -.8660254037844386467637229-.4999999999999999999999996*1j] elif N == 3: p = [-.941...
ee6961d5910f2418dc834f4b5da829ba2be9b7d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ee6961d5910f2418dc834f4b5da829ba2be9b7d9/filter_design.py
p = [-.9055312363372773709269407-48440066540478700874836350.0E-27*1j, -.9055312363372773709269407+48440066540478700874836350.0E-27*1j,
p = [-.9055312363372773709269407-48440066540478700874836350.0e-27*1j, -.9055312363372773709269407+48440066540478700874836350.0e-27*1j,
def besselap(N): """Return (z,p,k) zero, pole, gain for analog prototype of an Nth order Bessel filter.""" z = [] k = 1 if N == 0: p = []; elif N == 1: p = [-1] elif N == 2: p = [-.8660254037844386467637229+.4999999999999999999999996*1j, -.8660254037844386467637229-.4999999999999999999999996*1j] elif N == 3: p = [-.941...
ee6961d5910f2418dc834f4b5da829ba2be9b7d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ee6961d5910f2418dc834f4b5da829ba2be9b7d9/filter_design.py
-.9028833390228020537142561-93077131185102967450643820.0E-27*1j, -.9028833390228020537142561+93077131185102967450643820.0E-27*1j,
-.9028833390228020537142561-93077131185102967450643820.0e-27*1j, -.9028833390228020537142561+93077131185102967450643820.0e-27*1j,
def besselap(N): """Return (z,p,k) zero, pole, gain for analog prototype of an Nth order Bessel filter.""" z = [] k = 1 if N == 0: p = []; elif N == 1: p = [-1] elif N == 2: p = [-.8660254037844386467637229+.4999999999999999999999996*1j, -.8660254037844386467637229-.4999999999999999999999996*1j] elif N == 3: p = [-.941...
ee6961d5910f2418dc834f4b5da829ba2be9b7d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ee6961d5910f2418dc834f4b5da829ba2be9b7d9/filter_design.py
b = io.read_array(fname,atype=N.Int)
b = io.read_array(fname,atype=a.dtypechar)
def check_integer(self): from scipy import stats a = stats.randint.rvs(1,20,size=(3,4)) fname = tempfile.mktemp('.dat') io.write_array(fname,a) b = io.read_array(fname,atype=N.Int) assert_array_equal(a,b) os.remove(fname)
c42dc01dd06910aab5fe8510056e2fc58ab5c8fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/c42dc01dd06910aab5fe8510056e2fc58ab5c8fa/test_array_import.py
Ap = apply(approx_fhess_p,(xk,psupi,fprime,espilon)+args)
Ap = apply(approx_fhess_p,(xk,psupi,fprime,epsilon)+args)
def fmin_ncg(f, x0, fprime, fhess_p=None, fhess=None, args=(), avextol=1e-5, epsilon=1e-8, maxiter=None, full_output=0, disp=1): """Description: Minimize the function, f, whose gradient is given by fprime using the Newton-CG method. fhess_p must compute the hessian times an arbitrary vector. If it is not given, finit...
19314b480bb5aa9c9df6e44d3dad6a778b6d183b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/19314b480bb5aa9c9df6e44d3dad6a778b6d183b/optimize.py
e = 0.0
deltax= 0.0
def brent(func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500): """ Given a function of one-variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. A bracketing interval is a triple (a,b,c) where (a<b<c) and func(b) < func(a),func(c). If...
151bc0cf429941b974cff683950f0c18642f7da4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/151bc0cf429941b974cff683950f0c18642f7da4/optimize.py
if (abs(e) <= tol1): if (x>=xmid): e=a-x else: e=b-x d = _cg*e else:
if (abs(deltax) <= tol1): if (x>=xmid): deltax=a-x else: deltax=b-x rat = _cg*deltax else:
def brent(func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500): """ Given a function of one-variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. A bracketing interval is a triple (a,b,c) where (a<b<c) and func(b) < func(a),func(c). If...
151bc0cf429941b974cff683950f0c18642f7da4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/151bc0cf429941b974cff683950f0c18642f7da4/optimize.py
etemp = e e = d
dx_temp = deltax deltax= rat
def brent(func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500): """ Given a function of one-variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. A bracketing interval is a triple (a,b,c) where (a<b<c) and func(b) < func(a),func(c). If...
151bc0cf429941b974cff683950f0c18642f7da4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/151bc0cf429941b974cff683950f0c18642f7da4/optimize.py
if ((p > tmp2*(a-x)) and (p < tmp2*(b-x)) and (abs(p) < abs(0.5*tmp2*etemp))): d = p*1.0/tmp2 u = x + d
if ((p > tmp2*(a-x)) and (p < tmp2*(b-x)) and (abs(p) < abs(0.5*tmp2*dx_temp))): rat = p*1.0/tmp2 u = x + rat
def brent(func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500): """ Given a function of one-variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. A bracketing interval is a triple (a,b,c) where (a<b<c) and func(b) < func(a),func(c). If...
151bc0cf429941b974cff683950f0c18642f7da4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/151bc0cf429941b974cff683950f0c18642f7da4/optimize.py
if xmid-x >= 0: d = tol1 else: d = -tol1
if xmid-x >= 0: rat = tol1 else: rat = -tol1
def brent(func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500): """ Given a function of one-variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. A bracketing interval is a triple (a,b,c) where (a<b<c) and func(b) < func(a),func(c). If...
151bc0cf429941b974cff683950f0c18642f7da4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/151bc0cf429941b974cff683950f0c18642f7da4/optimize.py
if (x>=xmid): e=a-x else: e=b-x d = _cg*e if (abs(d) < tol1): if d >= 0: u = x + tol1
if (x>=xmid): deltax=a-x else: deltax=b-x rat = _cg*deltax if (abs(rat) < tol1): if rat >= 0: u = x + tol1
def brent(func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500): """ Given a function of one-variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. A bracketing interval is a triple (a,b,c) where (a<b<c) and func(b) < func(a),func(c). If...
151bc0cf429941b974cff683950f0c18642f7da4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/151bc0cf429941b974cff683950f0c18642f7da4/optimize.py
u = x + d fu = apply(func, (u,)+args)
u = x + rat fu = apply(func, (u,)+args)
def brent(func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500): """ Given a function of one-variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. A bracketing interval is a triple (a,b,c) where (a<b<c) and func(b) < func(a),func(c). If...
151bc0cf429941b974cff683950f0c18642f7da4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/151bc0cf429941b974cff683950f0c18642f7da4/optimize.py
if (fu > fx):
if (fu > fx):
def brent(func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500): """ Given a function of one-variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. A bracketing interval is a triple (a,b,c) where (a<b<c) and func(b) < func(a),func(c). If...
151bc0cf429941b974cff683950f0c18642f7da4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/151bc0cf429941b974cff683950f0c18642f7da4/optimize.py
if data.dtype.char == 'f' and data2.dtype.char == 'f': new = zeros(data.shape,'F') new.real = data new.imag = data2 data = new del(new) del(data2)
new = zeros(data.shape,data.dtype.char.capitalize()) new.real = data new.imag = data2 data = new del(new) del(data2)
def loadmat(name, dict=None, appendmat=1, basename='raw'): """Load the MATLAB(tm) mat file. If name is a full path name load it in. Otherwise search for the file on the sys.path list and load the first one found (the current directory is searched first). Both v4 (Level 1.0) and v6 matfiles are supported. Version 7....
e9afbd66fb9a44206df23633ca05110de268e8ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/e9afbd66fb9a44206df23633ca05110de268e8ed/mio.py
def is_numeric_array(x): try: x.typecode() in ['c','b','l','d','f','D','F'] return 1 except AttributeError: pass return 0
def is_immutable(x): """ Checks if object is completely immutable. A tuple is not considered completely immutable since it could contain references to objects that could change. Returns 1 if it is immutable or 0 if object is mutable.""" imm = () try: imm = (types.StringType, types.FloatType, types.IntType, types.Comp...
9eacfdd57411f3055528218ed98b0b8a74727406 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/9eacfdd57411f3055528218ed98b0b8a74727406/gui_thread_guts.py
exec exec_code
exec exec_code in globals, globals
def exec_code(code,inputs,returns,global_vars,addendum=None): if addendum: inputs.update(addendum) if not returns: returns = () if type(returns) == type(''): raise TypeError, 'returns must be a sequence object - not a string' exec_code = build_globals(global_vars) exec_code = exec_code + build_inputs(inputs) exec_code ...
19a34b9b8657fdfd4fccb935e57c1480dce439b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/19a34b9b8657fdfd4fccb935e57c1480dce439b1/sync_cluster.py
exec exec_code
exec exec_code in globals, globals
def loop_code(code,loop_var,inputs,returns,global_vars,addendum=None): if type(returns) == type(''): raise TypeError, 'returns must be a sequence object - not a string' if addendum: inputs.update(addendum) _loop_data = inputs[loop_var] del inputs[loop_var] #not strictly necessary exec_code = build_loop_code(code,loop_v...
19a34b9b8657fdfd4fccb935e57c1480dce439b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/19a34b9b8657fdfd4fccb935e57c1480dce439b1/sync_cluster.py
m,n (m<=n) and argument theta and phi: Y^m_n(theta,phi)
m,n (|m|<=n) and argument theta and phi: Y^m_n(theta,phi)
def _sph_harmonic(m,n,theta,phi): """inputs of (m,n,theta,phi) returns spherical harmonic of order m,n (m<=n) and argument theta and phi: Y^m_n(theta,phi) """ x = cos(phi) m,n = int(m), int(n) Pmn,Pmnd = lpmn(m,n,x) val = Pmn[m,n] val *= sqrt((2*m+1)/4.0/pi) val *= exp(0.5*gammaln(n-m+1)-gammaln(n+m+1)) val *= exp(1j*...
a48e27f42453f948a48fd1367655a3d0d70d943e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/a48e27f42453f948a48fd1367655a3d0d70d943e/basic.py
val *= sqrt((2*m+1)/4.0/pi)
val *= sqrt((2*n+1)/4.0/pi)
def _sph_harmonic(m,n,theta,phi): """inputs of (m,n,theta,phi) returns spherical harmonic of order m,n (m<=n) and argument theta and phi: Y^m_n(theta,phi) """ x = cos(phi) m,n = int(m), int(n) Pmn,Pmnd = lpmn(m,n,x) val = Pmn[m,n] val *= sqrt((2*m+1)/4.0/pi) val *= exp(0.5*gammaln(n-m+1)-gammaln(n+m+1)) val *= exp(1j*...
a48e27f42453f948a48fd1367655a3d0d70d943e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/a48e27f42453f948a48fd1367655a3d0d70d943e/basic.py
sources = ['cobyla.pyf','cobyla2.f']
sources = ['cobyla.pyf','cobyla2.f','trstlp.f']
def configuration(parent_package='',parent_path=None): package = 'optimize' config = default_config_dict(package, parent_package) local_path = get_path(__name__,parent_path) minpack = ('minpack',{'sources': glob(os.path.join(local_path,'minpack','*.f'))}) sources = ['_minpackmodule.c'] sources = [os.path.join(local_p...
18a46f16217dd63b1e83e0fb5f152d7fa3839db0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/18a46f16217dd63b1e83e0fb5f152d7fa3839db0/setup_optimize.py
def day(self): return self.getDate().day def day_of_week(self): return self.getDate().day_of_week def month(self): return self.getDate().month def quarter(self): return monthToQuarter(self.getDate().month) def year(self): return self.getDate().year def seconds(self): return int(self.g...
def day(self): return self.mxDate().day def day_of_week(self): return self.mxDate().day_of_week def month(self): return self.mxDate().month def quarter(self): return monthToQuarter(self.mxDate().month) def year(self): return self.mxDate().year def seconds(self): return int(self.mxDate...
def day(self): return self.getDate().day
eca0344ebf916e3728341976a91317f1fef7c124 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/eca0344ebf916e3728341976a91317f1fef7c124/tsdate.py
def get_eig_func(): try: import scipy.linalg eig = scipy.linalg.eig except ImportError: try: import linalg eig = linalg.eig except ImportError: try: import LinearAlgebra eig = LinearAlgebra.eigenvectors except: raise ImportError, \ "You must have scipy.linalg or LinearAlgebra to "\ "use this function." return eig
def __init__(self, roots, weights=None, hn=1.0, An=1.0, wfunc=None, limits=None, monic=0): poly1d.__init__(self, roots, r=1)
bde258f85f96f26a52a0b9f6ccec2cf3fbabb7d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/bde258f85f96f26a52a0b9f6ccec2cf3fbabb7d4/orthogonal.py
from scipy.linalg import eig
eig = get_eig_func()
def gen_roots_and_weights(n,an_func,sqrt_bn_func,mu): """[x,w] = gen_roots_and_weights(n,an_func,sqrt_bn_func,mu) Returns the roots (x) of an nth order orthogonal polynomail, and weights (w) to use in appropriate Gaussian quadrature with that orthogonal polynomial. The polynomials have the recurrence relation P_n+1(x...
bde258f85f96f26a52a0b9f6ccec2cf3fbabb7d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/bde258f85f96f26a52a0b9f6ccec2cf3fbabb7d4/orthogonal.py
lena = scipy.array(cPickle.load(f))
lena = array(cPickle.load(f))
def lena(): import cPickle, os fname = os.path.join(os.path.dirname(__file__),'plt','lena.dat') f = open(fname,'rb') lena = scipy.array(cPickle.load(f)) f.close() return lena
ffd47dc4bbee8d1b90d8f795e2475cda8d7ab117 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ffd47dc4bbee8d1b90d8f795e2475cda8d7ab117/common.py
g = Numeric.array([[5,6,4,3],[3,5,6,2],[2,3,5,6],[1,6,9,7]],'d') correct = Numeric.array([[2.16374269,3.2222222222, 2.8888888889, 1.6666666667],[2.666666667, 4.33333333333, 4.44444444444, 2.8888888888],[2.222222222, 4.4444444444, 5.4444444444, 4.801066874837],[1.33333333333, 3.92735042735, 6.0712560386, 5.0404040404]])...
g = array([[5,6,4,3],[3,5,6,2],[2,3,5,6],[1,6,9,7]],'d') correct = array([[2.16374269,3.2222222222, 2.8888888889, 1.6666666667],[2.666666667, 4.33333333333, 4.44444444444, 2.8888888888],[2.222222222, 4.4444444444, 5.4444444444, 4.801066874837],[1.33333333333, 3.92735042735, 6.0712560386, 5.0404040404]]) h = signal.wien...
def check_basic(self): g = Numeric.array([[5,6,4,3],[3,5,6,2],[2,3,5,6],[1,6,9,7]],'d') correct = Numeric.array([[2.16374269,3.2222222222, 2.8888888889, 1.6666666667],[2.666666667, 4.33333333333, 4.44444444444, 2.8888888888],[2.222222222, 4.4444444444, 5.4444444444, 4.801066874837],[1.33333333333, 3.92735042735, 6.0712...
ce42f573a06a3c9d43c3eee5bc449f215faf14e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/ce42f573a06a3c9d43c3eee5bc449f215faf14e8/test_signaltools.py
artype = b.typecode() if artype not in ['F','D','f','d']: artype = Num.Float
artype = mintypecode((a,b))
def lp2bp(b,a,wo=1.0, bw=1.0): """Return a band-pass filter with center frequency wo and bandwidth bw from a low-pass filter prototype with unity cutoff frequency. """ a,b = map(atleast_1d,(a,b)) D = len(a) - 1 N = len(b) - 1 artype = b.typecode() if artype not in ['F','D','f','d']: artype = Num.Float ma = max([N,D]) N...
eb85a014d534e66d42610f6f5ad6031ebdb93f39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/eb85a014d534e66d42610f6f5ad6031ebdb93f39/filter_design.py
artype = b.typecode() if artype not in ['F','D','f','d']: artype = Num.Float
artype = mintypecode((a,b))
def lp2bs(b,a,wo=1,bw=1): """Return a band-stop filter with center frequency wo and bandwidth bw from a low-pass filter prototype with unity cutoff frequency. """ a,b = map(atleast_1d,(a,b)) D = len(a) - 1 N = len(b) - 1 artype = b.typecode() if artype not in ['F','D','f','d']: artype = Num.Float M = max([N,D]) Np = M ...
eb85a014d534e66d42610f6f5ad6031ebdb93f39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/eb85a014d534e66d42610f6f5ad6031ebdb93f39/filter_design.py
nnz = sum(ravel(s != 0.0))
nnz = (s != 0.0).sum()
def __init__(self, arg1, dims=None, nzmax=100, dtype=None, copy=False): spmatrix.__init__(self) if isdense(arg1): self.dtype = getdtype(dtype, arg1) # Convert the dense array or matrix arg1 to CSC format if rank(arg1) == 1: # Convert to a row vector arg1 = arg1.reshape(1, arg1.shape[0]) if rank(arg1) == 2: #s = asarray...
468f8a0f15a095ee7fdb71e85da826492ec51f0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/468f8a0f15a095ee7fdb71e85da826492ec51f0c/sparse.py
while True:
while True:
def matmat(self, other): if isspmatrix(other): M, K1 = self.shape K2, N = other.shape if (K1 != K2): raise ValueError, "shape mismatch error" a, rowa, ptra = self.data, self.rowind, self.indptr if isinstance(other, csr_matrix): other._check() dtypechar = _coerce_rules[(self.dtype.char, other.dtype.char)] ftype = _trans...
468f8a0f15a095ee7fdb71e85da826492ec51f0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/468f8a0f15a095ee7fdb71e85da826492ec51f0c/sparse.py
def matmat(self, other): if isspmatrix(other): M, K1 = self.shape K2, N = other.shape if (K1 != K2): raise ValueError, "shape mismatch error" a, rowa, ptra = self.data, self.rowind, self.indptr if isinstance(other, csr_matrix): other._check() dtypechar = _coerce_rules[(self.dtype.char, other.dtype.char)] ftype = _trans...
468f8a0f15a095ee7fdb71e85da826492ec51f0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/468f8a0f15a095ee7fdb71e85da826492ec51f0c/sparse.py
percent_to_go = 1- (1.0*kcol) / N
print "Resizing...", kcol, irow, ierr percent_to_go = 1- (1.0*kcol*M + irow) / (N*M)
def matmat(self, other): if isspmatrix(other): M, K1 = self.shape K2, N = other.shape if (K1 != K2): raise ValueError, "shape mismatch error" a, rowa, ptra = self.data, self.rowind, self.indptr if isinstance(other, csr_matrix): other._check() dtypechar = _coerce_rules[(self.dtype.char, other.dtype.char)] ftype = _trans...
468f8a0f15a095ee7fdb71e85da826492ec51f0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/468f8a0f15a095ee7fdb71e85da826492ec51f0c/sparse.py
if amax(ravel(abs(new.imag))) == 0:
if abs(new.imag).max() == 0:
def toarray(self): new = zeros(self.shape, dtype=self.dtype) for key in self: ikey0 = int(key[0]) ikey1 = int(key[1]) new[ikey0, ikey1] = self[key] if amax(ravel(abs(new.imag))) == 0: new = new.real return new
468f8a0f15a095ee7fdb71e85da826492ec51f0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/468f8a0f15a095ee7fdb71e85da826492ec51f0c/sparse.py
slice1 = [slice(None)]*nd slice2 = [slice(None)]*nd slice1[axis] = slice(1,None) slice2[axis] = slice(None,-1)
slice1 = tupleset((slice(None),)*nd, axis, slice(1, None)) slice2 = tupleset((slice(None),)*nd, axis, slice(None, -1))
def cumtrapz(y, x=None, dx=1.0, axis=-1): """Cumulatively integrate y(x) using samples along the given axis and the composite trapezoidal rule. If x is None, spacing given by dx is assumed. """ y = asarray(y) if x is None: d = dx else: d = diff(x,axis=axis) nd = len(y.shape) slice1 = [slice(None)]*nd slice2 = [slice(N...
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
slice0 = [slice(None)]*nd slice1 = [slice(None)]*nd slice2 = [slice(None)]*nd
def _basic_simps(y,start,stop,x,dx,axis): nd = len(y.shape) slice0 = [slice(None)]*nd slice1 = [slice(None)]*nd slice2 = [slice(None)]*nd if start is None: start = 0 step = 2 slice0[axis] = slice(start,stop,step) slice1[axis] = slice(start+1,stop+1,step) slice2[axis] = slice(start+2,stop+2,step) if x is None: # Even ...
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
slice0[axis] = slice(start,stop,step) slice1[axis] = slice(start+1,stop+1,step) slice2[axis] = slice(start+2,stop+2,step)
all = (slice(None),)*nd slice0 = tupleset(all, axis, slice(start, stop, step)) slice1 = tupleset(all, axis, slice(start+1, stop+1, step)) slice2 = tupleset(all, axis, slice(start+2, stop+2, step))
def _basic_simps(y,start,stop,x,dx,axis): nd = len(y.shape) slice0 = [slice(None)]*nd slice1 = [slice(None)]*nd slice2 = [slice(None)]*nd if start is None: start = 0 step = 2 slice0[axis] = slice(start,stop,step) slice1[axis] = slice(start+1,stop+1,step) slice2[axis] = slice(start+2,stop+2,step) if x is None: # Even ...
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
sl0 = [slice(None)]*nd sl1 = [slice(None)]*nd sl0[axis] = slice(start,stop,step) sl1[axis] = slice(start+1,stop+1,step)
sl0 = tupleset(all, axis, slice(start, stop, step)) sl1 = tupleset(all, axis, slice(start+1, stop+1, step))
def _basic_simps(y,start,stop,x,dx,axis): nd = len(y.shape) slice0 = [slice(None)]*nd slice1 = [slice(None)]*nd slice2 = [slice(None)]*nd if start is None: start = 0 step = 2 slice0[axis] = slice(start,stop,step) slice1[axis] = slice(start+1,stop+1,step) slice2[axis] = slice(start+2,stop+2,step) if x is None: # Even ...
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
slice1 = [slice(None)]*nd slice2 = [slice(None)]*nd
slice1 = (slice(None),)*nd slice2 = (slice(None),)*nd
def simps(y, x=None, dx=1, axis=-1, even='avg'): """Integrate y(x) using samples along the given axis and the composite Simpson's rule. If x is None, spacing of dx is assumed. If there are an even number of samples, N, then there are an odd number of intervals (N-1), but Simpson's rule requires an even number of inte...
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
slice1[axis] = -1 slice2[axis] = -2
slice1 = tupleset(slice1, axis, -1) slice2 = tupleset(slice2, axis, -2)
def simps(y, x=None, dx=1, axis=-1, even='avg'): """Integrate y(x) using samples along the given axis and the composite Simpson's rule. If x is None, spacing of dx is assumed. If there are an even number of samples, N, then there are an odd number of intervals (N-1), but Simpson's rule requires an even number of inte...
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
slice1[axis] = 0 slice2[axis] = 1
slice1 = tupleset(slice1, axis, 0) slice2 = tupleset(slice2, axis, 1)
def simps(y, x=None, dx=1, axis=-1, even='avg'): """Integrate y(x) using samples along the given axis and the composite Simpson's rule. If x is None, spacing of dx is assumed. If there are an even number of samples, N, then there are an odd number of intervals (N-1), but Simpson's rule requires an even number of inte...
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
first_dx = x[slice2] - x[slice1]
first_dx = x[tuple(slice2)] - x[tuple(slice1)]
def simps(y, x=None, dx=1, axis=-1, even='avg'): """Integrate y(x) using samples along the given axis and the composite Simpson's rule. If x is None, spacing of dx is assumed. If there are an even number of samples, N, then there are an odd number of intervals (N-1), but Simpson's rule requires an even number of inte...
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
slice0 = [slice(None)]*nd slice0[axis] = 0 slicem1 = [slice(None)]*nd slicem1[axis] = -1
all = (slice(None),) * nd slice0 = tupleset(all, axis, 0) slicem1 = tupleset(all, axis, -1)
def romb(y, dx=1.0, axis=-1, show=0): """Uses Romberg integration to integrate y(x) using N samples along the given axis which are assumed equally spaced with distance dx. The number of samples must be 1 + a non-negative power of two: N=2**k + 1 """ y = asarray(y) nd = len(y.shape) Nsamps = y.shape[axis] Ninterv = Nsam...
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
slice_R = [slice(None)]*nd
slice_R = all
def romb(y, dx=1.0, axis=-1, show=0): """Uses Romberg integration to integrate y(x) using N samples along the given axis which are assumed equally spaced with distance dx. The number of samples must be 1 + a non-negative power of two: N=2**k + 1 """ y = asarray(y) nd = len(y.shape) Nsamps = y.shape[axis] Ninterv = Nsam...
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
slice_R[axis] = slice(start,stop,step)
slice_R = tupleset(slice_R, slice(start,stop,step))
def romb(y, dx=1.0, axis=-1, show=0): """Uses Romberg integration to integrate y(x) using N samples along the given axis which are assumed equally spaced with distance dx. The number of samples must be 1 + a non-negative power of two: N=2**k + 1 """ y = asarray(y) nd = len(y.shape) Nsamps = y.shape[axis] Ninterv = Nsam...
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
argument 'n' indicates the number of rows (observations).
argument 'nrow' indicates the number of rows (observations).
def __call__(self, *args, **kw):
6b8747cc05d30f8fdf74d465a68286f5b4d1cfdf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/6b8747cc05d30f8fdf74d465a68286f5b4d1cfdf/formula.py
elif nrow <= 1:
elif nrow <= 1:
def __call__(self, *args, **kw):
6b8747cc05d30f8fdf74d465a68286f5b4d1cfdf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/6b8747cc05d30f8fdf74d465a68286f5b4d1cfdf/formula.py
allvals = I(nrow=nrow)
allvals = I(nrow=nrow)
def __call__(self, *args, **kw):
6b8747cc05d30f8fdf74d465a68286f5b4d1cfdf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/6b8747cc05d30f8fdf74d465a68286f5b4d1cfdf/formula.py
if (nzmax>0) and (max(self.rowind[:nnz]) >= M):
if (nzmax < nnz): raise ValueError, "Nzmax must not be less than nnz." if (nnz>0) and (max(self.rowind[:nnz]) >= M):
def _check(self): M,N = self.shape nnz = self.indptr[-1] nzmax = len(self.rowind)
40c0a6da933b8818f7693a49ace1b684ee2f68a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/40c0a6da933b8818f7693a49ace1b684ee2f68a1/Sparse.py
if (len(self.colind)>0) and (max(self.colind) >= N):
if (nzmax < nnz): raise ValueError, "Nzmax must not be less than nnz." if (nnz>0) and (max(self.colind[:nnz]) >= M):
def _check(self): M,N = self.shape if (rank(self.data) != 1) or (rank(self.colind) != 1) or \ (rank(self.indptr) != 1): raise ValueError, "Data, colind, and indptr arrays "\ "should be rank 1." if (len(self.data) != len(self.colind)): raise ValueError, "Data and row list should have same length" if (len(self.indptr) !=...
40c0a6da933b8818f7693a49ace1b684ee2f68a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/40c0a6da933b8818f7693a49ace1b684ee2f68a1/Sparse.py
"""Minimze Description: Optimize the function, f, whose gradient is given by fprime using the
"""Description: Minimize the function, f, whose gradient is given by fprime using the
def fmin_ncg(f, x0, fprime, fhess_p=None, fhess=None, args=(), avextol=1e-5, maxiter=None, full_output=0, disp=1): """Minimze Description: Optimize the function, f, whose gradient is given by fprime using the Newton-CG method. fhess_p must compute the hessian times an arbitrary vector. If it is not given, finite-diff...
a63dd27d75aee7baf1a6851a2867c8ab0ecce2ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/a63dd27d75aee7baf1a6851a2867c8ab0ecce2ed/optimize.py
save_file = './saved_values.py' if not os.path.exists(save_file): save_file = '../saved_values.py'
x11_info = get_x11_info() if not x11_info: return
def configuration(parent_package=''): """ gist only works with an X-windows server This will install *.gs and *.gp files to '%spython%s/site-packages/scipy/xplt' % (sys.prefix,sys.version[:3]) """ # Check for X11 libraries save_file = './saved_values.py' if not os.path.exists(save_file): save_file = '../saved_values.py...
31e157edcd789970d7fb0cb71695464a27e75d3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/31e157edcd789970d7fb0cb71695464a27e75d3c/setup_xplt.py
try: exec(open(save_file).read()) try: X11 = X11 except NameError: X11 = check_and_save() except IOError: X11 = check_and_save() if X11: config = default_config_dict()
config = default_config_dict('xplt',parent_package) local_path = get_path(__name__) sources = ['gistCmodule.c'] sources = [os.path.join(local_path,x) for x in sources] ext = Extension(dot_join(parent_package,'xplt.gistC'), sources, include_dirs = x11_info.get('include_dirs',[]), library_dirs = x11_info.get('library_d...
def configuration(parent_package=''): """ gist only works with an X-windows server This will install *.gs and *.gp files to '%spython%s/site-packages/scipy/xplt' % (sys.prefix,sys.version[:3]) """ # Check for X11 libraries save_file = './saved_values.py' if not os.path.exists(save_file): save_file = '../saved_values.py...
31e157edcd789970d7fb0cb71695464a27e75d3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/31e157edcd789970d7fb0cb71695464a27e75d3c/setup_xplt.py
if parent_package: parent_package = parent_package + '.' local_path = get_path(__name__) config['packages'].append(parent_package+'xplt') from scipy_distutils.core import Extension sources = ['gistCmodule.c'] sources = [os.path.join(local_path,x) for x in sources] ext = Extension(parent_package+'xplt.gistC', sources...
if __name__ == '__main__': from scipy_distutils.core import setup setup(**configuration())
def configuration(parent_package=''): """ gist only works with an X-windows server This will install *.gs and *.gp files to '%spython%s/site-packages/scipy/xplt' % (sys.prefix,sys.version[:3]) """ # Check for X11 libraries save_file = './saved_values.py' if not os.path.exists(save_file): save_file = '../saved_values.py...
31e157edcd789970d7fb0cb71695464a27e75d3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/31e157edcd789970d7fb0cb71695464a27e75d3c/setup_xplt.py
pass
def check_basic(self):
2d2964b0362ae2bdda2dfd5cdb7fa1f254a400f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2d2964b0362ae2bdda2dfd5cdb7fa1f254a400f2/test_stats.py
cond = 1-isnan(arr1d) x = sort(compress(cond,arr1d)) return median(x)
cond = 1-isnan(arr1d) x = sort(compress(cond,arr1d)) return median(x)
def _nanmedian(arr1d): # This only works on 1d arrays cond = 1-isnan(arr1d) x = sort(compress(cond,arr1d)) return median(x)
3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041/stats.py
"""Returns several descriptive statistics of the passed array. Axis can equal None (ravel array first), or an integer (the axis over which to operate) Returns: n, (min,max), mean, standard deviation, skew, kurtosis """ a, axis = _chk_asarray(a, axis) n = a.shape[axis] mm = (minimum.reduce(a),maximum.reduce(a)) m = me...
"""Returns several descriptive statistics of the passed array. Axis can equal None (ravel array first), or an integer (the axis over which to operate) Returns: n, (min,max), mean, standard deviation, skew, kurtosis """ a, axis = _chk_asarray(a, axis) n = a.shape[axis] mm = (minimum.reduce(a),maximum.reduce(a)) m = me...
def describe(a,axis=0): """Returns several descriptive statistics of the passed array. Axis can equal None (ravel array first), or an integer (the axis over which to operate) Returns: n, (min,max), mean, standard deviation, skew, kurtosis """ a, axis = _chk_asarray(a, axis) n = a.shape[axis] mm = (minimum.reduce(a),m...
3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041/stats.py
""" RESTRICTS NOTHING (i.e., FULL MODEL CALCULATION). Subtracts D-variable cell-mean for each between-subj group and then calculates the SS array. """ workd = subtr_cellmeans(workd,subjslots) sserr = multivar_SScalc(workd) return sserr
""" RESTRICTS NOTHING (i.e., FULL MODEL CALCULATION). Subtracts D-variable cell-mean for each between-subj group and then calculates the SS array. """ workd = subtr_cellmeans(workd,subjslots) sserr = multivar_SScalc(workd) return sserr
def d_full_model(workd,subjslots): """ RESTRICTS NOTHING (i.e., FULL MODEL CALCULATION). Subtracts D-variable
3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041/stats.py
""" RESTRICTS GRAND MEA Subtracts D-variable cell-mean for each between- subj group, and then adds back each D-variable's grand mean. """ errors = subtr_cellmeans(workd,subjslots) grandDmeans = expand_dims(mean(workd,0),0) errors = errors + transpose(grandDmeans) sserr = multivar_SScalc(errors) return sserr
""" RESTRICTS GRAND MEA Subtracts D-variable cell-mean for each between- subj group, and then adds back each D-variable's grand mean. """ errors = subtr_cellmeans(workd,subjslots) grandDmeans = expand_dims(mean(workd,0),0) errors = errors + transpose(grandDmeans) sserr = multivar_SScalc(errors) return sserr
def d_restrict_mean(workd,subjslots): """ RESTRICTS GRAND MEA Subtracts D-variable cell-mean for each between-
3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041/stats.py
"""
"""
def d_restrict_source(workd,subjslots,source): """
3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041/stats.py
global D if source > 0: sourcewithins = (source-1) & Bwithins sourcebetweens = (source-1) & Bbetweens dindex = Bwonly_sources.index(sourcewithins) all_cellmeans = transpose(DM[dindex],[-1]+range(0,len(DM[dindex].shape)-1)) all_cellns = transpose(DN[dindex],[-1]+range(0,len(DN[dindex].shape)-1)) hn = hmean(all_cellns, N...
global D if source > 0: sourcewithins = (source-1) & Bwithins sourcebetweens = (source-1) & Bbetweens dindex = Bwonly_sources.index(sourcewithins) all_cellmeans = transpose(DM[dindex],[-1]+range(0,len(DM[dindex].shape)-1)) all_cellns = transpose(DN[dindex],[-1]+range(0,len(DN[dindex].shape)-1)) hn = hmean(all_cellns, N...
def d_restrict_source(workd,subjslots,source): """
3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041/stats.py
def d_restrict_source(workd,subjslots,source): """
3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/3bb739baad4fb4f21aa19b39fbb10f6aa5c1a041/stats.py