def constrain(self, transform, warning=True, trigger_parent=True):
        """
        :param transform: the :py:class:`paramz.transformations.Transformation`
                          to constrain the this parameter to.
        :param warning: print a warning if re-constraining parameters.

        Constrain the parameter to the given
        :py:class:`paramz.transformations.Transformation`.
        """
        if isinstance(transform, Transformation):
            self.param_array[...] = transform.initialize(self.param_array)
        elif transform == __fixed__:
            return self.fix(warning=warning, trigger_parent=trigger_parent)
        else:
            raise ValueError('Can only constrain with paramz.transformations.Transformation object')
        reconstrained = self.unconstrain()
        added = self._add_to_index_operations(self.constraints, reconstrained, transform, warning)
        self.trigger_update(trigger_parent)
        return added
:param transform: the :py:class:`paramz.transformations.Transformation`
                          to constrain the this parameter to.
        :param warning: print a warning if re-constraining parameters.

        Constrain the parameter to the given
        :py:class:`paramz.transformations.Transformation`.