Home Online Manual
Top
Back: bigintmat type cast
Forward: def
FastBack: bigint
FastForward: def
Up: bigintmat
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

4.3.4 bigintmat operations

+
addition with intmat, int, or bigint. In case of (big-)int, it is added to every entry of the matrix.

-
negation or subtraction with intmat, int, or bigint. In case of (big-)int, it is subtracted from every entry of the matrix.

*
multiplication with intmat, int, or bigint; In case of (big-)int, every entry of the matrix is multiplied by the (big-)int

<>, ==
comparators

bigintmat_expression [ int, int ]
is a bigintmat entry, where the first index indicates the row and the second the column


Example:

 
  bigintmat m[3][4] = 3,3,6,3,5,2,2,7,0,0,45,3;
  m;
==> 3,3, 6,3,
==> 5,2, 2,7,
==> 0,0,45,3
  m[1,3];               // show entry at [row 1, col 3]
==> 6
  m[1,3] = 10;          // set entry at [row 1, col 3] to 10
  m;
==> 3,3,10,3,
==> 5,2, 2,7,
==> 0,0,45,3
  size(m);         // number of entries
==> 12
  bigintmat n[2][3] = 2,6,0,4,0,5;
  n * m;
==> 36,18, 32,48,
==> 12,12,265,27
  typeof(_);
==> bigintmat
  -m;
==> -3,-3,-10,-3,
==> -5,-2, -2,-7,
==>  0, 0,-45,-3
  bigintmat o;
  o=n-10;
  o;
==> -8, -4,-10,
==> -6,-10, -5
  m*2;           // double each entry of m
==>  6,6,20, 6,
==> 10,4, 4,14,
==>  0,0,90, 6
  o-2*m;
==>    ? bigintmat/cmatrix not compatible
==>    ? error occurred in or before ./examples/bigintmat_operations.sing lin\
   e 15: `  o-2*m;`