% 2005-08-01:

	Two new procedures:

 SCALARPRODUCT (lint , lint) : int;
    Calculate the scalar product of the two arguments (which
    should be non-empty lists of integers of the same length),
    interpreted as vectors in the obvious manner. The integers
    need not be INUMs. The arguments are not checked.

 MATRIXWISELESSP (llint:Mtrx pmon, pmon) : genid ;
    Compare the two pure monomias by means of the matrix Mtrx.
    Resurns NIL, T, or (the value of) UNDECIDED, depending on
    whether the first monomial is found to be less than or greater
    than the second one, or neither, with respect to the order
    represented by Mtrx


	The new modes:

One alternative, MATRIX, is added to the commutative orders.
Independently of this, the matrix itself may be set, as the
ORDERMATRIX. The formal description of the ring setup thus now starts

%Polynomial ring (or correspondingly for other objects) set-up:
%	Type of ring (or correpondingly);	SETRINGTYPE(),COMMIFY(),
%						NONCOMMIFY()
%	Commutative DEG-REVLEX (default);	COMMIFY(),DEGREVLEXIFY()
%	Commutative DEG-LEX;			  - " -  ,DEGLEXIFY()
%	Commutative MATRIX;			  - " -  ,MATRIXIFY();
%		set the matrix with			SETORDERMATRIX(llint)
%	Non-commutative DEG-LEFTLEX (default);	NONCOMMIFY(),DEGLEFTLEXIFY()
%	Non-commutative ELIM-DEG-LEFTLEX	NONCOMMIFY(),ELIMORDER()

The mode changers work 'as usual'. (MATRIXIFY) changes the COMMUTATIVEORDER
to MATRIX: but the changes do not affect calculation unless or until the RINGTYPE is set
to COMMUTATIVE. The FEXPR SETORDERMATRIX sets the order matrix (represented by a
list of lists of integers) to a new value, returning the old one. GETORDERMATRIX
returns the present order matrix setting. The order matrix is initialised to NIL.

    Examples:

(SETORDERMATRIX ((1 2 0) (3 -1 1) (-1 0 0)))

sets the order matrix to

    1  2  0
    3 -1  1
   -1  0  0

and returns the old matrix (i.e. NIL, if no prior call to SETORDERMATRIX occurred).

(MATRIXIFY)

changes the commutative monoid order to MATRIX.

In this case, the order matrix row length is 3, whence it is assumed that the
ring is the polynomial ring in 3 variables; say x, y, and z, in this order.
Now suppose the two monomials m_1 = x^2*y^2*z^3 and m_2 = x^4*y are
to be compared by MONLESSP. This is done by taking successive scalar
products of the order matrix rows, and the LISPFORMs of m_1 and m_2,
until the scalar products differ. In this case, the LISPFORM of m_1 is its
list of exponents  (2 2 3) , and the LISPFORM of m_2 is  (4 1 0) . The first
scalar products are

  (1 2 0) * (2 2 3) = 2+4+0 = 6  and  (1 2 0) * (4 1 0) = 4+2+0 = 6 ,

i.e., we get equal products, and so the first line row is not decisive. The
second scalar products are

  (3 -1 1) * (2 2 3) = 6-2+3 = 7  and  (3 -1 1) * (4 1 0) = 12-1-0 = 11 ,

which indeed is decisive: m_1 is found smaller than m_2. (Therefore, in
this case, the third scalar products are not calculated.)
