Top
Back: D.3.1.8 outer
Forward: D.3.1.10 skewmat
FastBack: D. SINGULAR libraries
FastForward: E. Release Notes
Up: D.3.1 matrix_lib
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. 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

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: D.3.1.8 outer Forward: D.3.1.10 skewmat FastBack: D. SINGULAR libraries FastForward: E. Release Notes Up: D.3.1 matrix_lib Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.