Liking cljdoc? Tell your friends :D

sicmutils.polynomial


absclj/s

(abs p)
source

addclj/s

(add p q)

Adds the polynomials p and q

Adds the polynomials p and q
sourceraw docstring

check-same-arityclj/s

(check-same-arity p q)
source

coefficientclj/s

source

coefficientsclj/s

(coefficients p)
source

degreeclj/s

(degree p)
source

divideclj/s

(divide u v)

Divide polynomial u by v, and return the pair of [quotient, remainder] polynomials. This assumes that the coefficients are drawn from a field, and so support division.

Divide polynomial u by v, and return the pair of [quotient, remainder]
polynomials. This assumes that the coefficients are drawn from a field,
and so support division.
sourceraw docstring

evaluateclj/s

(evaluate p xs)

Evaluates a multivariate polynomial p at xs.

Evaluates a multivariate polynomial p at xs.
sourceraw docstring

evenly-divideclj/s

(evenly-divide u v)

Divides the polynomial u by the polynomial v. Throws an IllegalStateException if the division leaves a remainder. Otherwise returns the quotient.

Divides the polynomial u by the polynomial v. Throws an IllegalStateException
if the division leaves a remainder. Otherwise returns the quotient.
sourceraw docstring

exponentsclj/s

source

exptclj/s

(expt p n)

Raise the polynomial p to the (integer) power n.

Raise the polynomial p to the (integer) power n.
sourceraw docstring

graded-lex-orderclj/s

(graded-lex-order xs ys)
source

graded-reverse-lex-orderclj/s

(graded-reverse-lex-order xs ys)
source

lex-orderclj/s

(lex-order xs ys)

Lex order for monomials considers the power of x, then the power of y, etc.

Lex order for monomials considers the power of x, then the power of y, etc.
sourceraw docstring

lower-arityclj/s

(lower-arity p)

Given a nonzero polynomial of arity A > 1, return an equivalent polynomial of arity 1 whose coefficients are polynomials of arity A-1.

Given a nonzero polynomial of arity A > 1, return an equivalent polynomial
of arity 1 whose coefficients are polynomials of arity A-1.
sourceraw docstring

makeclj/s

(make dense-coefficients)
(make arity xc-pairs)

When called with two arguments, the first is the arity (number of indeterminates) of the polynomial followed by a sequence of exponent-coefficient pairs. Each exponent should be a vector with length equal to the arity, with integer exponent values. To make 4 x^2 y + 5 x y^2, an arity 2 polynomial (since it has two variables, x and y), we could write the following for xc-pairs: [[[2 1] 4] [[1 2] 5]]

When called with one argument, the sequence is interpreted as a dense sequence of coefficients of an arity-1 (univariate) polynomial. The coefficients begin with the constant term and proceed to each higher power of the indeterminate. For example, x^2

  • 1 can be constructed by (make [-1 0 1]).
When called with two arguments, the first is the arity
(number of indeterminates) of the polynomial followed by a sequence
of exponent-coefficient pairs. Each exponent should be a vector with
length equal to the arity, with integer exponent values. To
make 4 x^2 y + 5 x y^2, an arity 2 polynomial (since it has two
variables, x and y), we could write the following for xc-pairs:
 [[[2 1] 4] [[1 2] 5]]

When called with one argument, the sequence is interpreted as a
dense sequence of coefficients of an arity-1 (univariate)
polynomial. The coefficients begin with the constant term and
proceed to each higher power of the indeterminate. For example, x^2
- 1 can be constructed by (make [-1 0 1]).
sourceraw docstring

make-constantclj/s

(make-constant arity c)

Return a constant polynomial of the given arity.

Return a constant polynomial of the given arity.
sourceraw docstring

map-coefficientsclj/s

(map-coefficients f p)

Map the function f over the coefficients of p, returning a new Polynomial.

Map the function f over the coefficients of p, returning a new Polynomial.
sourceraw docstring

map-exponentsclj/s

(map-exponents f p)

Map the function f over the exponents of each monomial in p, returning a new Polynomial.

Map the function f over the exponents of each monomial in p,
returning a new Polynomial.
sourceraw docstring

monomial?clj/s

(monomial? p)
source

mulclj/s

(mul p q)

Multiply polynomials p and q, and return the product.

Multiply polynomials p and q, and return the product.
sourceraw docstring

negateclj/s

source

partial-derivativeclj/s

(partial-derivative p i)

The partial derivative of the polynomial with respect to the i-th indeterminate.

The partial derivative of the polynomial with respect to the
i-th indeterminate.
sourceraw docstring

partial-derivativesclj/s

(partial-derivatives p)

The sequence of partial derivatives of p with respect to each indeterminate

The sequence of partial derivatives of p with respect to each
indeterminate
sourceraw docstring

Polynomialcljs

source

polynomial?clj/s

(polynomial? p)

Returns true if the supplied argument is an instance of Polynomial, false otherwise.

Returns true if the supplied argument is an instance of Polynomial, false
otherwise.
sourceraw docstring

PolynomialAnalyzercljs

source

pseudo-remainderclj/s

(pseudo-remainder u v)

Compute the pseudo-remainder of univariate polynomials p and q. Fractions won't appear in the result; instead the divisor is multiplied by the leading coefficient of the dividend before quotient terms are generated so that division will not result in fractions. Only the remainder is returned, together with the integerizing factor needed to make this happen. Similar in spirit to Knuth's algorithm 4.6.1R, except we don't multiply the remainder through during gaps in the remainder. Since you don't know up front how many times the integerizing multiplication will be done, we also return the number d for which d * u = q * v + r.

Compute the pseudo-remainder of univariate polynomials p and
q. Fractions won't appear in the result; instead the divisor is
multiplied by the leading coefficient of the dividend before
quotient terms are generated so that division will not result in
fractions. Only the remainder is returned, together with the
integerizing factor needed to make this happen. Similar in spirit to
Knuth's algorithm 4.6.1R, except we don't multiply the remainder
through during gaps in the remainder. Since you don't know up front
how many times the integerizing multiplication will be done, we also
return the number d for which d * u = q * v + r.
sourceraw docstring

raise-arityclj/s

(raise-arity p)

The opposite of lower-arity.

The opposite of lower-arity.
sourceraw docstring

subclj/s

(sub p q)

Subtract the polynomial q from the polynomial p.

Subtract the polynomial q from the polynomial p.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close