Top
Back: 4.4.1 intmat declarations
Forward: 4.4.3 intmat type cast
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.2 intmat expressions

An intmat expression is:

  1. an identifier of type intmat
  2. a function returning intmat
  3. intmat operations with int (+, -, *, div, %)
  4. intmat operations (+, -, *)
  5. a type cast to intmat (see intmat type cast)

Example:

 
  intmat Idm[2][2];
  Idm +1;          // add the unit intmat
→ 1,0,
→ 0,1 
  intmat m1[3][2] = _,1,-2;  // take entries from the last result
  m1;
→ 1,0,
→ 0,1,
→ 1,-2 
  intmat m2[2][3]=1,0,2,4,5,1;
  transpose(m2);
→ 1,4,
→ 0,5,
→ 2,1 
  intvec v1=1,2,4;
  intvec v2=5,7,8;
  m1=v1,v2;         // fill m1 with v1 and v2
  m1;
→ 1,2,
→ 4,5,
→ 7,8 
  trace(m1*m2);
→ 56

See Type conversion and casting; number.


Top Back: 4.4.1 intmat declarations Forward: 4.4.3 intmat type cast 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.