rand_skew_poly - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Ore_algebra

  

rand_skew_poly

  

random skew polynomial generator

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

rand_skew_poly(vars, eqns, Alg)

Parameters

vars

-

indeterminate or list or set of indeterminates

eqns

-

(optional) equations specifying properties where option=value

Alg

-

Ore algebra table

Description

• 

A rand_skew_poly command generates a random polynomial in the variables vars from the algebra Alg. It is useful for generating test problems for debugging, testing and demonstration purposes.  Several options can be specified, determining the form of the polynomial.  This allows for general expressions with certain properties.

• 

The syntax of rand_skew_poly (described below) mimics that of randpoly.

• 

The first argument vars specifies the variables in which the polynomial is to be generated.  If vars is a single variable, a univariate polynomial in that variable is generated.  If vars is a list or set of variables, then a multivariate polynomial is generated.

• 

The remaining arguments eqns are equations of the form option=value.

• 

The possible options (and their default values) are:

Option

Use

Default Value

 

 

 

coeffs

generate the coefficients

rand(-99..99)

expons

generate the exponents

rand(6)

terms

number of terms generated

6

degree

total degree for a dense polynomial

5

dense

the polynomial is to be dense

 

  

Important: The terms option is intended for specifying sparse polynomials, where the number of terms is often significantly smaller than the degree of the polynomial.  The terms option will be overridden by the degree option.  A call rand_skew_poly(x, terms=7) will return a polynomial with 6 terms, since the default degree is five.  If you want a dense polynomial, use the dense option.

Examples

withOre_algebra:

Adiff_algebraDx,x:

rand_skew_polyx,A

7x5+22x455x394x2+87x56

(1)

rand_skew_polyDx,x,terms=20,A

7Dx5+40x44Dx4+42x2+71x10Dx3+50x317x2+62xDx2+23x475x382x24x+97Dx+75x510x4+80x383x273x62

(2)

rand_skew_poly([Dx],coeffs=proc() randpoly(x) end proc,A);

92x5+6x4+74x3+72x2+37x23Dx5+87x5+44x4+29x3+98x223x+10Dx4+61x58x429x3+95x2+11x49Dx3+47x5+40x481x3+91x2+68x10Dx2+31x551x4+77x3+95x2+x+1Dx+55x528x4+16x3+30x227x15

(3)

rand_skew_polyDx,x,dense,A

59Dx5+96x+72Dx4+87x2+47x90Dx3+43x3+92x291x88Dx2+48x4+53x328x2+5x+13Dx10x582x4+71x3+16x2+83x+9

(4)

Ashift_algebraSn,n:

rand_skew_poly(Sn,expons=rand(-5..5),coeffs=proc() randpoly(n) end proc,A);

96n5+50n460n342n2+7n89+53n5+31n4+81n340n2128n+12Sn5+37n5+5n4+96n317n2+25n+91Sn2+60n583n4+98n348n219n+62Sn3+98n564n4+64n390n260n34Sn

(5)

See Also

rand

randpoly