rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
self.dtype.char = self.data.dtype.char | self.dtype = self.data.dtype | def _check(self): M, N = self.shape nnz = self.indptr[-1] nzmax = len(self.colind) 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) != nzmax): raise ValueError, "data and row list should have... | 755141cd47edbf647cfcd8d09fd47ede3320459c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/755141cd47edbf647cfcd8d09fd47ede3320459c/sparse.py |
self.dtype.char = self.data.dtype.char | self.dtype = self.data.dtype | def _check(self): M, N = self.shape nnz = self.indptr[-1] nzmax = len(self.colind) 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) != nzmax): raise ValueError, "data and row list should have... | 755141cd47edbf647cfcd8d09fd47ede3320459c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/755141cd47edbf647cfcd8d09fd47ede3320459c/sparse.py |
new.dtype.char = new.data.dtype.char | new.dtype = new.data.dtype | def __mul__(self, other): """ Scalar, vector, or matrix multiplication """ if isscalar(other) or (isdense(other) and rank(other)==0): new = self.copy() new.data = other * new.data # allows type conversion new.dtype.char = new.data.dtype.char new.ftype = _transtabl[new.dtype.char] return new else: return self.do... | 755141cd47edbf647cfcd8d09fd47ede3320459c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/755141cd47edbf647cfcd8d09fd47ede3320459c/sparse.py |
new.dtype.char = new.data.dtype.char | new.dtype = new.data.dtype | def __rmul__(self, other): # other * self if isscalar(other) or (isdense(other) and rank(other)==0): new = self.copy() new.data = other * new.data # allows type conversion new.dtype.char = new.data.dtype.char new.ftype = _transtabl[new.dtype.char] return new else: other = asarray(other) return self.transpose()... | 755141cd47edbf647cfcd8d09fd47ede3320459c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/755141cd47edbf647cfcd8d09fd47ede3320459c/sparse.py |
new.dtype.char = new.data.dtype.char | new.dtype = new.data.dtype | def __pow__(self, other): """ Element-by-element power (unless other is a scalar, in which case return the matrix power.) """ if isscalar(other) or (isdense(other) and rank(other)==0): new = self.copy() new.data = new.data ** other new.dtype.char = new.data.dtype.char new.ftype = _transtabl[new.dtype.char] return new e... | 755141cd47edbf647cfcd8d09fd47ede3320459c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/755141cd47edbf647cfcd8d09fd47ede3320459c/sparse.py |
new = csc_matrix((N, M), nzmax=self.nzmax, dtype=self.dtype.char) | new = csc_matrix((N, M), nzmax=self.nzmax, dtype=self.dtype) | def transpose(self, copy=False): M, N = self.shape new = csc_matrix((N, M), nzmax=self.nzmax, dtype=self.dtype.char) if copy: new.data = self.data.copy() new.rowind = self.colind.copy() new.indptr = self.indptr.copy() else: new.data = self.data new.rowind = self.colind new.indptr = self.indptr new._check() return new | 755141cd47edbf647cfcd8d09fd47ede3320459c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/755141cd47edbf647cfcd8d09fd47ede3320459c/sparse.py |
new = csr_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtype.char) | new = csr_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtype) | def copy(self): new = csr_matrix(self.shape, nzmax=self.nzmax, dtype=self.dtype.char) new.data = self.data.copy() new.colind = self.colind.copy() new.indptr = self.indptr.copy() new._check() return new | 755141cd47edbf647cfcd8d09fd47ede3320459c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/755141cd47edbf647cfcd8d09fd47ede3320459c/sparse.py |
self.dtype.char = self.data.dtype.char | self.dtype = self.data.dtype | def __init__(self, obj, ij_in, dims=None, nzmax=None, dtype=None): spmatrix.__init__(self) try: # Assume the first calling convention # assert len(ij) == 2 if len(ij_in) != 2: if isdense( ij_in ) and (ij_in.shape[1] == 2): ij = (ij_in[:,0], ij_in[:,1]) else: raise AssertionError else: ij = ij_in if dims is N... | 755141cd47edbf647cfcd8d09fd47ede3320459c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/755141cd47edbf647cfcd8d09fd47ede3320459c/sparse.py |
self.data = array(data, self.dtype.char) | self.data = array(data, self.dtype) | def _normalize(self, rowfirst=False): if rowfirst: l = zip(self.row, self.col, self.data) l.sort() row, col, data = list(itertools.izip(*l)) return data, row, col if getattr(self, '_is_normalized', None): return self.data, self.row, self.col l = zip(self.col, self.row, self.data) l.sort() col, row, data = list(itertool... | 755141cd47edbf647cfcd8d09fd47ede3320459c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/755141cd47edbf647cfcd8d09fd47ede3320459c/sparse.py |
if xb is None: xb=x[0] if xe is None: xe=x[-1] | if xb is None: xb=x.min() if xe is None: xe=x.max() | def splrep(x,y,w=None,xb=None,xe=None,k=3,task=0,s=None,t=None, full_output=0,nest=None,per=0,quiet=1): """Find the B-spline representation of 1-D curve. Description: Given the set of data points (x[i], y[i]) determine a smooth spline approximation of degree k on the interval xb <= x <= xe. The coefficients, c, and ... | 765182827eb04adbfb9c0419d9d947b712c20cb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/765182827eb04adbfb9c0419d9d947b712c20cb8/fitpack.py |
if xb is None: xb=x[0] if xe is None: xe=x[-1] if yb is None: yb=y[0] if ye is None: ye=y[-1] | if xb is None: xb=x.min() if xe is None: xe=x.max() if yb is None: yb=y.min() if ye is None: ye=y.max() | def bisplrep(x,y,z,w=None,xb=None,xe=None,yb=None,ye=None,kx=3,ky=3,task=0,s=None, eps=1e-16,tx=None,ty=None,full_output=0,nxest=None,nyest=None,quiet=1): """Find a bivariate B-spline representation of a surface. Description: Given a set of data points (x[i], y[i], z[i]) representing a surface z=f(x,y), compute a B-s... | 765182827eb04adbfb9c0419d9d947b712c20cb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/765182827eb04adbfb9c0419d9d947b712c20cb8/fitpack.py |
self.file.tell() | return self.file.tell() | def tell(self): self.file.tell() | 4cb2f9dbed4a97a819a3f802aebaea2f1a6818c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/4cb2f9dbed4a97a819a3f802aebaea2f1a6818c8/mio.py |
def _get_namespace(self): return self.__namespace or default_namespace | def _get_namespace(self): if isinstance(self.__namespace, N.ndarray): return self.__namespace else: return self.__namespace or default_namespace | def _get_namespace(self): return self.__namespace or default_namespace | 58d9f655e8cd3933b0b78fa33758e7170e41e0aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/58d9f655e8cd3933b0b78fa33758e7170e41e0aa/formula.py |
if result[:11] == 'Bad command' and sys.platform == 'win32': | res = bbox_re.search(result) if res is None and sys.platform=='win32': | def convert_bounding_box(inname, outname): fid = open(inname,'r') oldfile = fid.read() fid.close() gsargs = '-dNOPAUSE -dBATCH -sDEVICE=bbox' # use cygwin gs if present cmd = 'gs %s %s' % (gsargs, inname) w, r = os.popen4(cmd) w.close() result = r.read() r.close() if result[:11] == 'Bad command' and sys.platform == 'wi... | 09d23f7e8e736abc56a2ea5a98859b764df109a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/09d23f7e8e736abc56a2ea5a98859b764df109a3/gist.py |
if result[:11] == 'Bad command': | res = bbox_re.search(result) if res is None: sys.stderr.write('To fix bounding box install ghostscript in the PATH') | def convert_bounding_box(inname, outname): fid = open(inname,'r') oldfile = fid.read() fid.close() gsargs = '-dNOPAUSE -dBATCH -sDEVICE=bbox' # use cygwin gs if present cmd = 'gs %s %s' % (gsargs, inname) w, r = os.popen4(cmd) w.close() result = r.read() r.close() if result[:11] == 'Bad command' and sys.platform == 'wi... | 09d23f7e8e736abc56a2ea5a98859b764df109a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/09d23f7e8e736abc56a2ea5a98859b764df109a3/gist.py |
res = bbox_re.search(result) | def convert_bounding_box(inname, outname): fid = open(inname,'r') oldfile = fid.read() fid.close() gsargs = '-dNOPAUSE -dBATCH -sDEVICE=bbox' # use cygwin gs if present cmd = 'gs %s %s' % (gsargs, inname) w, r = os.popen4(cmd) w.close() result = r.read() r.close() if result[:11] == 'Bad command' and sys.platform == 'wi... | 09d23f7e8e736abc56a2ea5a98859b764df109a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/09d23f7e8e736abc56a2ea5a98859b764df109a3/gist.py | |
print diff | def kmeans_(obs,guess,thresh=1e-5): """* See kmeans Outputs: code_book -- the lowest distortion codebook found. avg_dist -- the average distance a observation is from a code in the book. Lower means the code_book matches the data better. Test: Note: not whitened in this example. >>> features = array([[ 1.9,2.3], ...... | 54fafe1863b2401aeb8b2cfcba3dde51015b6fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/54fafe1863b2401aeb8b2cfcba3dde51015b6fb8/vq.py | |
[0,1,1,1], | [1,1,1,1], | def check_diag(self): assert_equal(tri(4,k=1),array([[1,1,0,0], [1,1,1,0], [0,1,1,1], [1,1,1,1]])) assert_equal(tri(4,k=-1),array([[0,0,0,0], [1,0,0,0], [1,1,0,0], [1,1,1,0]])) | 22efb1b19aa440ab9cf9d8310ee790a0c6130db1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/22efb1b19aa440ab9cf9d8310ee790a0c6130db1/test_basic.py |
assert_equal(tril(a,k=-2),b) | assert_equal(triu(a,k=-2),b) | def check_diag(self): a = (100*get_mat(5)).astype('f') b = a.copy() for k in range(5): for l in range(max((k-1,0)),5): b[l,k] = 0 assert_equal(triu(a,k=2),b) b = a.copy() for k in range(5): for l in range(k+3,5): b[l,k] = 0 assert_equal(tril(a,k=-2),b) | 22efb1b19aa440ab9cf9d8310ee790a0c6130db1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/22efb1b19aa440ab9cf9d8310ee790a0c6130db1/test_basic.py |
def _check_bdtrik(self): assert_equal(cephes.bdtrik(1,3,0.5),3.0) | def check_bdtrik(self): cephes.bdtrik(1,3,0.5) | def _check_bdtrik(self): assert_equal(cephes.bdtrik(1,3,0.5),3.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_chndtrix(self): | def check_chndtrix(self): | def _check_chndtrix(self): assert_equal(cephes.chndtrix(0,1,0),0.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_gdtrib(self): assert_equal(cephes.gdtrib(1,0,1),5.0) | def check_gdtrib(self): cephes.gdtrib(1,0,1) | def _check_gdtrib(self): assert_equal(cephes.gdtrib(1,0,1),5.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_hankel1(self): | def check_hankel1(self): | def _check_hankel1(self): cephes.hankel1(1,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_hankel1e(self): | def check_hankel1e(self): | def _check_hankel1e(self): cephes.hankel1e(1,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_hankel2(self): | def check_hankel2(self): | def _check_hankel2(self): cephes.hankel2(1,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_hankel2e(self): | def check_hankel2e(self): | def _check_hankel2e(self): cephes.hankel2e(1,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_it2i0k0(self): | def check_it2i0k0(self): | def _check_it2i0k0(self): cephes.it2i0k0(1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_it2j0y0(self): | def check_it2j0y0(self): | def _check_it2j0y0(self): cephes.it2j0y0(1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_itairy(self): | def check_itairy(self): | def _check_itairy(self): cephes.itairy(1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def check_ive(self): | def _check_ive(self): | def check_ive(self): assert_equal(cephes.ive(1,0),0.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def check_jve(self): | def _check_jve(self): | def check_jve(self): assert_equal(cephes.jve(0,0),1.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_kei(self): | def check_kei(self): | def _check_kei(self): cephes.kei(2) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_ker(self): | def check_ker(self): | def _check_ker(self): cephes.ker(2) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_kerp(self): | def check_kerp(self): | def _check_kerp(self): cephes.kerp(2) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_mathieu_modcem2(self): | def check_mathieu_modcem2(self): | def _check_mathieu_modcem2(self): cephes.mathieu_modcem2(1,1,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_mathieu_modsem2(self): | def check_mathieu_modsem2(self): | def _check_mathieu_modsem2(self): cephes.mathieu_modsem2(1,1,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def check_modstruve(self): | def _check_modstruve(self): | def check_modstruve(self): assert_equal(cephes.modstruve(1,0),0.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
cephes.nbdtrik(1,1,1) | cephes.nbdtrik(1,.4,.5) | def __check_nbdtrik(self): cephes.nbdtrik(1,1,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_ncfdtr(self): | def check_ncfdtr(self): | def _check_ncfdtr(self): assert_equal(cephes.ncfdtr(1,1,1,0),0.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_ncfdtri(self): | def check_ncfdtri(self): | def _check_ncfdtri(self): assert_equal(cephes.ncfdtri(1,1,1,0),0.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_ncfdtridfd(self): | def check_ncfdtridfd(self): | def _check_ncfdtridfd(self): cephes.ncfdtridfd(1,0.5,0,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_nctdtrit(self): | def check_nctdtrit(self): | def _check_nctdtrit(self): cephes.nctdtrit(.1,0.2,.5) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_nrdtrimn(self): | def check_nrdtrimn(self): | def _check_nrdtrimn(self): assert_equal(cephes.nrdtrimn(0.5,1,1),1.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_nrdtrisd(self): | def check_nrdtrisd(self): | def _check_nrdtrisd(self): assert_equal(cephes.nrdtrisd(0.5,0.5,0.5),0.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_obl_ang1(self): | def check_obl_ang1(self): | def _check_obl_ang1(self): cephes.obl_ang1(1,1,1,0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_obl_ang1_cv(self): assert_equal(cephes.obl_ang1_cv(1,1,1,1,0),(1.0,0.0)) def check_obl_cv(self): | def check_obl_ang1_cv(self): result = cephes.obl_ang1_cv(1,1,1,1,0) assert_almost_equal(result[0],1.0) assert_almost_equal(result[1],0.0) def _check_obl_cv(self): | def _check_obl_ang1_cv(self): assert_equal(cephes.obl_ang1_cv(1,1,1,1,0),(1.0,0.0)) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_obl_rad1(self): | def check_obl_rad1(self): | def _check_obl_rad1(self): cephes.obl_rad1(1,1,1,0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_obl_rad1_cv(self): | def check_obl_rad1_cv(self): | def _check_obl_rad1_cv(self): cephes.obl_rad1_cv(1,1,1,1,0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_pbdv(self): | def check_pbdv(self): | def _check_pbdv(self): assert_equal(cephes.pbdv(1,0),(0.0,0.0)) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_pbvv(self): | def check_pbvv(self): | def _check_pbvv(self): cephes.pbvv(1,0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_pdtrik(self): | def check_pdtrik(self): | def _check_pdtrik(self): cephes.pdtrik(0.5,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_pro_ang1(self): | def check_pro_ang1(self): | def _check_pro_ang1(self): cephes.pro_ang1(1,1,1,0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_pro_ang1_cv(self): | def check_pro_ang1_cv(self): | def _check_pro_ang1_cv(self): assert_equal(cephes.pro_ang1_cv(1,1,1,1,0),(1.0,0.0)) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def check_pro_cv(self): | def _check_pro_cv(self): | def check_pro_cv(self): assert_equal(cephes.pro_cv(1,1,0),2.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
cephes.pro_rad1(1,1,1,0) | cephes.pro_rad1(1,1,1,0.1) | def check_pro_rad1(self): # x>1 gives segfault with ifc, but not with gcc # x<1 returns nan, no segfault cephes.pro_rad1(1,1,1,0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
assert_equal(cephes.smirnov(1,1),0.0) | assert_equal(cephes.smirnov(1,.1),0.9) | def check_smirnov(self): assert_equal(cephes.smirnov(1,1),0.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
assert_equal(cephes.smirnovi(1,0),1.0) | def check_smirnovi(self): assert_almost_equal(cephes.smirnov(1,cephes.smirnovi(1,0.4)),0.4) assert_almost_equal(cephes.smirnov(1,cephes.smirnovi(1,0.6)),0.6) assert_equal(cephes.smirnovi(1,0),1.0) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py | |
def _check_stdtridf(self): | def check_stdtridf(self): | def _check_stdtridf(self): cephes.stdtridf(0.7,1) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
def _check_stdtrit(self): | def check_stdtrit(self): | def _check_stdtrit(self): cephes.stdtrit(1,0.7) | 2a0571808f9b68627e9152f6f1037281e69d9d98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a0571808f9b68627e9152f6f1037281e69d9d98/test_cephes.py |
val *= exp(0.5*gammaln(n-m+1)-gammaln(n+m+1)) | val *= exp(0.5*(gammaln(n-m+1)-gammaln(n+m+1))) | 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*n+1)/4.0/pi) val *= exp(0.5*gammaln(n-m+1)-gammaln(n+m+1)) val *= exp(1... | 10119a8f65df1234fc1da07197fb7e5e98ccd5a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/10119a8f65df1234fc1da07197fb7e5e98ccd5a1/basic.py |
"""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) | """Spherical harmonic of order 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*n+1)/4.0/pi) val *= exp(0.5*(gammaln(n-m+1)-gammaln(n+m+1))) val *= exp... | 997b8fe2b95e9b5cba41b878e2e3f17f856ff0c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/997b8fe2b95e9b5cba41b878e2e3f17f856ff0c0/basic.py |
val = Pmn[m,n] | val = Pmn[-1, -1] | 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*n+1)/4.0/pi) val *= exp(0.5*(gammaln(n-m+1)-gammaln(n+m+1))) val *= exp... | 997b8fe2b95e9b5cba41b878e2e3f17f856ff0c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/997b8fe2b95e9b5cba41b878e2e3f17f856ff0c0/basic.py |
deltax = fontsize*points / 2.8 * DX / DY | deltax = fontsize*points / 2.6 * DX / DY | def legend(text,linetypes=None,lleft=None,color='black',tfont='helvetica',fontsize=14,nobox=0): """Construct and place a legend. Description: Build a legend and place it on the current plot with an interactive prompt. Inputs: text -- A list of strings which document the curves. linetypes -- If not given, then the t... | 2a28b9e78ba8a60ef15cce71697f39697438dfd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/2a28b9e78ba8a60ef15cce71697f39697438dfd6/Mplot.py |
def __init__(self, arg1, dims=None, nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isdense(arg1): # Convert the dense array or matrix arg1 to CSC format if rank(arg1) == 2: s = arg1 if s.dtype.char not in 'fdFD': # Use a double array as the source (but leave it alone) s = s*1.0 if (rank(s) == 2): M, N = ... | f288ca9c08fb1aa89622bce25bb448003735fa54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/f288ca9c08fb1aa89622bce25bb448003735fa54/sparse.py | ||
raise ValueError, "dense array does not have rank 1 or 2" | raise ValueError, "dense array must have rank 1 or 2" | def __init__(self, arg1, dims=None, nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isdense(arg1): # Convert the dense array or matrix arg1 to CSC format if rank(arg1) == 2: s = arg1 if s.dtype.char not in 'fdFD': # Use a double array as the source (but leave it alone) s = s*1.0 if (rank(s) == 2): M, N = ... | f288ca9c08fb1aa89622bce25bb448003735fa54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/f288ca9c08fb1aa89622bce25bb448003735fa54/sparse.py |
else: raise ValueError, "dense array must have rank 1 or 2" | def __init__(self, arg1, dims=None, nzmax=100, dtype='d', copy=False): spmatrix.__init__(self) if isdense(arg1): # Convert the dense array or matrix arg1 to CSR format if rank(arg1) == 2: s = arg1 ocsc = csc_matrix(transpose(s)) self.colind = ocsc.rowind self.indptr = ocsc.indptr self.data = ocsc.data self.shape = (ocs... | f288ca9c08fb1aa89622bce25bb448003735fa54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/f288ca9c08fb1aa89622bce25bb448003735fa54/sparse.py | |
def __getitem__(self, key): | def get(self, key, default=0.): """This overrides the dict.get method, providing type checking but otherwise equivalent functionality. """ try: i, j = key assert isinstance(i, int) and isinstance(j, int) except (AssertionError, TypeError, ValueError): raise IndexError, "index must be a pair of integers" try: assert not... | def __getitem__(self, key): if self._validate: # Sanity checks: key must be a pair of integers if not isinstance(key, tuple) or len(key) != 2: raise TypeError, "key must be a tuple of two integers" if type(key[0]) != int or type(key[1]) != int: raise TypeError, "key must be a tuple of two integers" | f288ca9c08fb1aa89622bce25bb448003735fa54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/f288ca9c08fb1aa89622bce25bb448003735fa54/sparse.py |
def __getitem__(self, key): if self._validate: # Sanity checks: key must be a pair of integers if not isinstance(key, tuple) or len(key) != 2: raise TypeError, "key must be a tuple of two integers" if type(key[0]) != int or type(key[1]) != int: raise TypeError, "key must be a tuple of two integers" | f288ca9c08fb1aa89622bce25bb448003735fa54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/f288ca9c08fb1aa89622bce25bb448003735fa54/sparse.py | ||
class _test_horiz_slicing(ScipyTestCase): | class _test_horiz_slicing: | def check_solve(self): """ Test whether the lu_solve command segfaults, as reported by Nils Wagner for a 64-bit machine, 02 March 2005 (EJS) """ n = 20 A = self.spmatrix((n,n), dtype=complex) x = numpy.rand(n) y = numpy.rand(n-1)+1j*numpy.rand(n-1) r = numpy.rand(n) for i in range(len(x)): A[i,i] = x[i] for i in range(... | 6629c0b7aeb5a52e13a6a827d4efca3e5b354615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/6629c0b7aeb5a52e13a6a827d4efca3e5b354615/test_sparse.py |
class _test_vert_slicing(ScipyTestCase): | class _test_vert_slicing: | def check_get_horiz_slice(self): """Test for new slice functionality (EJS)""" B = asmatrix(arange(50.).reshape(5,10)) A = self.spmatrix(B) assert_array_equal(B[1,:], A[1,:].todense()) assert_array_equal(B[1,2:5], A[1,2:5].todense()) | 6629c0b7aeb5a52e13a6a827d4efca3e5b354615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/6629c0b7aeb5a52e13a6a827d4efca3e5b354615/test_sparse.py |
class _test_fancy_indexing(ScipyTestCase): | class _test_fancy_indexing: | def check_get_vert_slice(self): """Test for new slice functionality (EJS)""" B = asmatrix(arange(50.).reshape(5,10)) A = self.spmatrix(B) assert_array_equal(B[2:5,0], A[2:5,0].todense()) assert_array_equal(B[:,1], A[:,1].todense()) | 6629c0b7aeb5a52e13a6a827d4efca3e5b354615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/6629c0b7aeb5a52e13a6a827d4efca3e5b354615/test_sparse.py |
class test_csr(_test_cs, _test_horiz_slicing): | class test_csr(_test_cs, _test_horiz_slicing, ScipyTestCase): | def check_fancy_indexing(self): """Test for new indexing functionality""" B = ones((5,10), float) A = dok_matrix(B) # Write me! # Both slicing and fancy indexing: not yet supported # assert_array_equal(B[(1,2),:], A[(1,2),:].todense()) # assert_array_equal(B[(1,2,3),:], A[(1,2,3),:].todense()) | 6629c0b7aeb5a52e13a6a827d4efca3e5b354615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/6629c0b7aeb5a52e13a6a827d4efca3e5b354615/test_sparse.py |
class test_csc(_test_cs, _test_vert_slicing): | class test_csc(_test_cs, _test_vert_slicing, ScipyTestCase): | def check_empty(self): """Test manipulating empty matrices. Fails in SciPy SVN <= r1768 """ # This test should be made global (in _test_cs), but first we # need a uniform argument order / syntax for constructing an # empty sparse matrix. (coo_matrix is currently different). shape = (5, 5) for mytype in [float32, float6... | 6629c0b7aeb5a52e13a6a827d4efca3e5b354615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/6629c0b7aeb5a52e13a6a827d4efca3e5b354615/test_sparse.py |
class test_dok(_test_cs): | class test_dok(_test_cs, ScipyTestCase): | def check_empty(self): """Test manipulating empty matrices. Fails in SciPy SVN <= r1768 """ # This test should be made global (in _test_cs), but first we # need a uniform argument order / syntax for constructing an # empty sparse matrix. (coo_matrix is currently different). shape = (5, 5) for mytype in [float32, float6... | 6629c0b7aeb5a52e13a6a827d4efca3e5b354615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/6629c0b7aeb5a52e13a6a827d4efca3e5b354615/test_sparse.py |
class test_lil(_test_cs, _test_horiz_slicing): | class test_lil(_test_cs, _test_horiz_slicing, ScipyTestCase): | def check_set_slice(self): """Test for slice functionality (EJS)""" A = dok_matrix((5,10)) B = zeros((5,10), float) A[:,0] = 1 B[:,0] = 1 assert_array_equal(A.todense(), B) A[1,:] = 2 B[1,:] = 2 assert_array_equal(A.todense(), B) A[:,:] = 3 B[:,:] = 3 assert_array_equal(A.todense(), B) A[1:5, 3] = 4 B[1:5, 3] = 4 asser... | 6629c0b7aeb5a52e13a6a827d4efca3e5b354615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/6629c0b7aeb5a52e13a6a827d4efca3e5b354615/test_sparse.py |
totalname = name apath, basename = os.path.split(name) name = name + ".ps" | if ignore == '.eps': totalname = name else: totalname = name + ignore apath, basename = os.path.split(totalname) name = totalname + ".ps" | def eps(name, epsi=0, pdf=0): """ Write the picture in the current graphics window to the Encapsulated PostScript file NAME+".eps" (i.e.- the suffix .eps is added to NAME). The last extension of name is stripped to avoid .eps.eps files If epsi is 1, this function requires the ps2epsi utility which comes with the proje... | 701bf46873e09577172ce8d5a42e8183f5f54667 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/701bf46873e09577172ce8d5a42e8183f5f54667/gist.py |
res = os.system ("ps2epsi " + name) | res = os.system ("ps2epsi " + totalname) | def eps(name, epsi=0, pdf=0): """ Write the picture in the current graphics window to the Encapsulated PostScript file NAME+".eps" (i.e.- the suffix .eps is added to NAME). The last extension of name is stripped to avoid .eps.eps files If epsi is 1, this function requires the ps2epsi utility which comes with the proje... | 701bf46873e09577172ce8d5a42e8183f5f54667 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/701bf46873e09577172ce8d5a42e8183f5f54667/gist.py |
os.remove(name) | os.remove(totalname) | def eps(name, epsi=0, pdf=0): """ Write the picture in the current graphics window to the Encapsulated PostScript file NAME+".eps" (i.e.- the suffix .eps is added to NAME). The last extension of name is stripped to avoid .eps.eps files If epsi is 1, this function requires the ps2epsi utility which comes with the proje... | 701bf46873e09577172ce8d5a42e8183f5f54667 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/701bf46873e09577172ce8d5a42e8183f5f54667/gist.py |
0.51053920]),8) | 0.51053919]),8) | def check_airy(self): | 1c136da30cb76cb9a2ee8c41c758d3b40c779b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/1c136da30cb76cb9a2ee8c41c758d3b40c779b5b/test_basic.py |
for n in range(4): | for n in range(2): | def check_airye(self): | 1c136da30cb76cb9a2ee8c41c758d3b40c779b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/1c136da30cb76cb9a2ee8c41c758d3b40c779b5b/test_basic.py |
assert_array_almost_equal(a,b1,5) | for n in range(2,4): b1[n] = b[n]*exp(-abs(real(2.0/3.0*0.01*sqrt(0.01)))) assert_array_almost_equal(a,b1,6) | def check_airye(self): | 1c136da30cb76cb9a2ee8c41c758d3b40c779b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/1c136da30cb76cb9a2ee8c41c758d3b40c779b5b/test_basic.py |
numstring = arange(0,2.2,.1) | numstring = arange(0,2.21,.1) | def check_arange(self): numstring = arange(0,2.2,.1) assert_equal(numstring,array([0.,0.1,0.2,0.3, 0.4,0.5,0.6,0.7, 0.8,0.9,1.,1.1, 1.2,1.3,1.4,1.5, 1.6,1.7,1.8,1.9, 2.,2.1])) numstringa = arange(3,4,.3) assert_array_equal(numstringa, array([3.,3.3,3.6,3.9])) numstringb = arange(3,27,3) assert_array_equal(numstringb,ar... | 1c136da30cb76cb9a2ee8c41c758d3b40c779b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/1c136da30cb76cb9a2ee8c41c758d3b40c779b5b/test_basic.py |
2.,2.1])) | 2.,2.1,2.2])) | def check_arange(self): numstring = arange(0,2.2,.1) assert_equal(numstring,array([0.,0.1,0.2,0.3, 0.4,0.5,0.6,0.7, 0.8,0.9,1.,1.1, 1.2,1.3,1.4,1.5, 1.6,1.7,1.8,1.9, 2.,2.1])) numstringa = arange(3,4,.3) assert_array_equal(numstringa, array([3.,3.3,3.6,3.9])) numstringb = arange(3,27,3) assert_array_equal(numstringb,ar... | 1c136da30cb76cb9a2ee8c41c758d3b40c779b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/1c136da30cb76cb9a2ee8c41c758d3b40c779b5b/test_basic.py |
assert_array_equal(numstringb,array([3.,6.,9.,12., 15.,18.,21.,24.,27.])) | assert_array_equal(numstringb,array([3,6,9,12, 15,18,21,24])) | def check_arange(self): numstring = arange(0,2.2,.1) assert_equal(numstring,array([0.,0.1,0.2,0.3, 0.4,0.5,0.6,0.7, 0.8,0.9,1.,1.1, 1.2,1.3,1.4,1.5, 1.6,1.7,1.8,1.9, 2.,2.1])) numstringa = arange(3,4,.3) assert_array_equal(numstringa, array([3.,3.3,3.6,3.9])) numstringb = arange(3,27,3) assert_array_equal(numstringb,ar... | 1c136da30cb76cb9a2ee8c41c758d3b40c779b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/1c136da30cb76cb9a2ee8c41c758d3b40c779b5b/test_basic.py |
assert_array_equal(a,z) | assert_array_equal(a,x) | def check_array(self): x = array([1,2,3,4]) y = array([1,2,3,4]) z = x*y assert_array_equal(z,array([1,4,9,16])) a = arange(1,5,1) assert_array_equal(a,z) | 1c136da30cb76cb9a2ee8c41c758d3b40c779b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/1c136da30cb76cb9a2ee8c41c758d3b40c779b5b/test_basic.py |
suites.append( unittest.makeSuite(test_airy,'check_') ) suites.append( unittest.makeSuite(test_airye,'check_') ) suites.append( unittest.makeSuite(test_arange,'check_') ) | def test_suite(level=1): suites = [] if level > 0: | 1c136da30cb76cb9a2ee8c41c758d3b40c779b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/1c136da30cb76cb9a2ee8c41c758d3b40c779b5b/test_basic.py | |
suites.append( unittest.makeSuite(test_array,'check_') ) | def test_suite(level=1): suites = [] if level > 0: | 1c136da30cb76cb9a2ee8c41c758d3b40c779b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/1c136da30cb76cb9a2ee8c41c758d3b40c779b5b/test_basic.py | |
def test_suite(level=1): suites = [] if level > 0: | 1c136da30cb76cb9a2ee8c41c758d3b40c779b5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/1c136da30cb76cb9a2ee8c41c758d3b40c779b5b/test_basic.py | ||
def resize1d(arr, newlen): old = len(arr) new = zeros((newlen,),arr.typecode()) new[:old] = arr return new | 8df110dd1fa965e65fcb0c5bb92bcf9ed5376850 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8df110dd1fa965e65fcb0c5bb92bcf9ed5376850/Sparse.py | ||
'sss':[5,"Symmetric Sparse Skyline"], | 'sss':[5,"Symmetric Sparse Skyline"], | def resize1d(arr, newlen): old = len(arr) new = zeros((newlen,),arr.typecode()) new[:old] = arr return new | 8df110dd1fa965e65fcb0c5bb92bcf9ed5376850 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8df110dd1fa965e65fcb0c5bb92bcf9ed5376850/Sparse.py |
def _convert_data(data1,data2,newtype): if data1.typecode() != newtype: data1 = data1.astype(newtype) if data2.typecode() != newtype: data2 = data2.astype(newtype) return data1, data2 | 8df110dd1fa965e65fcb0c5bb92bcf9ed5376850 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8df110dd1fa965e65fcb0c5bb92bcf9ed5376850/Sparse.py | ||
s = asarray(s) if s.typecode() not in 'fdFD': s = s*1.0 | 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: ... | 8df110dd1fa965e65fcb0c5bb92bcf9ed5376850 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8df110dd1fa965e65fcb0c5bb92bcf9ed5376850/Sparse.py | |
a = spmatrix(arange(1,9),[0,1,1,2,2,3,3,4],[0,1,3,0,2,3,4,4]) | a = csc_matrix(arange(1,9),ij=transpose([[0,1,1,2,2,3,3,4],[0,1,3,0,2,3,4,4]])) | def lu_factor(A, permc_spec=2, diag_pivot_thresh=1.0, drop_tol=0.0, relax=1, panel_size=10): M,N = A.shape if (M != N): raise ValueError, "Can only factor square matrices." csc = A.tocsc() gstrf = eval('_superlu.' + csc.ftype + 'gstrf') return gstrf(N,csc.nnz,csc.data,csc.rowind,csc.indptr,permc_spec, diag_pivot_thresh... | 8df110dd1fa965e65fcb0c5bb92bcf9ed5376850 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/8df110dd1fa965e65fcb0c5bb92bcf9ed5376850/Sparse.py |
xplt.plot(x0,y0,type,x1,y1,type,hold=1) | plot(x0,y0,type,x1,y1,type,hold=1) | def axes(type='b|'): vals = gist.limits() x0 = [vals[0],vals[1]] y0 = [0,0] x1 = [0,0] y1 = [vals[2], vals[3]] xplt.plot(x0,y0,type,x1,y1,type,hold=1) | 650923c5febe6d0f55f399a87a250ba0edb3dd6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/650923c5febe6d0f55f399a87a250ba0edb3dd6e/Mplot.py |
hist = scipy.histogram | from scipy.stats import histogram as hist | def histogram(data,nbins=80,range=None,ntype=0,bar=1,bwidth=0.8,bcolor=0): """Plot a histogram. ntype is the normalization type. Use ntype == 2 to compare with probability density function. """ h = SSH.histogram(data,nbins,range) if ntype == 1: h.normalize() elif ntype == 2: h.normalizeArea() if bar: barplot(h[:,0],h... | 7b561c3e05c41abc94290c9f55f0c1d8584fce0d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/7b561c3e05c41abc94290c9f55f0c1d8584fce0d/Mplot.py |
approx_grad = False, | approx_grad=0, | def fmin_l_bfgs_b(func, x0, fprime=None, args=(), approx_grad = False, bounds=None, m=10, factr=1e7, pgtol=1e-5, epsilon=1e-8, iprint=-1, maxfun=15000): """ Minimize a function func using the L-BFGS-B algorithm. Arguments: func -- function to minimize. Called as func(x, *args) x0 -- initial guess to minimum ... | e8cf5e3ae8a7210059a0ad2e7db3c2e41cef4ca9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/e8cf5e3ae8a7210059a0ad2e7db3c2e41cef4ca9/lbfgsb.py |
x, f, d = fmin_l_bfgs_b(func, x0, approx_grad=True, | x, f, d = fmin_l_bfgs_b(func, x0, approx_grad=1, | def grad(x): g = NA.zeros(x.shape, NA.Float) t1 = x[1] - x[0]**2 g[0] = 2*(x[0]-1) - 16*x[0]*t1 for i in range(1, g.shape[0]-1): t2 = t1 t1 = x[i+1] - x[i]**2 g[i] = 8*t2 - 16*x[i]*t1 g[-1] = 8*t1 return g | e8cf5e3ae8a7210059a0ad2e7db3c2e41cef4ca9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/e8cf5e3ae8a7210059a0ad2e7db3c2e41cef4ca9/lbfgsb.py |
"""Convolve two N-dimensional arrays using FFT. SEE convolve | """Convolve two N-dimensional arrays using FFT. See convolve. | def fftconvolve(in1, in2, mode="full"): """Convolve two N-dimensional arrays using FFT. SEE convolve """ s1 = array(in1.shape) s2 = array(in2.shape) if (s1.dtype.char in ['D','F']) or (s2.dtype.char in ['D', 'F']): cmplx=1 else: cmplx=0 size = s1+s2-1 IN1 = fftn(in1,size) IN1 *= fftn(in2,size) ret = ifftn(IN1) del IN1 ... | 936da8591e6b92539aeda1c0c884ca93d37a2754 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/936da8591e6b92539aeda1c0c884ca93d37a2754/signaltools.py |
if (Numeric.product(kernel.shape) > Numeric.product(volume.shape)): | if (product(kernel.shape) > product(volume.shape)): | def convolve(in1, in2, mode='full'): """Convolve two N-dimensional arrays. Description: Convolve in1 and in2 with output size determined by mode. Inputs: in1 -- an N-dimensional array. in2 -- an array with the same number of dimensions as in1. mode -- a flag indicating the size of the output 'valid' (0): The outpu... | 936da8591e6b92539aeda1c0c884ca93d37a2754 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/936da8591e6b92539aeda1c0c884ca93d37a2754/signaltools.py |
domain = Numeric.ones(kernel_size) numels = Numeric.product(kernel_size) | domain = ones(kernel_size) numels = product(kernel_size) | def medfilt(volume,kernel_size=None): """Perform a median filter on an N-dimensional array. Description: Apply a median filter to the input array using a local window-size given by kernel_size. Inputs: in -- An N-dimensional input array. kernel_size -- A scalar or an N-length list giving the size of the median filt... | 936da8591e6b92539aeda1c0c884ca93d37a2754 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/936da8591e6b92539aeda1c0c884ca93d37a2754/signaltools.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.