Function: factrix - take out common scalar factors from a matrix or vector

Calling sequence:

factrix(M);

Parameters:

M - a Matrix, Vector, matrix, vector, list or listlist, or an expression that evaluates to one of these under evalm .

Description:

Examples:

> factrix(matrix([[3/4*t^2,6*t^3],[9*q*(t+t^4),3/7*t]]));

3/28*t*matrix([[7*t, 56*t^2], [84*q+84*t^3*q, 4]])

> factrix(Matrix([[3/4*t^2,6*t^3],[9*q*(t+t^4),3/7*t]]));

3/28*t._rtable[8044796]

Note that evaluating this result puts the constant factor 3/28 back into the Matrix.

> %;

t._rtable[8104612]

But using convert(..., list) we can separate the factors.

> convert(factrix(Matrix([[3/4*t^2,6*t^3],[9*q*(t+t^4),3/7*t]])),list);

[3/28*t, _rtable[8185332]]

A purely numeric factor can't be taken out of a list:

> factrix([2/3,4/3]);

[2/3, 4/3]

But it would work for a vector:

> factrix(vector([2/3,4/3]));

2/3*vector([1, 2])

Some more complicated factors:

> factrix(matrix([[x^2+x, x^3+x^2],
[x^3+2*x^2+x, x^3+3*x^2+3*x+1],
[w*x^2+2*w*x+w, 3*x+2+x^2]]));

(x+1)*matrix([[x, x^2], [x^2+x, x^2+2*x+1], [w*x+w,...

> factrix(vector([1+sqrt(2),3+2*sqrt(2)]));

(1+sqrt(2))*vector([1, 1+sqrt(2)])

Removing a floating-point factor:

> factrix([15.3*x,15.3*x*y]);

15.3*x*[1, y]

However, 4.6 and 2.3 are not recognized as related.

> factrix([4.6*x,2.3*x]);

x*[4.6, 2.3]

Try converting to rational first:

> factrix(convert([4.6*x,2.3*x],rational));

23/10*x*[2, 1]

See also: array , dot , factor , list , matrix , Matrix , vector , Vector

Maple Advisor Database R. Israel, 1998