-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27187f3
commit ad9ec27
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|