Make sure arrays are big enough to add the specified number of points
Definition at line 299 of file fitting_toolkit.py. 00299 : 00300 "make sure arrays are big enough to add the specified number of points" 00301 if not self.arraysexist: 00302 if operator.isSequenceType(sample_x): 00303 self.arg_count=len(sample_x) 00304 else: 00305 self.arg_count=1 00306 self.frozen=zeros(self.param_count) 00307 self.xarray=zeros((self.arg_count, self.pointhint), self.atype) 00308 self.yarray=zeros(self.pointhint, self.atype ) 00309 self.currentlen=self.pointhint 00310 self.arraysexist=1 00311 00312 if self.pointcount+points_to_add >= self.currentlen: 00313 #expand arrays to accept more data 00314 realmax = max(2*self.currentlen, self.currentlen+2*points_to_add) 00315 xarray=zeros((self.arg_count, realmax ), self.atype) 00316 yarray=zeros(realmax, self.atype) 00317 xarray[:, :self.pointcount]=self.xarray[:,:self.pointcount] 00318 yarray[:self.pointcount]=self.yarray[:self.pointcount] 00319 self.xarray=xarray 00320 self.yarray=yarray 00321 self.currentlen=realmax 00322 ##
|