Top
Back: outer
Forward: skewmat
FastBack:
FastForward:
Up: matrix_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.3.1.9 power

Procedure from library matrix.lib (see matrix_lib).

Usage:
power(A,n); A a square-matrix of type intmat or matrix, n=integer>=0

Return:
intmat resp. matrix, the n-th power of A

Note:
for A=intmat and big n the result may be wrong because of int overflow

Example:
 
LIB "matrix.lib";
intmat A[3][3]=1,2,3,4,5,6,7,8,9;
print(power(A,3));"";
==>    468   576   684
==>   1062  1305  1548
==>   1656  2034  2412
==> 
ring r=0,(x,y,z),dp;
matrix B[3][3]=0,x,y,z,0,0,y,z,0;
print(power(B,3));"";
==> yz2,    xy2+x2z,y3+xyz,
==> y2z+xz2,yz2,    0,     
==> y3+xyz, y2z+xz2,yz2    
==> 


Top Back: outer Forward: skewmat FastBack: FastForward: Up: matrix_lib Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 4.3.1, 2022, generated by texi2html.