Skip to content

Instantly share code, notes, and snippets.

@tovrstra
Created March 20, 2019 01:48
Show Gist options
  • Save tovrstra/e535608c72a24ca1d1f74877317ad359 to your computer and use it in GitHub Desktop.
Save tovrstra/e535608c72a24ca1d1f74877317ad359 to your computer and use it in GitHub Desktop.
class OneDTransform:
def eval(self, r):
raise NotImplementedError
def inv(self, t):
raise NotImplementedError
def deriv1(self, r):
raise NotImplementedError
class Inv(OneDTransform):
def __init__(self, tf):
self.tf = tf
def eval(self, r):
return self.tf.inv(r)
def inv(self, t):
return self.tf.eval(t)
def deriv(self, r):
return 1.0/self.tf.deriv(self.tf.inv(r))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment