parameters: (self)
return_statement: return residual
docstring: The numeric residual of the constraint.
  
          The violation is defined as the distance between the constrained
          expression's value and its projection onto the domain of the
          constraint:
  
          .. math::
  
              ||\\Pi(v) - v||_2^2
  
          where :math:`v` is the value of the constrained expression and
          :math:`\\Pi` is the projection operator onto the constraint's domain .
  
          Returns
          -------
          NumPy.ndarray
              The residual value.
  
          Raises
          ------
          ValueError
              If the constrained expression does not have a value associated
              with it.
docstring_summary: The numeric residual of the constraint.
docstring_tokens: The numeric residual of the constraint .
function: def violation(self):
          """The numeric residual of the constraint.
  
          The violation is defined as the distance between the constrained
          expression's value and its projection onto the domain of the
          constraint:
  
          .. math::
  
              ||\\Pi(v) - v||_2^2
  
          where :math:`v` is the value of the constrained expression and
          :math:`\\Pi` is the projection operator onto the constraint's domain .
  
          Returns
          -------
          NumPy.ndarray
              The residual value.
  
          Raises
          ------
          ValueError
              If the constrained expression does not have a value associated
              with it.
          """
          residual = self.residual
          if residual is None:
              raise ValueError("Cannot compute the violation of an constraint "
                               "whose expression is None-valued.")
          return residual
function_tokens: def violation ( self ) : residual = self . residual if residual is None : raise ValueError ( "Cannot compute the violation of an constraint " "whose expression is None-valued." ) return residual