|
4.8.2 intmat expressions
An intmat expression is:
-
an identifier of type intmat
-
a function returning intmat
-
an intmat operation involving ints and int operations (
+ , - , * , div , % )
-
an expression involving intmats and the operations (
+ , - , * )
-
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.
|