MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / cubic

Function cubic

utils/resize_right/interp_methods.py:36–43  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

34
35@support_sz(4)
36def cubic(x):
37 fw, to_dtype, eps = set_framework_dependencies(x)
38 absx = fw.abs(x)
39 absx2 = absx ** 2
40 absx3 = absx ** 3
41 return ((1.5 * absx3 - 2.5 * absx2 + 1.) * to_dtype(absx <= 1.) +
42 (-0.5 * absx3 + 2.5 * absx2 - 4. * absx + 2.) *
43 to_dtype((1. < absx) & (absx <= 2.)))
44
45
46@support_sz(4)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected