Top
Back: 4.4 intmat
Forward: 4.4.2 intmat expressions
FastBack: 4. Data types
FastForward: 5. Functions and system variables
Up: 4.4 intmat
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

4.4.1 intmat declarations

Syntax:

intmat name = intmat_expression ;
intmat name [ rows ] [ cols ] = intmat_expression ;
intmat name [ rows ] [ cols ] = list_of_int_and_intvec_and_intmat_expressions ;
rows and cols must be positive int expressions.

Purpose:

defines an intmat variable.
Given a list of integers, the matrix is filled up with the first row from the left to the right, then the second row and so on. If the int_list contains less than rows*cols elements, the matrix is filled up with zeros; if it contains more elements, only the first rows*cols elements are used.

Default:

0 (1 x 1 matrix)

Example:
 
  intmat im[3][5]=1,3,5,7,8,9,10,11,12,13;
  im;
→ 1,3,5,7,8,
→ 9,10,11,12,13,
→ 0,0,0,0,0 
  im[3,2];
→ 0
  intmat m[2][3] = im[1..2,3..5];  // defines a submatrix
  m;
→ 5,7,8,
→ 11,12,13 

Top Back: 4.4 intmat Forward: 4.4.2 intmat expressions FastBack: 4. Data types FastForward: 5. Functions and system variables Up: 4.4 intmat 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.