Computer Algebra Commands 4-35
GCDMOD
Type: Function
Description: Finds the greatest common divisor of two polynomials modulo the current modulus.
Access: Arithmetic, !ÞMODULO
Input: Level 2/Argument 1: A polynomial expression.
Level 1/Argument 2: A polynomial expression.
Output: The greatest common divisor of the two expressions modulo the current modulus.
Flags: Exact mode must be set (flag –105 clear).
Numeric mode must not be set (flag -3 clear).
Radians mode must be set (flag –17 set).
Example: Find the greatest common divisor of 2x^2+5 and 4x^2-5x, modulo 13.
Command:
GCDMOD(2X^2+5,4X^2-5X)
Result: -(4X-5)
See also: GCD
GRAMSCHMIDT
Type: Command
Description: Finds an orthonormal base of a vector space with respect to a given scalar product.
Access: Matrices, !Ø LVECTOR
Input: Level 2/Argument 1: A vector representing a basis of a vector space.
Level 1/Argument 2: A function that defines a scalar product in that space. This can be given
as a program, or as the name of a variable containing the definition of the function.
Output: An orthonormal base of the vector space with respect to the given scalar product.
Flags: Exact mode must be set (flag –105 clear).
Numeric mode must not be set (flag -3 clear).
Radians mode must be set (flag –17 set).
Example: Find an orthonormal base for the vector space with base [1, 1+X] with respect to the scalar
product defined by :
PQ⋅ Px() Qx()⋅ xd
1–
1
∫
=
Command: GRAMSCHMIDT([1,1+X], « → P Q « PREVAL(INTVX(P*Q),-1,1) » »)
Result:
1
2
-------
X
1
3
---
6⋅
--------------
GREDUCE
Type: Command
Description: Reduces a polynomial with respect to a Grœbner basis.
Access: Catalog, …µ
Input: Level 3/Argument 1: A vector of polynomials in several variables.
Level 2/Argument 2: A vector of polynomials that is a Grœbner basis in the same variables.
Level 1/Argument 3: A vector giving the names of the variables.
Output: Level 1/Item 1: A vector containing the input polynomial reduced with respect to the
Grœbner basis, up to a constant; as with GBASIS, fractions in the result are avoided.