def apply_sin_deriv(self, val, target=None):
    """
    Apply sin derivative, where val is the activation of sin units.
    """

    if not target:
      target = self

    if isinstance(val, EigenMatrix):
      err_code = _eigenmat.apply_sin_deriv(self.p_mat, val.p_mat, target.p_mat)
    else:
      raise ValueError, "Value must be of type EigenMatrix."

    if err_code:
      raise generate_exception(err_code)

    return target

    Apply sin derivative, where val is the activation of sin units.
    
eigenmat/eigenmat.py