Top
Back: D.3.1.11 submat
Forward: D.3.1.13 tensor
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.12 symmat

Procedure from library matrix.lib (see matrix_lib).

Usage:

symmat(n[,id]); n integer, id ideal

Return:

symmetric nxn matrix, with entries from id (default: id=maxideal(1))

Note:

if id has less than n*(n+1)/2 elements, the matrix is filled with 0’s, symmat(n); creates the generic symmetric matrix

Example:

 
LIB "matrix.lib";
ring R=0,x(1..10),lp;
print(symmat(4));    // the generic symmetric matrix
→ x(1),x(2),x(3),x(4),
→ x(2),x(5),x(6),x(7),
→ x(3),x(6),x(8),x(9),
→ x(4),x(7),x(9),x(10)
ring R1 = 0,(a,b,c),dp;
matrix A=symmat(4,maxideal(1)^3);
print(A);
→ a3, a2b,a2c,ab2,
→ a2b,abc,ac2,b3, 
→ a2c,ac2,b2c,bc2,
→ ab2,b3, bc2,c3  
int n=3;
ideal i = ideal(randommat(1,n*(n+1) div 2,maxideal(1),9));
print(symmat(n,i));  // symmetric matrix of generic linear forms
→ 4a-8b-2c,-a+b-4c, -8a-9b+c,
→ -a+b-4c, a-9b+9c, 6a-5b+9c,
→ -8a-9b+c,6a-5b+9c,2a+8c    
kill R1;

Top Back: D.3.1.11 submat Forward: D.3.1.13 tensor 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.