Class FindInstance

  • All Implemented Interfaces:
    IFunctionEvaluator, IEvaluator

    public class FindInstance
    extends Solve
     FindInstance(equations, vars)
     

    attempts to find one instance which solves the equations for the variables vars.

    Examples

     >> FindInstance({x^2==4,x+y^2==6}, {x,y})
     {{x->-2,y->-2*Sqrt(2)}}
     

    Related terms

    Solve

    • Constructor Detail

      • FindInstance

        public FindInstance()
    • Method Detail

      • evaluate

        public IExpr evaluate​(IAST ast,
                              int argSize,
                              IExpr[] options,
                              EvalEngine engine,
                              IAST originalAST)
        Try to find at least one solution for a set of equations (i.e. Equal[...] expressions).
        Overrides:
        evaluate in class Solve
      • expectedArgSize

        public int[] expectedArgSize​(IAST ast)
        Description copied from interface: IFunctionEvaluator
        At index 0 return the "from", at index 1 return the "to" number of arguments, which are expected by this function. If the returned int array has length 3, the function allows headers unequal to the built-in function name (i.e. the function can be in "operator form").
        Specified by:
        expectedArgSize in interface IFunctionEvaluator
        Overrides:
        expectedArgSize in class Solve
        Parameters:
        ast - the abstract syntax tree (AST) those arguments should be checked
        Returns:
        null if no range for the number of arguments is specified.
      • setUp

        public void setUp​(ISymbol newSymbol)
        Description copied from class: AbstractFunctionEvaluator
        Evaluate built-in rules and define Attributes for a function.
        Specified by:
        setUp in interface IEvaluator
        Overrides:
        setUp in class Solve
        Parameters:
        newSymbol - the symbol which should be set up