input_case nil$ % Matrices % -------- matrix A(2,2),B(2,2),V(2,1),X,Y; operator a,b,v; for i:=1:2 do for j:=1:2 do <>; for i:=1:2 do V(i,1):=v(i); det(A); trace(A); tp(A); % TransPose A*B; 1/A; X:=A^(-1)*V; Y:=mat( ( (1-x)^3*(3+x), 4*x*(1-x^2), -2*(1-x^2)*(3-x) ), ( 4*x*(1-x^2), -(1+x)^3*(3-x), 2*(1-x^2)*(3+x) ), ( -2*(1-x^2)*(3-x), 2*(1-x^2)*(3+x), 16*x ) )$ on gcd; rank(Y); nullspace(Y); mateigen(Y,alpha); clear X,Y; load_package linalg; if matrixp(A) and matrixp(V) and column_dim(A)=row_dim(V) then write "can be multiplied"; if matrixp(V) and squarep(V) then write "can be squared"; matrix_augment({make_identity(3),diagonal({x,y,z})}); matrix_stack({make_identity(3),band_matrix({x,y,z},3)}); diagonal({x,jordan_block(y,3),z}); extend(A,2,3,0); clear A,B,V,b,v; matrix A(4,4); for i:=1:4 do for j:=1:4 do A(i,j):=a(i,j); augment_columns(A,{2,4}); stack_rows(A,3); sub_matrix(A,{1,2,4},{2,3}); minor(A,2,3); mult_columns(A,{2,4},x); mult_rows(A,3,x); add_to_columns(A,{2,4},x); add_to_rows(A,3,x); add_columns(A,2,4,x); add_rows(A,1,3,x); swap_columns(A,2,4); swap_rows(A,1,3); copy_into(make_identity(2),A,1,3); clear A,a; load_package normform; A:=mat( ( 13/9, -2/9, 1/3, 4/9, 2/3 ), ( -2/9, 10/9, 2/15, -2/9, -11/15 ), ( 1/5, -2/5, 41/25, -2/5, 12/25 ), ( 4/9, -2/9, 14/15, 13/9, -2/15 ), ( -4/15, 8/15, 12/25, 8/15, 34/25 ) )$ l:=jordan(A)$ J:=first(l); P:=second(l); Q:=third(l)$ P*Q; P*J*Q-A; end;