Skip to content

Commit

Permalink
Function prototype class
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffrey-hokanson committed Dec 10, 2018
1 parent 27187f3 commit ad9ec27
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions psdr/function.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

class Function(object):
r"""Wrapper around function specifying the domain
Provided a function :math:`f: \mathcal{D} \subset \mathbb{R}^m \to \mathbb{R}^d`,
and a domain :math:`\mathcal{D}`, this class acts as a wrapper for both.
The key contribution of this class is to provide access to
the function on the *normalized domain* :math:`\mathcal{D}_{\text{norm}}`
that is a subset of the :math:`[-1,1]^m` cube; i.e.,
.. math::
\mathcal{D}_{\text{norm}} \subset [-1,1]^m \subset \mathbb{R}^m.
Parameters
----------
fun: function or list of functions
Either a python function or a list of functions to evaluate
domain: Domain
The domain on which the function is posed
vectorized: bool, default: False
If True, the functions are vectorized for use with numpy.
fun_kwargs: dict, default: empty
Keyword arguments to pass to the functions when evaluating function
"""
def __init__(self, funs, domain, vectorized = False, fun_kwargs = None):
self.funs = funs
self.domain = domain

def __call__(self, X, **kwargs):
pass

def __get__(self, i):
"""Get a particular sub-function as another Function"""
raise NotImplemented

0 comments on commit ad9ec27

Please sign in to comment.