Class Sequences.SeqBase

    • Field Detail

      • length

        protected int length
      • start

        protected IExpr start
      • stop

        protected IExpr stop
      • variables

        protected IAST variables
    • Constructor Detail

    • Method Detail

      • interval

        public IExpr interval()
        Description copied from interface: ISeqBase
        The interval on which the sequence is defined
        Specified by:
        interval in interface ISeqBase
        Returns:
      • _intersect_interval

        public IExpr[] _intersect_interval​(ISeqBase other)
      • evaluate

        public IExpr evaluate​(IAST ast,
                              EvalEngine engine)
        Description copied from class: AbstractFunctionEvaluator
        Symbolic evaluation of a function. The method IExpr.head() contains the head (i.e. the function symbol) of this abstract syntax tree (AST).

        From ast.get(1) to ast.get(n) the ast contains the first to n-th argument of the function (alternatively you get the first to fifth argument with the methods IAST.arg1(), IAST.arg2(), IAST.arg3() ... IAST.arg5().

        Example: the expression Binomial(n,m) is represented as AST with ast.head() <=> F.Binomial, ast.arg1() <=> n and ast.arg2() <=> m

        If necessary use the methods from the Validate class to check the number or types of arguments in the evaluate method.

        Note: if the symbolic evaluation isn't possible or no result is found the evaluate method returns with a F.NIL value without throwing an exception!

        Specified by:
        evaluate in interface IFunctionEvaluator
        Specified by:
        evaluate in class AbstractFunctionEvaluator
        Parameters:
        ast - the abstract syntax tree (AST) which should be evaluated
        engine - the users current evaluation engine
        Returns:
        the evaluated object or F#NIL, if evaluation isn't possible
        See Also:
        Validate
      • 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
        Parameters:
        ast - the abstract syntax tree (AST) those arguments should be checked
        Returns:
        null if no range for the number of arguments is specified.
      • _mul

        public Sequences.SeqBase _mul​(Sequences.SeqBase other)

        Should only be used internally.

        this._mul(other) returns a new, term-wise multiplied sequence if this knows how to multiply with other, otherwise it returns null.

        Parameters:
        other -
        Returns:
        null
      • coeff

        public IExpr coeff​(IExpr pt)
        Returns the coefficient at point pt.
      • find_linear_recurrence

        public IAST find_linear_recurrence​(int n,
                                           IExpr d,
                                           IExpr gfvar)
        Description copied from interface: ISeqBase
        Finds the shortest linear recurrence that satisfies the first n terms of sequence of order ≤ n/2 if possible. If d is specified, find shortest linear recurrence of order ≤ min(d, n/2) if possible. Returns list of coefficients {b(1), b(2), ...} corresponding to the recurrence relation x(n) = b(1)*x(n-1) + b(2)*x(n-2) + ... Returns {}2 if no recurrence is found. If gfvar is specified, also returns ordinary generating function as a function of gfvar.
        Specified by:
        find_linear_recurrence in interface ISeqBase
        Returns:
      • iterator

        public org.matheclipse.core.sympy.series.Sequences.ISeqIterator iterator()
        Specified by:
        iterator in interface Iterable<IExpr>