Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def split(self):
points = self.points()
m = points[len(points) // 2]
ivals = [
_Interval(self.a, m, 0, self.rdepth + 1),
_Interval(m, self.b, 0, self.rdepth + 1),
]
self.children = ivals
for ival in ivals:
ival.parent = self
ival.ndiv = self.ndiv
ival.err = self.err / 2
return ivals
def split(self):
points = self.points()
m = points[len(points) // 2]
ivals = [_Interval(self.a, m, 0, self.rdepth + 1),
_Interval(m, self.b, 0, self.rdepth + 1)]
self.children = ivals
for ival in ivals:
ival.parent = self
ival.ndiv = self.ndiv
ival.err = self.err / 2
return ivals
def split(self):
points = self.points()
m = points[len(points) // 2]
ivals = [_Interval(self.a, m, 0, self.rdepth + 1),
_Interval(m, self.b, 0, self.rdepth + 1)]
self.children = ivals
for ival in ivals:
ival.parent = self
ival.ndiv = self.ndiv
ival.err = self.err / 2
return ivals
def split(self):
points = self.points()
m = points[len(points) // 2]
ivals = [
_Interval(self.a, m, 0, self.rdepth + 1),
_Interval(m, self.b, 0, self.rdepth + 1),
]
self.children = ivals
for ival in ivals:
ival.parent = self
ival.ndiv = self.ndiv
ival.err = self.err / 2
return ivals
@classmethod
def make_first(cls, a, b, depth=2):
ival = _Interval(a, b, depth, rdepth=1)
ival.ndiv = 0
ival.parent = None
ival.err = sys.float_info.max # needed because inf/2 == inf
return ival
def make_first(cls, a, b, depth=2):
ival = _Interval(a, b, depth, rdepth=1)
ival.ndiv = 0
ival.parent = None
ival.err = sys.float_info.max # needed because inf/2 == inf
return ival