'Check that the value satisfies the leaf\'s symbolic attributes.
Parameters
val : numeric type
The value assigned.
Returns
numeric type
The value converted to the proper matrix type.'

def _validate_value(self, val):

    if (val is not None):
        val = intf.DEFAULT_INTF.const_to_matrix(val)
        size = intf.size(val)
        if (size != self.size):
            raise ValueError(('Invalid    dimensions    (%s,    %s)    for    %s    value.' % (size[0], size[1], self.__class__.__name__)))
        (pos_val, neg_val) = intf.sign(val)
        if ((self.is_positive() and (not pos_val)) or (self.is_negative() and (not neg_val))):
            raise ValueError(('Invalid    sign    for    %s    value.' % self.__class__.__name__))
        elif self.is_positive():
            val = np.maximum(val, 0)
        elif self.is_negative():
            val = np.minimum(val, 0)
    return val
