The QuadraticValue object provides functionality for extracting components of a quadratic-related Expression through pattern matching. It identifies specific cases such as Root or Literal with a QuadraticSolution and produces structured data accordingly.
Extractor method for deconstructing an Expression into an Equation and an integer branch index, if applicable. This method matches specific patterns within the Expression: either a Root case or a Literal case containing a QuadraticSolution. If such patterns are not found, the method returns None.
Extractor method for deconstructing an Expression into an Equation and an integer branch index, if applicable. This method matches specific patterns within the Expression: either a Root case or a Literal case containing a QuadraticSolution. If such patterns are not found, the method returns None.
Value parameters
expr
the Expression instance to be deconstructed
Attributes
Returns
an Option containing a tuple of an Equation and an integer branch index if the match succeeds, otherwise None