# Path: reggie/utils/misc.py
# def rstate(rng=None):
#     """
#     Return a RandomState object. This is just a simple wrapper such that if rng
#     is already an instance of RandomState it will be passed through, otherwise
#     it will create a RandomState object using rng as its seed.
#     """
#     if not isinstance(rng, np.random.RandomState):
#         rng = np.random.RandomState(rng)
#     return rng
# 
# def repr_args(obj, *args, **kwargs):
#     """
#     Return a repr string for an object with args and kwargs.
#     """
#     typename = type(obj).__name__
#     args = ['{:s}'.format(str(val)) for val in args]
#     kwargs = ['{:s}={:s}'.format(name, str(val))
#               for name, val in kwargs.items()]
#     return '{:s}({:s})'.format(typename, ', '.join(args + kwargs))
# 
# Path: reggie/core/domains.py
# EPSILON = np.finfo(np.float64).resolution


import numpy as np
from ..utils.misc import rstate, repr_args
from .domains import EPSILON
        self.bounds = np.c_[a, b]
        self.ndim = len(self.bounds)

        if np.any(self.bounds[:, 1] <= self.bounds[:, 0]):
            raise ValueError("malformed upper/lower bounds")

    def __repr__(self):
        return repr_args(self,
                         self.bounds[:, 0].squeeze(),
                         self.bounds[:, 1].squeeze())

    def sample(self, size=None, rng=None):
        rng = rstate(rng)
        a = self.bounds[:, 0]
        b = self.bounds[:, 1] - a
        if size is None:
            return a + b * rng.rand(self.ndim)
        else:
            return a + b * rng.rand(size, self.ndim)

    def get_logprior(self, theta, grad=False):
        return (0.0, np.zeros_like(theta)) if grad else 0.0


class LogNormal(Prior):
    """
    Log-normal prior where log of each parameter value has an independent
    normal distribution with mean mu[i] and variance s2[i].
    """


# Path: reggie/utils/misc.py
# def rstate(rng=None):
#     """
#     Return a RandomState object. This is just a simple wrapper such that if rng
#     is already an instance of RandomState it will be passed through, otherwise
#     it will create a RandomState object using rng as its seed.
#     """
#     if not isinstance(rng, np.random.RandomState):
#         rng = np.random.RandomState(rng)
#     return rng
# 
# def repr_args(obj, *args, **kwargs):
#     """
#     Return a repr string for an object with args and kwargs.
#     """
#     typename = type(obj).__name__
#     args = ['{:s}'.format(str(val)) for val in args]
#     kwargs = ['{:s}={:s}'.format(name, str(val))
#               for name, val in kwargs.items()]
#     return '{:s}({:s})'.format(typename, ', '.join(args + kwargs))
# 
# Path: reggie/core/domains.py
# EPSILON = np.finfo(np.float64).resolution


# Path: reggie/core/priors.py
import numpy as np
from ..utils.misc import rstate, repr_args
from .domains import EPSILON

        self.bounds = np.c_[a, b]
        self.ndim = len(self.bounds)

        if np.any(self.bounds[:, 1] <= self.bounds[:, 0]):
            raise ValueError("malformed upper/lower bounds")

    def __repr__(self):
        return repr_args(self,
                         self.bounds[:, 0].squeeze(),
                         self.bounds[:, 1].squeeze())

    def sample(self, size=None, rng=None):
        rng = rstate(rng)
        a = self.bounds[:, 0]
        b = self.bounds[:, 1] - a
        if size is None:
            return a + b * rng.rand(self.ndim)
        else:
            return a + b * rng.rand(size, self.ndim)

    def get_logprior(self, theta, grad=False):
        return (0.0, np.zeros_like(theta)) if grad else 0.0


class LogNormal(Prior):
    """
    Log-normal prior where log of each parameter value has an independent
    normal distribution with mean mu[i] and variance s2[i].
    """


    bounds = (EPSILON, np.inf)