def GetSamplingGrid (   self,
  xmin,
  xmax 
)

Extract the list of 'interesting' points from the sampling grid which lie in the requested domain, including q point at each endpoint.

Parameters:
xmin the lower bound for the grid.
xmax the upper bound for the grid.
Returns:
a list of points at which to start looking at the function.

Definition at line 452 of file C2Functions.py.

00452                                          :
00453         "get a set of points, including xmin and xmax, which are reasonable points to evaluate the function between them"
00454         if self.sampling_grid is None or xmin > self.sampling_grid[-1] or xmax < self.sampling_grid[0]:
00455             pass
00456             return (xmin, xmax) #dont really have any information on the funciton in this interval.
00457         else:
00458 
00459             sg=self.sampling_grid
00460             
00461             firstindex, lastindex=_numeric.searchsorted(sg, (xmin, xmax))
00462     
00463             grid=[xmin]+list(sg[firstindex:lastindex])+[xmax] #insert points  from source grid to destination into the middle of our grid
00464             
00465             if len(grid) > 2 : #attempt to clear out points put too close together at the beginning, if we have at least three points
00466                 x0, x1, x2 = grid[:3]
00467                 ftol=10.0*(1e-14*(abs(x0)+abs(x1))+1e-300)
00468                 if (x1-x0) < ftol or (x1-x0) < 0.1*(x2-x0): del grid[1] #remove collision
00469             
00470             if len(grid) > 2 : #attempt to clear out points put too close together at the end, if we have at least three points
00471                 x0, x1, x2 = grid[-3:]
00472                 ftol=10.0*(1e-14*(abs(x0)+abs(x2))+1e-300)
00473                 if (x2-x1) < ftol or (x2-x1) < 0.1*(x2-x0): del grid[-2] #remove collision
00474         
00475             return grid
00476 
    ##


Generated on Wed Nov 21 10:18:31 2007 for analysis by  doxygen 1.5.4